@rozoai/deeplink-react
Version:
React component for scanning QR codes
1,432 lines • 1.86 MB
JavaScript
import Jr, { useRef as Ro, useMemo as Ji, useState as Si, useCallback as Ko, useEffect as zo, Fragment as Af } from "react";
function Tf(t, u) {
for (var a = 0; a < u.length; a++) {
const l = u[a];
if (typeof l != "string" && !Array.isArray(l)) {
for (const B in l)
if (B !== "default" && !(B in t)) {
const f = Object.getOwnPropertyDescriptor(l, B);
f && Object.defineProperty(t, B, f.get ? f : {
enumerable: !0,
get: () => l[B]
});
}
}
}
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
}
function Of(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var Xi = { exports: {} }, Ii = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Js;
function xf() {
if (Js) return Ii;
Js = 1;
var t = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
function a(l, B, f) {
var c = null;
if (f !== void 0 && (c = "" + f), B.key !== void 0 && (c = "" + B.key), "key" in B) {
f = {};
for (var r in B)
r !== "key" && (f[r] = B[r]);
} else f = B;
return B = f.ref, {
$$typeof: t,
type: l,
key: c,
ref: B !== void 0 ? B : null,
props: f
};
}
return Ii.Fragment = u, Ii.jsx = a, Ii.jsxs = a, Ii;
}
var Mi = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Xs;
function kf() {
return Xs || (Xs = 1, process.env.NODE_ENV !== "production" && function() {
function t(P) {
if (P == null) return null;
if (typeof P == "function")
return P.$$typeof === N ? null : P.displayName || P.name || null;
if (typeof P == "string") return P;
switch (P) {
case S:
return "Fragment";
case v:
return "Profiler";
case y:
return "StrictMode";
case T:
return "Suspense";
case D:
return "SuspenseList";
case C:
return "Activity";
}
if (typeof P == "object")
switch (typeof P.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), P.$$typeof) {
case g:
return "Portal";
case E:
return (P.displayName || "Context") + ".Provider";
case p:
return (P._context.displayName || "Context") + ".Consumer";
case L:
var w = P.render;
return P = P.displayName, P || (P = w.displayName || w.name || "", P = P !== "" ? "ForwardRef(" + P + ")" : "ForwardRef"), P;
case G:
return w = P.displayName || null, w !== null ? w : t(P.type) || "Memo";
case M:
w = P._payload, P = P._init;
try {
return t(P(w));
} catch {
}
}
return null;
}
function u(P) {
return "" + P;
}
function a(P) {
try {
u(P);
var w = !1;
} catch {
w = !0;
}
if (w) {
w = console;
var i = w.error, _ = typeof Symbol == "function" && Symbol.toStringTag && P[Symbol.toStringTag] || P.constructor.name || "Object";
return i.call(
w,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
_
), u(P);
}
}
function l(P) {
if (P === S) return "<>";
if (typeof P == "object" && P !== null && P.$$typeof === M)
return "<...>";
try {
var w = t(P);
return w ? "<" + w + ">" : "<...>";
} catch {
return "<...>";
}
}
function B() {
var P = $.A;
return P === null ? null : P.getOwner();
}
function f() {
return Error("react-stack-top-frame");
}
function c(P) {
if (J.call(P, "key")) {
var w = Object.getOwnPropertyDescriptor(P, "key").get;
if (w && w.isReactWarning) return !1;
}
return P.key !== void 0;
}
function r(P, w) {
function i() {
V || (V = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
w
));
}
i.isReactWarning = !0, Object.defineProperty(P, "key", {
get: i,
configurable: !0
});
}
function s() {
var P = t(this.type);
return K[P] || (K[P] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), P = this.props.ref, P !== void 0 ? P : null;
}
function x(P, w, i, _, j, Q, ne, ue) {
return i = Q.ref, P = {
$$typeof: m,
type: P,
key: w,
props: Q,
_owner: j
}, (i !== void 0 ? i : null) !== null ? Object.defineProperty(P, "ref", {
enumerable: !1,
get: s
}) : Object.defineProperty(P, "ref", { enumerable: !1, value: null }), P._store = {}, Object.defineProperty(P._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(P, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.defineProperty(P, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: ne
}), Object.defineProperty(P, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: ue
}), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
}
function n(P, w, i, _, j, Q, ne, ue) {
var Oe = w.children;
if (Oe !== void 0)
if (_)
if (h(Oe)) {
for (_ = 0; _ < Oe.length; _++)
e(Oe[_]);
Object.freeze && Object.freeze(Oe);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else e(Oe);
if (J.call(w, "key")) {
Oe = t(P);
var Ie = Object.keys(w).filter(function(Ee) {
return Ee !== "key";
});
_ = 0 < Ie.length ? "{key: someKey, " + Ie.join(": ..., ") + ": ...}" : "{key: someKey}", le[Oe + _] || (Ie = 0 < Ie.length ? "{" + Ie.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
_,
Oe,
Ie,
Oe
), le[Oe + _] = !0);
}
if (Oe = null, i !== void 0 && (a(i), Oe = "" + i), c(w) && (a(w.key), Oe = "" + w.key), "key" in w) {
i = {};
for (var we in w)
we !== "key" && (i[we] = w[we]);
} else i = w;
return Oe && r(
i,
typeof P == "function" ? P.displayName || P.name || "Unknown" : P
), x(
P,
Oe,
Q,
j,
B(),
i,
ne,
ue
);
}
function e(P) {
typeof P == "object" && P !== null && P.$$typeof === m && P._store && (P._store.validated = 1);
}
var k = Jr, m = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), p = Symbol.for("react.consumer"), E = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), $ = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, h = Array.isArray, R = console.createTask ? console.createTask : function() {
return null;
};
k = {
"react-stack-bottom-frame": function(P) {
return P();
}
};
var V, K = {}, ee = k["react-stack-bottom-frame"].bind(
k,
f
)(), fe = R(l(f)), le = {};
Mi.Fragment = S, Mi.jsx = function(P, w, i, _, j) {
var Q = 1e4 > $.recentlyCreatedOwnerStacks++;
return n(
P,
w,
i,
!1,
_,
j,
Q ? Error("react-stack-top-frame") : ee,
Q ? R(l(P)) : fe
);
}, Mi.jsxs = function(P, w, i, _, j) {
var Q = 1e4 > $.recentlyCreatedOwnerStacks++;
return n(
P,
w,
i,
!0,
_,
j,
Q ? Error("react-stack-top-frame") : ee,
Q ? R(l(P)) : fe
);
};
}()), Mi;
}
var Zs;
function Cf() {
return Zs || (Zs = 1, process.env.NODE_ENV === "production" ? Xi.exports = xf() : Xi.exports = kf()), Xi.exports;
}
var _f = Cf();
function As(t, { strict: u = !0 } = {}) {
return !t || typeof t != "string" ? !1 : u ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
}
function eu(t) {
return As(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
}
const tc = "2.33.1";
let La = {
getDocsUrl: ({ docsBaseUrl: t, docsPath: u = "", docsSlug: a }) => u ? `${t ?? "https://viem.sh"}${u}${a ? `#${a}` : ""}` : void 0,
version: `viem@${tc}`
};
class Xo extends Error {
constructor(u, a = {}) {
const l = a.cause instanceof Xo ? a.cause.details : a.cause?.message ? a.cause.message : a.details, B = a.cause instanceof Xo && a.cause.docsPath || a.docsPath, f = La.getDocsUrl?.({ ...a, docsPath: B }), c = [
u || "An error occurred.",
"",
...a.metaMessages ? [...a.metaMessages, ""] : [],
...f ? [`Docs: ${f}`] : [],
...l ? [`Details: ${l}`] : [],
...La.version ? [`Version: ${La.version}`] : []
].join(`
`);
super(c, a.cause ? { cause: a.cause } : void 0), Object.defineProperty(this, "details", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), Object.defineProperty(this, "docsPath", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), Object.defineProperty(this, "metaMessages", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), Object.defineProperty(this, "shortMessage", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), Object.defineProperty(this, "version", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), Object.defineProperty(this, "name", {
enumerable: !0,
configurable: !0,
writable: !0,
value: "BaseError"
}), this.details = l, this.docsPath = B, this.metaMessages = a.metaMessages, this.name = a.name ?? this.name, this.shortMessage = u, this.version = tc;
}
walk(u) {
return rc(this, u);
}
}
function rc(t, u) {
return u?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause !== void 0 ? rc(t.cause, u) : u ? null : t;
}
class nc extends Xo {
constructor({ size: u, targetSize: a, type: l }) {
super(`${l.charAt(0).toUpperCase()}${l.slice(1).toLowerCase()} size (${u}) exceeds padding size (${a}).`, { name: "SizeExceedsPaddingSizeError" });
}
}
function Ta(t, { dir: u, size: a = 32 } = {}) {
return typeof t == "string" ? Pf(t, { dir: u, size: a }) : Bf(t, { dir: u, size: a });
}
function Pf(t, { dir: u, size: a = 32 } = {}) {
if (a === null)
return t;
const l = t.replace("0x", "");
if (l.length > a * 2)
throw new nc({
size: Math.ceil(l.length / 2),
targetSize: a,
type: "hex"
});
return `0x${l[u === "right" ? "padEnd" : "padStart"](a * 2, "0")}`;
}
function Bf(t, { dir: u, size: a = 32 } = {}) {
if (a === null)
return t;
if (t.length > a)
throw new nc({
size: t.length,
targetSize: a,
type: "bytes"
});
const l = new Uint8Array(a);
for (let B = 0; B < a; B++) {
const f = u === "right";
l[f ? B : a - B - 1] = t[f ? B : t.length - B - 1];
}
return l;
}
class Rf extends Xo {
constructor({ max: u, min: a, signed: l, size: B, value: f }) {
super(`Number "${f}" is not in safe ${B ? `${B * 8}-bit ${l ? "signed" : "unsigned"} ` : ""}integer range ${u ? `(${a} to ${u})` : `(above ${a})`}`, { name: "IntegerOutOfRangeError" });
}
}
class If extends Xo {
constructor({ givenSize: u, maxSize: a }) {
super(`Size cannot exceed ${a} bytes. Given size: ${u} bytes.`, { name: "SizeOverflowError" });
}
}
function Ts(t, { size: u }) {
if (eu(t) > u)
throw new If({
givenSize: eu(t),
maxSize: u
});
}
function Mf(t, u = {}) {
const { signed: a, size: l } = u, B = BigInt(t);
let f;
l ? a ? f = (1n << BigInt(l) * 8n - 1n) - 1n : f = 2n ** (BigInt(l) * 8n) - 1n : typeof t == "number" && (f = BigInt(Number.MAX_SAFE_INTEGER));
const c = typeof f == "bigint" && a ? -f - 1n : 0;
if (f && B > f || B < c) {
const s = typeof t == "bigint" ? "n" : "";
throw new Rf({
max: f ? `${f}${s}` : void 0,
min: `${c}${s}`,
signed: a,
size: l,
value: `${t}${s}`
});
}
const r = `0x${(a && B < 0 ? (1n << BigInt(l * 8)) + BigInt(B) : B).toString(16)}`;
return l ? Ta(r, { size: l }) : r;
}
const jf = /* @__PURE__ */ new TextEncoder();
function Lf(t, u = {}) {
return typeof t == "number" || typeof t == "bigint" ? Nf(t, u) : typeof t == "boolean" ? Df(t, u) : As(t) ? oc(t, u) : ic(t, u);
}
function Df(t, u = {}) {
const a = new Uint8Array(1);
return a[0] = Number(t), typeof u.size == "number" ? (Ts(a, { size: u.size }), Ta(a, { size: u.size })) : a;
}
const Io = {
zero: 48,
nine: 57,
A: 65,
F: 70,
a: 97,
f: 102
};
function tu(t) {
if (t >= Io.zero && t <= Io.nine)
return t - Io.zero;
if (t >= Io.A && t <= Io.F)
return t - (Io.A - 10);
if (t >= Io.a && t <= Io.f)
return t - (Io.a - 10);
}
function oc(t, u = {}) {
let a = t;
u.size && (Ts(a, { size: u.size }), a = Ta(a, { dir: "right", size: u.size }));
let l = a.slice(2);
l.length % 2 && (l = `0${l}`);
const B = l.length / 2, f = new Uint8Array(B);
for (let c = 0, r = 0; c < B; c++) {
const s = tu(l.charCodeAt(r++)), x = tu(l.charCodeAt(r++));
if (s === void 0 || x === void 0)
throw new Xo(`Invalid byte sequence ("${l[r - 2]}${l[r - 1]}" in "${l}").`);
f[c] = s * 16 + x;
}
return f;
}
function Nf(t, u) {
const a = Mf(t, u);
return oc(a);
}
function ic(t, u = {}) {
const a = jf.encode(t);
return typeof u.size == "number" ? (Ts(a, { size: u.size }), Ta(a, { dir: "right", size: u.size })) : a;
}
const Zi = /* @__PURE__ */ BigInt(2 ** 32 - 1), ru = /* @__PURE__ */ BigInt(32);
function Uf(t, u = !1) {
return u ? { h: Number(t & Zi), l: Number(t >> ru & Zi) } : { h: Number(t >> ru & Zi) | 0, l: Number(t & Zi) | 0 };
}
function ac(t, u = !1) {
const a = t.length;
let l = new Uint32Array(a), B = new Uint32Array(a);
for (let f = 0; f < a; f++) {
const { h: c, l: r } = Uf(t[f], u);
[l[f], B[f]] = [c, r];
}
return [l, B];
}
const nu = (t, u, a) => t >>> a, ou = (t, u, a) => t << 32 - a | u >>> a, gi = (t, u, a) => t >>> a | u << 32 - a, vi = (t, u, a) => t << 32 - a | u >>> a, ea = (t, u, a) => t << 64 - a | u >>> a - 32, ta = (t, u, a) => t >>> a - 32 | u << 64 - a, Ff = (t, u, a) => t << a | u >>> 32 - a, qf = (t, u, a) => u << a | t >>> 32 - a, Vf = (t, u, a) => u << a - 32 | t >>> 64 - a, Kf = (t, u, a) => t << a - 32 | u >>> 64 - a;
function Mo(t, u, a, l) {
const B = (u >>> 0) + (l >>> 0);
return { h: t + a + (B / 2 ** 32 | 0) | 0, l: B | 0 };
}
const zf = (t, u, a) => (t >>> 0) + (u >>> 0) + (a >>> 0), Gf = (t, u, a, l) => u + a + l + (t / 2 ** 32 | 0) | 0, Qf = (t, u, a, l) => (t >>> 0) + (u >>> 0) + (a >>> 0) + (l >>> 0), Yf = (t, u, a, l, B) => u + a + l + B + (t / 2 ** 32 | 0) | 0, Wf = (t, u, a, l, B) => (t >>> 0) + (u >>> 0) + (a >>> 0) + (l >>> 0) + (B >>> 0), Hf = (t, u, a, l, B, f) => u + a + l + B + f + (t / 2 ** 32 | 0) | 0, bi = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
function Vi(t) {
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
}
function Ui(t) {
if (!Number.isSafeInteger(t) || t < 0)
throw new Error("positive integer expected, got " + t);
}
function Fo(t, ...u) {
if (!Vi(t))
throw new Error("Uint8Array expected");
if (u.length > 0 && !u.includes(t.length))
throw new Error("Uint8Array expected of length " + u + ", got length=" + t.length);
}
function sc(t) {
if (typeof t != "function" || typeof t.create != "function")
throw new Error("Hash should be wrapped by utils.createHasher");
Ui(t.outputLen), Ui(t.blockLen);
}
function ki(t, u = !0) {
if (t.destroyed)
throw new Error("Hash instance has been destroyed");
if (u && t.finished)
throw new Error("Hash#digest() has already been called");
}
function uc(t, u) {
Fo(t);
const a = u.outputLen;
if (t.length < a)
throw new Error("digestInto() expects output buffer of length at least " + a);
}
function $f(t) {
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
}
function Zo(...t) {
for (let u = 0; u < t.length; u++)
t[u].fill(0);
}
function Da(t) {
return new DataView(t.buffer, t.byteOffset, t.byteLength);
}
function Eo(t, u) {
return t << 32 - u | t >>> u;
}
const Jf = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
function Xf(t) {
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
}
function Zf(t) {
for (let u = 0; u < t.length; u++)
t[u] = Xf(t[u]);
return t;
}
const iu = Jf ? (t) => t : Zf, cc = (
/* @ts-ignore */
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
), ep = /* @__PURE__ */ Array.from({ length: 256 }, (t, u) => u.toString(16).padStart(2, "0"));
function ii(t) {
if (Fo(t), cc)
return t.toHex();
let u = "";
for (let a = 0; a < t.length; a++)
u += ep[t[a]];
return u;
}
const jo = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
function au(t) {
if (t >= jo._0 && t <= jo._9)
return t - jo._0;
if (t >= jo.A && t <= jo.F)
return t - (jo.A - 10);
if (t >= jo.a && t <= jo.f)
return t - (jo.a - 10);
}
function da(t) {
if (typeof t != "string")
throw new Error("hex string expected, got " + typeof t);
if (cc)
return Uint8Array.fromHex(t);
const u = t.length, a = u / 2;
if (u % 2)
throw new Error("hex string expected, got unpadded hex of length " + u);
const l = new Uint8Array(a);
for (let B = 0, f = 0; B < a; B++, f += 2) {
const c = au(t.charCodeAt(f)), r = au(t.charCodeAt(f + 1));
if (c === void 0 || r === void 0) {
const s = t[f] + t[f + 1];
throw new Error('hex string expected, got non-hex character "' + s + '" at index ' + f);
}
l[B] = c * 16 + r;
}
return l;
}
function tp(t) {
if (typeof t != "string")
throw new Error("string expected");
return new Uint8Array(new TextEncoder().encode(t));
}
function Oa(t) {
return typeof t == "string" && (t = tp(t)), Fo(t), t;
}
function To(...t) {
let u = 0;
for (let l = 0; l < t.length; l++) {
const B = t[l];
Fo(B), u += B.length;
}
const a = new Uint8Array(u);
for (let l = 0, B = 0; l < t.length; l++) {
const f = t[l];
a.set(f, B), B += f.length;
}
return a;
}
class Os {
}
function xs(t) {
const u = (l) => t().update(Oa(l)).digest(), a = t();
return u.outputLen = a.outputLen, u.blockLen = a.blockLen, u.create = () => t(), u;
}
function ks(t = 32) {
if (bi && typeof bi.getRandomValues == "function")
return bi.getRandomValues(new Uint8Array(t));
if (bi && typeof bi.randomBytes == "function")
return Uint8Array.from(bi.randomBytes(t));
throw new Error("crypto.getRandomValues must be defined");
}
const rp = BigInt(0), ji = BigInt(1), np = BigInt(2), op = BigInt(7), ip = BigInt(256), ap = BigInt(113), lc = [], fc = [], pc = [];
for (let t = 0, u = ji, a = 1, l = 0; t < 24; t++) {
[a, l] = [l, (2 * a + 3 * l) % 5], lc.push(2 * (5 * l + a)), fc.push((t + 1) * (t + 2) / 2 % 64);
let B = rp;
for (let f = 0; f < 7; f++)
u = (u << ji ^ (u >> op) * ap) % ip, u & np && (B ^= ji << (ji << /* @__PURE__ */ BigInt(f)) - ji);
pc.push(B);
}
const hc = ac(pc, !0), sp = hc[0], up = hc[1], su = (t, u, a) => a > 32 ? Vf(t, u, a) : Ff(t, u, a), uu = (t, u, a) => a > 32 ? Kf(t, u, a) : qf(t, u, a);
function cp(t, u = 24) {
const a = new Uint32Array(10);
for (let l = 24 - u; l < 24; l++) {
for (let c = 0; c < 10; c++)
a[c] = t[c] ^ t[c + 10] ^ t[c + 20] ^ t[c + 30] ^ t[c + 40];
for (let c = 0; c < 10; c += 2) {
const r = (c + 8) % 10, s = (c + 2) % 10, x = a[s], n = a[s + 1], e = su(x, n, 1) ^ a[r], k = uu(x, n, 1) ^ a[r + 1];
for (let m = 0; m < 50; m += 10)
t[c + m] ^= e, t[c + m + 1] ^= k;
}
let B = t[2], f = t[3];
for (let c = 0; c < 24; c++) {
const r = fc[c], s = su(B, f, r), x = uu(B, f, r), n = lc[c];
B = t[n], f = t[n + 1], t[n] = s, t[n + 1] = x;
}
for (let c = 0; c < 50; c += 10) {
for (let r = 0; r < 10; r++)
a[r] = t[c + r];
for (let r = 0; r < 10; r++)
t[c + r] ^= ~a[(r + 2) % 10] & a[(r + 4) % 10];
}
t[0] ^= sp[l], t[1] ^= up[l];
}
Zo(a);
}
let lp = class dc extends Os {
// NOTE: we accept arguments in bytes instead of bits here.
constructor(u, a, l, B = !1, f = 24) {
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = u, this.suffix = a, this.outputLen = l, this.enableXOF = B, this.rounds = f, Ui(l), !(0 < u && u < 200))
throw new Error("only keccak-f1600 function is supported");
this.state = new Uint8Array(200), this.state32 = $f(this.state);
}
clone() {
return this._cloneInto();
}
keccak() {
iu(this.state32), cp(this.state32, this.rounds), iu(this.state32), this.posOut = 0, this.pos = 0;
}
update(u) {
ki(this), u = Oa(u), Fo(u);
const { blockLen: a, state: l } = this, B = u.length;
for (let f = 0; f < B; ) {
const c = Math.min(a - this.pos, B - f);
for (let r = 0; r < c; r++)
l[this.pos++] ^= u[f++];
this.pos === a && this.keccak();
}
return this;
}
finish() {
if (this.finished)
return;
this.finished = !0;
const { state: u, suffix: a, pos: l, blockLen: B } = this;
u[l] ^= a, (a & 128) !== 0 && l === B - 1 && this.keccak(), u[B - 1] ^= 128, this.keccak();
}
writeInto(u) {
ki(this, !1), Fo(u), this.finish();
const a = this.state, { blockLen: l } = this;
for (let B = 0, f = u.length; B < f; ) {
this.posOut >= l && this.keccak();
const c = Math.min(l - this.posOut, f - B);
u.set(a.subarray(this.posOut, this.posOut + c), B), this.posOut += c, B += c;
}
return u;
}
xofInto(u) {
if (!this.enableXOF)
throw new Error("XOF is not possible for this instance");
return this.writeInto(u);
}
xof(u) {
return Ui(u), this.xofInto(new Uint8Array(u));
}
digestInto(u) {
if (uc(u, this), this.finished)
throw new Error("digest() was already called");
return this.writeInto(u), this.destroy(), u;
}
digest() {
return this.digestInto(new Uint8Array(this.outputLen));
}
destroy() {
this.destroyed = !0, Zo(this.state);
}
_cloneInto(u) {
const { blockLen: a, suffix: l, outputLen: B, rounds: f, enableXOF: c } = this;
return u || (u = new dc(a, l, B, c, f)), u.state32.set(this.state32), u.pos = this.pos, u.posOut = this.posOut, u.finished = this.finished, u.rounds = f, u.suffix = l, u.outputLen = B, u.enableXOF = c, u.destroyed = this.destroyed, u;
}
};
const fp = (t, u, a) => xs(() => new lp(u, t, a)), pp = fp(1, 136, 256 / 8);
function hp(t, u) {
return pp(As(t, { strict: !1 }) ? Lf(t) : t);
}
class dp extends Xo {
constructor({ address: u }) {
super(`Address "${u}" is invalid.`, {
metaMessages: [
"- Address must be a hex value of 20 bytes (40 hex characters).",
"- Address must match its checksum counterpart."
],
name: "InvalidAddressError"
});
}
}
class yc extends Map {
constructor(u) {
super(), Object.defineProperty(this, "maxSize", {
enumerable: !0,
configurable: !0,
writable: !0,
value: void 0
}), this.maxSize = u;
}
get(u) {
const a = super.get(u);
return super.has(u) && a !== void 0 && (this.delete(u), super.set(u, a)), a;
}
set(u, a) {
if (super.set(u, a), this.maxSize && this.size > this.maxSize) {
const l = this.keys().next().value;
l && this.delete(l);
}
return this;
}
}
const Na = /* @__PURE__ */ new yc(8192);
function mc(t, u) {
if (Na.has(`${t}.${u}`))
return Na.get(`${t}.${u}`);
const a = t.substring(2).toLowerCase(), l = hp(ic(a)), B = a.split("");
for (let c = 0; c < 40; c += 2)
l[c >> 1] >> 4 >= 8 && B[c] && (B[c] = B[c].toUpperCase()), (l[c >> 1] & 15) >= 8 && B[c + 1] && (B[c + 1] = B[c + 1].toUpperCase());
const f = `0x${B.join("")}`;
return Na.set(`${t}.${u}`, f), f;
}
function aa(t, u) {
if (!gc(t, { strict: !1 }))
throw new dp({ address: t });
return mc(t, u);
}
const yp = /^0x[a-fA-F0-9]{40}$/, Ua = /* @__PURE__ */ new yc(8192);
function gc(t, u) {
const { strict: a = !0 } = u ?? {}, l = `${t}.${a}`;
if (Ua.has(l))
return Ua.get(l);
const B = yp.test(t) ? t.toLowerCase() === t ? !0 : a ? mc(t) === t : !0 : !1;
return Ua.set(l, B), B;
}
function mp(t, u, a, l) {
if (typeof t.setBigUint64 == "function")
return t.setBigUint64(u, a, l);
const B = BigInt(32), f = BigInt(4294967295), c = Number(a >> B & f), r = Number(a & f), s = l ? 4 : 0, x = l ? 0 : 4;
t.setUint32(u + s, c, l), t.setUint32(u + x, r, l);
}
function gp(t, u, a) {
return t & u ^ ~t & a;
}
function vp(t, u, a) {
return t & u ^ t & a ^ u & a;
}
class vc extends Os {
constructor(u, a, l, B) {
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = u, this.outputLen = a, this.padOffset = l, this.isLE = B, this.buffer = new Uint8Array(u), this.view = Da(this.buffer);
}
update(u) {
ki(this), u = Oa(u), Fo(u);
const { view: a, buffer: l, blockLen: B } = this, f = u.length;
for (let c = 0; c < f; ) {
const r = Math.min(B - this.pos, f - c);
if (r === B) {
const s = Da(u);
for (; B <= f - c; c += B)
this.process(s, c);
continue;
}
l.set(u.subarray(c, c + r), this.pos), this.pos += r, c += r, this.pos === B && (this.process(a, 0), this.pos = 0);
}
return this.length += u.length, this.roundClean(), this;
}
digestInto(u) {
ki(this), uc(u, this), this.finished = !0;
const { buffer: a, view: l, blockLen: B, isLE: f } = this;
let { pos: c } = this;
a[c++] = 128, Zo(this.buffer.subarray(c)), this.padOffset > B - c && (this.process(l, 0), c = 0);
for (let e = c; e < B; e++)
a[e] = 0;
mp(l, B - 8, BigInt(this.length * 8), f), this.process(l, 0);
const r = Da(u), s = this.outputLen;
if (s % 4)
throw new Error("_sha2: outputLen should be aligned to 32bit");
const x = s / 4, n = this.get();
if (x > n.length)
throw new Error("_sha2: outputLen bigger than state");
for (let e = 0; e < x; e++)
r.setUint32(4 * e, n[e], f);
}
digest() {
const { buffer: u, outputLen: a } = this;
this.digestInto(u);
const l = u.slice(0, a);
return this.destroy(), l;
}
_cloneInto(u) {
u || (u = new this.constructor()), u.set(...this.get());
const { blockLen: a, buffer: l, length: B, finished: f, destroyed: c, pos: r } = this;
return u.destroyed = c, u.finished = f, u.length = B, u.pos = r, B % a && u.buffer.set(l), u;
}
clone() {
return this._cloneInto();
}
}
const Go = /* @__PURE__ */ Uint32Array.from([
1779033703,
3144134277,
1013904242,
2773480762,
1359893119,
2600822924,
528734635,
1541459225
]), to = /* @__PURE__ */ Uint32Array.from([
1779033703,
4089235720,
3144134277,
2227873595,
1013904242,
4271175723,
2773480762,
1595750129,
1359893119,
2917565137,
2600822924,
725511199,
528734635,
4215389547,
1541459225,
327033209
]), bp = /* @__PURE__ */ Uint32Array.from([
1116352408,
1899447441,
3049323471,
3921009573,
961987163,
1508970993,
2453635748,
2870763221,
3624381080,
310598401,
607225278,
1426881987,
1925078388,
2162078206,
2614888103,
3248222580,
3835390401,
4022224774,
264347078,
604807628,
770255983,
1249150122,
1555081692,
1996064986,
2554220882,
2821834349,
2952996808,
3210313671,
3336571891,
3584528711,
113926993,
338241895,
666307205,
773529912,
1294757372,
1396182291,
1695183700,
1986661051,
2177026350,
2456956037,
2730485921,
2820302411,
3259730800,
3345764771,
3516065817,
3600352804,
4094571909,
275423344,
430227734,
506948616,
659060556,
883997877,
958139571,
1322822218,
1537002063,
1747873779,
1955562222,
2024104815,
2227730452,
2361852424,
2428436474,
2756734187,
3204031479,
3329325298
]), Qo = /* @__PURE__ */ new Uint32Array(64);
class wp extends vc {
constructor(u = 32) {
super(64, u, 8, !1), this.A = Go[0] | 0, this.B = Go[1] | 0, this.C = Go[2] | 0, this.D = Go[3] | 0, this.E = Go[4] | 0, this.F = Go[5] | 0, this.G = Go[6] | 0, this.H = Go[7] | 0;
}
get() {
const { A: u, B: a, C: l, D: B, E: f, F: c, G: r, H: s } = this;
return [u, a, l, B, f, c, r, s];
}
// prettier-ignore
set(u, a, l, B, f, c, r, s) {
this.A = u | 0, this.B = a | 0, this.C = l | 0, this.D = B | 0, this.E = f | 0, this.F = c | 0, this.G = r | 0, this.H = s | 0;
}
process(u, a) {
for (let e = 0; e < 16; e++, a += 4)
Qo[e] = u.getUint32(a, !1);
for (let e = 16; e < 64; e++) {
const k = Qo[e - 15], m = Qo[e - 2], g = Eo(k, 7) ^ Eo(k, 18) ^ k >>> 3, S = Eo(m, 17) ^ Eo(m, 19) ^ m >>> 10;
Qo[e] = S + Qo[e - 7] + g + Qo[e - 16] | 0;
}
let { A: l, B, C: f, D: c, E: r, F: s, G: x, H: n } = this;
for (let e = 0; e < 64; e++) {
const k = Eo(r, 6) ^ Eo(r, 11) ^ Eo(r, 25), m = n + k + gp(r, s, x) + bp[e] + Qo[e] | 0, g = (Eo(l, 2) ^ Eo(l, 13) ^ Eo(l, 22)) + vp(l, B, f) | 0;
n = x, x = s, s = r, r = c + m | 0, c = f, f = B, B = l, l = m + g | 0;
}
l = l + this.A | 0, B = B + this.B | 0, f = f + this.C | 0, c = c + this.D | 0, r = r + this.E | 0, s = s + this.F | 0, x = x + this.G | 0, n = n + this.H | 0, this.set(l, B, f, c, r, s, x, n);
}
roundClean() {
Zo(Qo);
}
destroy() {
this.set(0, 0, 0, 0, 0, 0, 0, 0), Zo(this.buffer);
}
}
const bc = ac([
"0x428a2f98d728ae22",
"0x7137449123ef65cd",
"0xb5c0fbcfec4d3b2f",
"0xe9b5dba58189dbbc",
"0x3956c25bf348b538",
"0x59f111f1b605d019",
"0x923f82a4af194f9b",
"0xab1c5ed5da6d8118",
"0xd807aa98a3030242",
"0x12835b0145706fbe",
"0x243185be4ee4b28c",
"0x550c7dc3d5ffb4e2",
"0x72be5d74f27b896f",
"0x80deb1fe3b1696b1",
"0x9bdc06a725c71235",
"0xc19bf174cf692694",
"0xe49b69c19ef14ad2",
"0xefbe4786384f25e3",
"0x0fc19dc68b8cd5b5",
"0x240ca1cc77ac9c65",
"0x2de92c6f592b0275",
"0x4a7484aa6ea6e483",
"0x5cb0a9dcbd41fbd4",
"0x76f988da831153b5",
"0x983e5152ee66dfab",
"0xa831c66d2db43210",
"0xb00327c898fb213f",
"0xbf597fc7beef0ee4",
"0xc6e00bf33da88fc2",
"0xd5a79147930aa725",
"0x06ca6351e003826f",
"0x142929670a0e6e70",
"0x27b70a8546d22ffc",
"0x2e1b21385c26c926",
"0x4d2c6dfc5ac42aed",
"0x53380d139d95b3df",
"0x650a73548baf63de",
"0x766a0abb3c77b2a8",
"0x81c2c92e47edaee6",
"0x92722c851482353b",
"0xa2bfe8a14cf10364",
"0xa81a664bbc423001",
"0xc24b8b70d0f89791",
"0xc76c51a30654be30",
"0xd192e819d6ef5218",
"0xd69906245565a910",
"0xf40e35855771202a",
"0x106aa07032bbd1b8",
"0x19a4c116b8d2d0c8",
"0x1e376c085141ab53",
"0x2748774cdf8eeb99",
"0x34b0bcb5e19b48a8",
"0x391c0cb3c5c95a63",
"0x4ed8aa4ae3418acb",
"0x5b9cca4f7763e373",
"0x682e6ff3d6b2b8a3",
"0x748f82ee5defb2fc",
"0x78a5636f43172f60",
"0x84c87814a1f0ab72",
"0x8cc702081a6439ec",
"0x90befffa23631e28",
"0xa4506cebde82bde9",
"0xbef9a3f7b2c67915",
"0xc67178f2e372532b",
"0xca273eceea26619c",
"0xd186b8c721c0c207",
"0xeada7dd6cde0eb1e",
"0xf57d4f7fee6ed178",
"0x06f067aa72176fba",
"0x0a637dc5a2c898a6",
"0x113f9804bef90dae",
"0x1b710b35131c471b",
"0x28db77f523047d84",
"0x32caab7b40c72493",
"0x3c9ebe0a15c9bebc",
"0x431d67c49c100d4c",
"0x4cc5d4becb3e42b6",
"0x597f299cfc657e2a",
"0x5fcb6fab3ad6faec",
"0x6c44198c4a475817"
].map((t) => BigInt(t))), Sp = bc[0], Ep = bc[1], Yo = /* @__PURE__ */ new Uint32Array(80), Wo = /* @__PURE__ */ new Uint32Array(80);
class Ap extends vc {
constructor(u = 64) {
super(128, u, 16, !1), this.Ah = to[0] | 0, this.Al = to[1] | 0, this.Bh = to[2] | 0, this.Bl = to[3] | 0, this.Ch = to[4] | 0, this.Cl = to[5] | 0, this.Dh = to[6] | 0, this.Dl = to[7] | 0, this.Eh = to[8] | 0, this.El = to[9] | 0, this.Fh = to[10] | 0, this.Fl = to[11] | 0, this.Gh = to[12] | 0, this.Gl = to[13] | 0, this.Hh = to[14] | 0, this.Hl = to[15] | 0;
}
// prettier-ignore
get() {
const { Ah: u, Al: a, Bh: l, Bl: B, Ch: f, Cl: c, Dh: r, Dl: s, Eh: x, El: n, Fh: e, Fl: k, Gh: m, Gl: g, Hh: S, Hl: y } = this;
return [u, a, l, B, f, c, r, s, x, n, e, k, m, g, S, y];
}
// prettier-ignore
set(u, a, l, B, f, c, r, s, x, n, e, k, m, g, S, y) {
this.Ah = u | 0, this.Al = a | 0, this.Bh = l | 0, this.Bl = B | 0, this.Ch = f | 0, this.Cl = c | 0, this.Dh = r | 0, this.Dl = s | 0, this.Eh = x | 0, this.El = n | 0, this.Fh = e | 0, this.Fl = k | 0, this.Gh = m | 0, this.Gl = g | 0, this.Hh = S | 0, this.Hl = y | 0;
}
process(u, a) {
for (let E = 0; E < 16; E++, a += 4)
Yo[E] = u.getUint32(a), Wo[E] = u.getUint32(a += 4);
for (let E = 16; E < 80; E++) {
const L = Yo[E - 15] | 0, T = Wo[E - 15] | 0, D = gi(L, T, 1) ^ gi(L, T, 8) ^ nu(L, T, 7), G = vi(L, T, 1) ^ vi(L, T, 8) ^ ou(L, T, 7), M = Yo[E - 2] | 0, C = Wo[E - 2] | 0, N = gi(M, C, 19) ^ ea(M, C, 61) ^ nu(M, C, 6), $ = vi(M, C, 19) ^ ta(M, C, 61) ^ ou(M, C, 6), J = Qf(G, $, Wo[E - 7], Wo[E - 16]), h = Yf(J, D, N, Yo[E - 7], Yo[E - 16]);
Yo[E] = h | 0, Wo[E] = J | 0;
}
let { Ah: l, Al: B, Bh: f, Bl: c, Ch: r, Cl: s, Dh: x, Dl: n, Eh: e, El: k, Fh: m, Fl: g, Gh: S, Gl: y, Hh: v, Hl: p } = this;
for (let E = 0; E < 80; E++) {
const L = gi(e, k, 14) ^ gi(e, k, 18) ^ ea(e, k, 41), T = vi(e, k, 14) ^ vi(e, k, 18) ^ ta(e, k, 41), D = e & m ^ ~e & S, G = k & g ^ ~k & y, M = Wf(p, T, G, Ep[E], Wo[E]), C = Hf(M, v, L, D, Sp[E], Yo[E]), N = M | 0, $ = gi(l, B, 28) ^ ea(l, B, 34) ^ ea(l, B, 39), J = vi(l, B, 28) ^ ta(l, B, 34) ^ ta(l, B, 39), h = l & f ^ l & r ^ f & r, R = B & c ^ B & s ^ c & s;
v = S | 0, p = y | 0, S = m | 0, y = g | 0, m = e | 0, g = k | 0, { h: e, l: k } = Mo(x | 0, n | 0, C | 0, N | 0), x = r | 0, n = s | 0, r = f | 0, s = c | 0, f = l | 0, c = B | 0;
const V = zf(N, J, R);
l = Gf(V, C, $, h), B = V | 0;
}
({ h: l, l: B } = Mo(this.Ah | 0, this.Al | 0, l | 0, B | 0)), { h: f, l: c } = Mo(this.Bh | 0, this.Bl | 0, f | 0, c | 0), { h: r, l: s } = Mo(this.Ch | 0, this.Cl | 0, r | 0, s | 0), { h: x, l: n } = Mo(this.Dh | 0, this.Dl | 0, x | 0, n | 0), { h: e, l: k } = Mo(this.Eh | 0, this.El | 0, e | 0, k | 0), { h: m, l: g } = Mo(this.Fh | 0, this.Fl | 0, m | 0, g | 0), { h: S, l: y } = Mo(this.Gh | 0, this.Gl | 0, S | 0, y | 0), { h: v, l: p } = Mo(this.Hh | 0, this.Hl | 0, v | 0, p | 0), this.set(l, B, f, c, r, s, x, n, e, k, m, g, S, y, v, p);
}
roundClean() {
Zo(Yo, Wo);
}
destroy() {
Zo(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
const wc = /* @__PURE__ */ xs(() => new wp()), Tp = /* @__PURE__ */ xs(() => new Ap()), cu = wc;
class Sc extends Os {
constructor(u, a) {
super(), this.finished = !1, this.destroyed = !1, sc(u);
const l = Oa(a);
if (this.iHash = u.create(), typeof this.iHash.update != "function")
throw new Error("Expected instance of class which extends utils.Hash");
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
const B = this.blockLen, f = new Uint8Array(B);
f.set(l.length > B ? u.create().update(l).digest() : l);
for (let c = 0; c < f.length; c++)
f[c] ^= 54;
this.iHash.update(f), this.oHash = u.create();
for (let c = 0; c < f.length; c++)
f[c] ^= 106;
this.oHash.update(f), Zo(f);
}
update(u) {
return ki(this), this.iHash.update(u), this;
}
digestInto(u) {
ki(this), Fo(u, this.outputLen), this.finished = !0, this.iHash.digestInto(u), this.oHash.update(u), this.oHash.digestInto(u), this.destroy();
}
digest() {
const u = new Uint8Array(this.oHash.outputLen);
return this.digestInto(u), u;
}
_cloneInto(u) {
u || (u = Object.create(Object.getPrototypeOf(this), {}));
const { oHash: a, iHash: l, finished: B, destroyed: f, blockLen: c, outputLen: r } = this;
return u = u, u.finished = B, u.destroyed = f, u.blockLen = c, u.outputLen = r, u.oHash = a._cloneInto(u.oHash), u.iHash = l._cloneInto(u.iHash), u;
}
clone() {
return this._cloneInto();
}
destroy() {
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
}
}
const Ec = (t, u, a) => new Sc(t, u).update(a).digest();
Ec.create = (t, u) => new Sc(t, u);
const Ac = "0x5772FBe7a7817ef7F586215CA8b23b8dD22C8897", Op = {
chainId: 8453
}, ti = {
chainId: Op.chainId,
token: aa("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
chainName: "Base",
name: "USD Coin",
symbol: "USDC",
fiatISO: "USD",
decimals: 6
};
function Tc(t) {
if (!t.startsWith("ethereum:"))
return null;
const u = t.slice(9), [a, l] = u.split("?"), [B, f] = a.split("@");
let c, r, s, x;
if (B.includes("/")) {
const [k, m] = B.split("/");
c = k, r = m;
} else /^0x[a-fA-F0-9]{40}$/.test(B) && (s = B);
f && (x = f.startsWith("0x") ? parseInt(f, 16) : parseInt(f, 10));
const n = {};
if (l) {
const k = l.split("&");
for (const m of k) {
const [g, S] = m.split("=");
g && S && (n[g] = decodeURIComponent(S));
}
}
const e = {
type: "ethereum",
message: "Parsed Ethereum URI",
address: s,
chain_id: x
};
c && (e.asset = { contract: c }), n.value && (e.amount = n.value), !e.amount && n.uint256 && (e.amount = n.uint256), r && (e.operation = r.toLowerCase()), n.address && /^0x[a-fA-F0-9]{40}$/.test(n.address) && (e.address = n.address), e.fee = {
gasLimit: n.gas || n.gasLimit,
gasPrice: n.gasPrice,
maxFeePerGas: n.maxFeePerGas,
maxPriorityFeePerGas: n.maxPriorityFeePerGas
}, e.extra_params = {};
for (const [k, m] of Object.entries(n))
[
"value",
"gas",
"gasLimit",
"gasPrice",
"maxFeePerGas",
"maxPriorityFeePerGas",
"address"
].includes(k) || (e.extra_params[k] = m);
return e.raw = {
data: t
}, e;
}
var xp = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : {};
function Oc(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function Cs(t) {
if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
var u = t.default;
if (typeof u == "function") {
var a = function l() {
var B = !1;
try {
B = this instanceof l;
} catch {
}
return B ? Reflect.construct(u, arguments, this.constructor) : u.apply(this, arguments);
};
a.prototype = u.prototype;
} else a = {};
return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(t).forEach(function(l) {
var B = Object.getOwnPropertyDescriptor(t, l);
Object.defineProperty(a, l, B.get ? B : {
enumerable: !0,
get: function() {
return t[l];
}
});
}), a;
}
var lu = {}, Li = {}, fu;
function kp() {
if (fu) return Li;
fu = 1, Li.byteLength = r, Li.toByteArray = x, Li.fromByteArray = k;
for (var t = [], u = [], a = typeof Uint8Array < "u" ? Uint8Array : Array, l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", B = 0, f = l.length; B < f; ++B)
t[B] = l[B], u[l.charCodeAt(B)] = B;
u[45] = 62, u[95] = 63;
function c(m) {
var g = m.length;
if (g % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var S = m.indexOf("=");
S === -1 && (S = g);
var y = S === g ? 0 : 4 - S % 4;
return [S, y];
}
function r(m) {
var g = c(m), S = g[0], y = g[1];
return (S + y) * 3 / 4 - y;
}
function s(m, g, S) {
return (g + S) * 3 / 4 - S;
}
function x(m) {
var g, S = c(m), y = S[0], v = S[1], p = new a(s(m, y, v)), E = 0, L = v > 0 ? y - 4 : y, T;
for (T = 0; T < L; T += 4)
g = u[m.charCodeAt(T)] << 18 | u[m.charCodeAt(T + 1)] << 12 | u[m.charCodeAt(T + 2)] << 6 | u[m.charCodeAt(T + 3)], p[E++] = g >> 16 & 255, p[E++] = g >> 8 & 255, p[E++] = g & 255;
return v === 2 && (g = u[m.charCodeAt(T)] << 2 | u[m.charCodeAt(T + 1)] >> 4, p[E++] = g & 255), v === 1 && (g = u[m.charCodeAt(T)] << 10 | u[m.charCodeAt(T + 1)] << 4 | u[m.charCodeAt(T + 2)] >> 2, p[E++] = g >> 8 & 255, p[E++] = g & 255), p;
}
function n(m) {
return t[m >> 18 & 63] + t[m >> 12 & 63] + t[m >> 6 & 63] + t[m & 63];
}
function e(m, g, S) {
for (var y, v = [], p = g; p < S; p += 3)
y = (m[p] << 16 & 16711680) + (m[p + 1] << 8 & 65280) + (m[p + 2] & 255), v.push(n(y));
return v.join("");
}
function k(m) {
for (var g, S = m.length, y = S % 3, v = [], p = 16383, E = 0, L = S - y; E < L; E += p)
v.push(e(m, E, E + p > L ? L : E + p));
return y === 1 ? (g = m[S - 1], v.push(
t[g >> 2] + t[g << 4 & 63] + "=="
)) : y === 2 && (g = (m[S - 2] << 8) + m[S - 1], v.push(
t[g >> 10] + t[g >> 4 & 63] + t[g << 2 & 63] + "="
)), v.join("");
}
return Li;
}
var Fa = {};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
var pu;
function Cp() {
return pu || (pu = 1, Fa.read = function(t, u, a, l, B) {
var f, c, r = B * 8 - l - 1, s = (1 << r) - 1, x = s >> 1, n = -7, e = a ? B - 1 : 0, k = a ? -1 : 1, m = t[u + e];
for (e += k, f = m & (1 << -n) - 1, m >>= -n, n += r; n > 0; f = f * 256 + t[u + e], e += k, n -= 8)
;
for (c = f & (1 << -n) - 1, f >>= -n, n += l; n > 0; c = c * 256 + t[u + e], e += k, n -= 8)
;
if (f === 0)
f = 1 - x;
else {
if (f === s)
return c ? NaN : (m ? -1 : 1) * (1 / 0);
c = c + Math.pow(2, l), f = f - x;
}
return (m ? -1 : 1) * c * Math.pow(2, f - l);
}, Fa.write = function(t, u, a, l, B, f) {
var c, r, s, x = f * 8 - B - 1, n = (1 << x) - 1, e = n >> 1, k = B === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = l ? 0 : f - 1, g = l ? 1 : -1, S = u < 0 || u === 0 && 1 / u < 0 ? 1 : 0;
for (u = Math.abs(u), isNaN(u) || u === 1 / 0 ? (r = isNaN(u) ? 1 : 0, c = n) : (c = Math.floor(Math.log(u) / Math.LN2), u * (s = Math.pow(2, -c)) < 1 && (c--, s *= 2), c + e >= 1 ? u += k / s : u += k * Math.pow(2, 1 - e), u * s >= 2 && (c++, s /= 2), c + e >= n ? (r = 0, c = n) : c + e >= 1 ? (r = (u * s - 1) * Math.pow(2, B), c = c + e) : (r = u * Math.pow(2, e - 1) * Math.pow(2, B), c = 0)); B >= 8; t[a + m] = r & 255, m += g, r /= 256, B -= 8)
;
for (c = c << B | r, x += B; x > 0; t[a + m] = c & 255, m += g, c /= 256, x -= 8)
;
t[a + m - g] |= S * 128;
}), Fa;
}
var hu;
function _s() {
return hu || (hu = 1, function(t) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
const u = kp(), a = Cp(), l = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = r, t.SlowBuffer = p, t.INSPECT_MAX_BYTES = 50;
const B = 2147483647;
t.kMaxLength = B, r.TYPED_ARRAY_SUPPORT = f(), !r.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
);
function f() {
try {
const A = new Uint8Array(1), o = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(o, Uint8Array.prototype), Object.setPrototypeOf(A, o), A.foo() === 42;
} catch {
return !1;
}
}
Object.defineProperty(r.prototype, "parent", {
enumerable: !0,
get: function() {
if (r.isBuffer(this))
return this.buffer;
}
}), Object.defineProperty(r.prototype, "offset", {
enumerable: !0,
get: function() {
if (r.isBuffer(this))
return this.byteOffset;
}
});
function c(A) {
if (A > B)
throw new RangeError('The value "' + A + '" is invalid for option "size"');
const o = new Uint8Array(A);
return Object.setPrototypeOf(o, r.prototype), o;
}
function r(A, o, d) {
if (typeof A == "number") {
if (typeof o == "string")
throw new TypeError(
'The "string" argument must be of type string. Received type number'
);
return e(A);
}
return s(A, o, d);
}
r.poolSize = 8192;
function s(A, o, d) {
if (typeof A == "string")
return k(A, o);
if (ArrayBuffer.isView(A))
return g(A);
if (A == null)
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof A
);
if (ve(A, ArrayBuffer) || A && ve(A.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ve(A, SharedArrayBuffer) || A && ve(A.buffer, SharedArrayBuffer)))
return S(A, o, d);
if (typeof A == "number")
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
);
const U = A.valueOf && A.valueOf();
if (U != null && U !== A)
return r.from(U, o, d);
const H = y(A);
if (H) return H;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof A[Symbol.toPrimitive] == "function")
return r.from(A[Symbol.toPrimitive]("string"), o, d);
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof A
);
}
r.from = function(A, o, d) {
return s(A, o, d);
}, Object.setPrototypeOf(r.prototype, Uint8Array.prototype), Object.setPrototypeOf(r, Uint8Array);
function x(A) {
if (typeof A != "number")
throw new TypeError('"size" argument must be of type number');
if (A < 0)
throw new RangeError('The value "' + A + '" is invalid for option "size"');
}
function n(A, o, d) {
return x(A), A <= 0 ? c(A) : o !== void 0 ? typeof d == "string" ? c(A).fill(o, d) : c(A).fill(o) : c(A);
}
r.alloc = function(A, o, d) {
return n(A, o, d);
};
function e(A) {
return x(A), c(A < 0 ? 0 : v(A) | 0);
}
r.allocUnsafe = function(A) {
return e(A);
}, r.allocUnsafeSlow = function(A) {
return e(A);
};
function k(A, o) {
if ((typeof o != "string" || o === "") && (o = "utf8"), !r.isEncoding(o))
throw new TypeError("Unknown encoding: " + o);
const d = E(A, o) | 0;
let U = c(d);
const H = U.write(A, o);
return H !== d && (U = U.slice(0, H)), U;
}
function m(A) {
const o = A.length < 0 ? 0 : v(A.length) | 0, d = c(o);
for (let U = 0; U < o; U += 1)
d[U] = A[U] & 255;
return d;
}
function g(A) {
if (ve(A, Uint8Array)) {
const o = new Uint8Array(A);
return S(o.buffer, o.byteOffset, o.byteLength);
}
return m(A);
}
function S(A, o, d) {
if (o < 0 || A.byteLength < o)
throw new RangeError('"offset" is outside of buffer bounds');
if (A.byteLength < o + (d || 0))
throw new RangeError('"length" is outside of buffer bounds');
let U;
return o === void 0 && d === void 0 ? U = new Uint8Array(A) : d === void 0 ? U = new Uint8Array(A, o) : U = new Uint8Array(A, o, d), Object.setPrototypeOf(U, r.prototype), U;
}
function y(A) {
if (r.isBuffer(A)) {
const o = v(A.length) | 0, d = c(o);
return d.length === 0 || A.copy(d, 0, 0, o), d;
}
if (A.length !== void 0)
return typeof A.length != "number" || O(A.length) ? c(0) : m(A);
if (A.type === "Buffer" && Array.isArray(A.data))
return m(A.data);
}
function v(A) {
if