raggie-wallet-connector
Version:
This is a React component built by the CryptoRaggies team to enable any React website to easily connect to popular Cardano wallets. The user's choice of wallet is persisted to local storage and the wallet connector will automatically reconnect the previou
1,349 lines (1,347 loc) • 5.18 MB
JavaScript
import * as T from "react";
import dg, { useState as NA, Fragment as Ts, createContext as EQ, useContext as RC, useRef as qA, useEffect as _A, useMemo as Vs, useCallback as dA, useLayoutEffect as Ho, useId as zs, forwardRef as xA, cloneElement as qQ, createElement as gE, Children as zD } from "react";
import * as Mc from "react-dom";
import Fc, { flushSync as Jc, createPortal as Kc } from "react-dom";
var ao = { exports: {} }, ZQ = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var PD;
function Yc() {
if (PD) return ZQ;
PD = 1;
var i = dg, A = Symbol.for("react.element"), g = Symbol.for("react.fragment"), Q = Object.prototype.hasOwnProperty, B = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
function a(D, t, w) {
var e, c = {}, n = null, h = null;
w !== void 0 && (n = "" + w), t.key !== void 0 && (n = "" + t.key), t.ref !== void 0 && (h = t.ref);
for (e in t) Q.call(t, e) && !C.hasOwnProperty(e) && (c[e] = t[e]);
if (D && D.defaultProps) for (e in t = D.defaultProps, t) c[e] === void 0 && (c[e] = t[e]);
return { $$typeof: A, type: D, key: n, ref: h, props: c, _owner: B.current };
}
return ZQ.Fragment = g, ZQ.jsx = a, ZQ.jsxs = a, ZQ;
}
var OQ = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var $D;
function Rc() {
return $D || ($D = 1, process.env.NODE_ENV !== "production" && function() {
var i = dg, A = Symbol.for("react.element"), g = Symbol.for("react.portal"), Q = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), D = Symbol.for("react.context"), t = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), e = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), n = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), M = Symbol.iterator, J = "@@iterator";
function _(Y) {
if (Y === null || typeof Y != "object")
return null;
var W = M && Y[M] || Y[J];
return typeof W == "function" ? W : null;
}
var p = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function U(Y) {
{
for (var W = arguments.length, gA = new Array(W > 1 ? W - 1 : 0), wA = 1; wA < W; wA++)
gA[wA - 1] = arguments[wA];
d("error", Y, gA);
}
}
function d(Y, W, gA) {
{
var wA = p.ReactDebugCurrentFrame, GA = wA.getStackAddendum();
GA !== "" && (W += "%s", gA = gA.concat([GA]));
var rA = gA.map(function(JA) {
return String(JA);
});
rA.unshift("Warning: " + W), Function.prototype.apply.call(console[Y], console, rA);
}
}
var q = !1, L = !1, f = !1, j = !1, Z = !1, O;
O = Symbol.for("react.module.reference");
function BA(Y) {
return !!(typeof Y == "string" || typeof Y == "function" || Y === Q || Y === C || Z || Y === B || Y === w || Y === e || j || Y === h || q || L || f || typeof Y == "object" && Y !== null && (Y.$$typeof === n || Y.$$typeof === c || Y.$$typeof === a || Y.$$typeof === D || Y.$$typeof === t || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
Y.$$typeof === O || Y.getModuleId !== void 0));
}
function aA(Y, W, gA) {
var wA = Y.displayName;
if (wA)
return wA;
var GA = W.displayName || W.name || "";
return GA !== "" ? gA + "(" + GA + ")" : gA;
}
function tA(Y) {
return Y.displayName || "Context";
}
function oA(Y) {
if (Y == null)
return null;
if (typeof Y.tag == "number" && U("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof Y == "function")
return Y.displayName || Y.name || null;
if (typeof Y == "string")
return Y;
switch (Y) {
case Q:
return "Fragment";
case g:
return "Portal";
case C:
return "Profiler";
case B:
return "StrictMode";
case w:
return "Suspense";
case e:
return "SuspenseList";
}
if (typeof Y == "object")
switch (Y.$$typeof) {
case D:
var W = Y;
return tA(W) + ".Consumer";
case a:
var gA = Y;
return tA(gA._context) + ".Provider";
case t:
return aA(Y, Y.render, "ForwardRef");
case c:
var wA = Y.displayName || null;
return wA !== null ? wA : oA(Y.type) || "Memo";
case n: {
var GA = Y, rA = GA._payload, JA = GA._init;
try {
return oA(JA(rA));
} catch {
return null;
}
}
}
return null;
}
var $ = Object.assign, IA = 0, P, CA, x, V, DA, iA, cA;
function lA() {
}
lA.__reactDisabledLog = !0;
function bA() {
{
if (IA === 0) {
P = console.log, CA = console.info, x = console.warn, V = console.error, DA = console.group, iA = console.groupCollapsed, cA = console.groupEnd;
var Y = {
configurable: !0,
enumerable: !0,
value: lA,
writable: !0
};
Object.defineProperties(console, {
info: Y,
log: Y,
warn: Y,
error: Y,
group: Y,
groupCollapsed: Y,
groupEnd: Y
});
}
IA++;
}
}
function YA() {
{
if (IA--, IA === 0) {
var Y = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: $({}, Y, {
value: P
}),
info: $({}, Y, {
value: CA
}),
warn: $({}, Y, {
value: x
}),
error: $({}, Y, {
value: V
}),
group: $({}, Y, {
value: DA
}),
groupCollapsed: $({}, Y, {
value: iA
}),
groupEnd: $({}, Y, {
value: cA
})
});
}
IA < 0 && U("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var MA = p.ReactCurrentDispatcher, eA;
function kA(Y, W, gA) {
{
if (eA === void 0)
try {
throw Error();
} catch (GA) {
var wA = GA.stack.trim().match(/\n( *(at )?)/);
eA = wA && wA[1] || "";
}
return `
` + eA + Y;
}
}
var AA = !1, QA;
{
var LA = typeof WeakMap == "function" ? WeakMap : Map;
QA = new LA();
}
function HA(Y, W) {
if (!Y || AA)
return "";
{
var gA = QA.get(Y);
if (gA !== void 0)
return gA;
}
var wA;
AA = !0;
var GA = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var rA;
rA = MA.current, MA.current = null, bA();
try {
if (W) {
var JA = function() {
throw Error();
};
if (Object.defineProperty(JA.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(JA, []);
} catch (WI) {
wA = WI;
}
Reflect.construct(Y, [], JA);
} else {
try {
JA.call();
} catch (WI) {
wA = WI;
}
Y.call(JA.prototype);
}
} else {
try {
throw Error();
} catch (WI) {
wA = WI;
}
Y();
}
} catch (WI) {
if (WI && wA && typeof WI.stack == "string") {
for (var hA = WI.stack.split(`
`), fA = wA.stack.split(`
`), WA = hA.length - 1, zA = fA.length - 1; WA >= 1 && zA >= 0 && hA[WA] !== fA[zA]; )
zA--;
for (; WA >= 1 && zA >= 0; WA--, zA--)
if (hA[WA] !== fA[zA]) {
if (WA !== 1 || zA !== 1)
do
if (WA--, zA--, zA < 0 || hA[WA] !== fA[zA]) {
var _g = `
` + hA[WA].replace(" at new ", " at ");
return Y.displayName && _g.includes("<anonymous>") && (_g = _g.replace("<anonymous>", Y.displayName)), typeof Y == "function" && QA.set(Y, _g), _g;
}
while (WA >= 1 && zA >= 0);
break;
}
}
} finally {
AA = !1, MA.current = rA, YA(), Error.prepareStackTrace = GA;
}
var yg = Y ? Y.displayName || Y.name : "", VD = yg ? kA(yg) : "";
return typeof Y == "function" && QA.set(Y, VD), VD;
}
function RA(Y, W, gA) {
return HA(Y, !1);
}
function uA(Y) {
var W = Y.prototype;
return !!(W && W.isReactComponent);
}
function jA(Y, W, gA) {
if (Y == null)
return "";
if (typeof Y == "function")
return HA(Y, uA(Y));
if (typeof Y == "string")
return kA(Y);
switch (Y) {
case w:
return kA("Suspense");
case e:
return kA("SuspenseList");
}
if (typeof Y == "object")
switch (Y.$$typeof) {
case t:
return RA(Y.render);
case c:
return jA(Y.type, W, gA);
case n: {
var wA = Y, GA = wA._payload, rA = wA._init;
try {
return jA(rA(GA), W, gA);
} catch {
}
}
}
return "";
}
var Bg = Object.prototype.hasOwnProperty, mA = {}, hg = p.ReactDebugCurrentFrame;
function eg(Y) {
if (Y) {
var W = Y._owner, gA = jA(Y.type, Y._source, W ? W.type : null);
hg.setExtraStackFrame(gA);
} else
hg.setExtraStackFrame(null);
}
function lg(Y, W, gA, wA, GA) {
{
var rA = Function.call.bind(Bg);
for (var JA in Y)
if (rA(Y, JA)) {
var hA = void 0;
try {
if (typeof Y[JA] != "function") {
var fA = Error((wA || "React class") + ": " + gA + " type `" + JA + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof Y[JA] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw fA.name = "Invariant Violation", fA;
}
hA = Y[JA](W, JA, wA, gA, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (WA) {
hA = WA;
}
hA && !(hA instanceof Error) && (eg(GA), U("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", wA || "React class", gA, JA, typeof hA), eg(null)), hA instanceof Error && !(hA.message in mA) && (mA[hA.message] = !0, eg(GA), U("Failed %s type: %s", gA, hA.message), eg(null));
}
}
}
var AI = Array.isArray;
function SA(Y) {
return AI(Y);
}
function tI(Y) {
{
var W = typeof Symbol == "function" && Symbol.toStringTag, gA = W && Y[Symbol.toStringTag] || Y.constructor.name || "Object";
return gA;
}
}
function WQ(Y) {
try {
return Lg(Y), !1;
} catch {
return !0;
}
}
function Lg(Y) {
return "" + Y;
}
function HB(Y) {
if (WQ(Y))
return U("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tI(Y)), Lg(Y);
}
var F = p.ReactCurrentOwner, G = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, k, S;
function l(Y) {
if (Bg.call(Y, "ref")) {
var W = Object.getOwnPropertyDescriptor(Y, "ref").get;
if (W && W.isReactWarning)
return !1;
}
return Y.ref !== void 0;
}
function m(Y) {
if (Bg.call(Y, "key")) {
var W = Object.getOwnPropertyDescriptor(Y, "key").get;
if (W && W.isReactWarning)
return !1;
}
return Y.key !== void 0;
}
function z(Y, W) {
typeof Y.ref == "string" && F.current;
}
function UA(Y, W) {
{
var gA = function() {
k || (k = !0, U("%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://reactjs.org/link/special-props)", W));
};
gA.isReactWarning = !0, Object.defineProperty(Y, "key", {
get: gA,
configurable: !0
});
}
}
function $A(Y, W) {
{
var gA = function() {
S || (S = !0, U("%s: `ref` 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://reactjs.org/link/special-props)", W));
};
gA.isReactWarning = !0, Object.defineProperty(Y, "ref", {
get: gA,
configurable: !0
});
}
}
var XA = function(Y, W, gA, wA, GA, rA, JA) {
var hA = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: A,
// Built-in properties that belong on the element
type: Y,
key: W,
ref: gA,
props: JA,
// Record the component responsible for creating this element.
_owner: rA
};
return hA._store = {}, Object.defineProperty(hA._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(hA, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: wA
}), Object.defineProperty(hA, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: GA
}), Object.freeze && (Object.freeze(hA.props), Object.freeze(hA)), hA;
};
function Ag(Y, W, gA, wA, GA) {
{
var rA, JA = {}, hA = null, fA = null;
gA !== void 0 && (HB(gA), hA = "" + gA), m(W) && (HB(W.key), hA = "" + W.key), l(W) && (fA = W.ref, z(W, GA));
for (rA in W)
Bg.call(W, rA) && !G.hasOwnProperty(rA) && (JA[rA] = W[rA]);
if (Y && Y.defaultProps) {
var WA = Y.defaultProps;
for (rA in WA)
JA[rA] === void 0 && (JA[rA] = WA[rA]);
}
if (hA || fA) {
var zA = typeof Y == "function" ? Y.displayName || Y.name || "Unknown" : Y;
hA && UA(JA, zA), fA && $A(JA, zA);
}
return XA(Y, hA, fA, GA, wA, F.current, JA);
}
}
var ZA = p.ReactCurrentOwner, aQ = p.ReactDebugCurrentFrame;
function jI(Y) {
if (Y) {
var W = Y._owner, gA = jA(Y.type, Y._source, W ? W.type : null);
aQ.setExtraStackFrame(gA);
} else
aQ.setExtraStackFrame(null);
}
var JI;
JI = !1;
function lB(Y) {
return typeof Y == "object" && Y !== null && Y.$$typeof === A;
}
function wQ() {
{
if (ZA.current) {
var Y = oA(ZA.current.type);
if (Y)
return `
Check the render method of \`` + Y + "`.";
}
return "";
}
}
function YE(Y) {
return "";
}
var RE = {};
function _E(Y) {
{
var W = wQ();
if (!W) {
var gA = typeof Y == "string" ? Y : Y.displayName || Y.name;
gA && (W = `
Check the top-level render call using <` + gA + ">.");
}
return W;
}
}
function SE(Y, W) {
{
if (!Y._store || Y._store.validated || Y.key != null)
return;
Y._store.validated = !0;
var gA = _E(W);
if (RE[gA])
return;
RE[gA] = !0;
var wA = "";
Y && Y._owner && Y._owner !== ZA.current && (wA = " It was passed a child from " + oA(Y._owner.type) + "."), jI(Y), U('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', gA, wA), jI(null);
}
}
function vQ(Y, W) {
{
if (typeof Y != "object")
return;
if (SA(Y))
for (var gA = 0; gA < Y.length; gA++) {
var wA = Y[gA];
lB(wA) && SE(wA, W);
}
else if (lB(Y))
Y._store && (Y._store.validated = !0);
else if (Y) {
var GA = _(Y);
if (typeof GA == "function" && GA !== Y.entries)
for (var rA = GA.call(Y), JA; !(JA = rA.next()).done; )
lB(JA.value) && SE(JA.value, W);
}
}
}
function pE(Y) {
{
var W = Y.type;
if (W == null || typeof W == "string")
return;
var gA;
if (typeof W == "function")
gA = W.propTypes;
else if (typeof W == "object" && (W.$$typeof === t || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
W.$$typeof === c))
gA = W.propTypes;
else
return;
if (gA) {
var wA = oA(W);
lg(gA, Y.props, "prop", wA, Y);
} else if (W.PropTypes !== void 0 && !JI) {
JI = !0;
var GA = oA(W);
U("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", GA || "Unknown");
}
typeof W.getDefaultProps == "function" && !W.getDefaultProps.isReactClassApproved && U("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Li(Y) {
{
for (var W = Object.keys(Y.props), gA = 0; gA < W.length; gA++) {
var wA = W[gA];
if (wA !== "children" && wA !== "key") {
jI(Y), U("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", wA), jI(null);
break;
}
}
Y.ref !== null && (jI(Y), U("Invalid attribute `ref` supplied to `React.Fragment`."), jI(null));
}
}
function UE(Y, W, gA, wA, GA, rA) {
{
var JA = BA(Y);
if (!JA) {
var hA = "";
(Y === void 0 || typeof Y == "object" && Y !== null && Object.keys(Y).length === 0) && (hA += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var fA = YE();
fA ? hA += fA : hA += wQ();
var WA;
Y === null ? WA = "null" : SA(Y) ? WA = "array" : Y !== void 0 && Y.$$typeof === A ? (WA = "<" + (oA(Y.type) || "Unknown") + " />", hA = " Did you accidentally export a JSX literal instead of a component?") : WA = typeof Y, U("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", WA, hA);
}
var zA = Ag(Y, W, gA, GA, rA);
if (zA == null)
return zA;
if (JA) {
var _g = W.children;
if (_g !== void 0)
if (wA)
if (SA(_g)) {
for (var yg = 0; yg < _g.length; yg++)
vQ(_g[yg], Y);
Object.freeze && Object.freeze(_g);
} else
U("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
vQ(_g, Y);
}
return Y === Q ? Li(zA) : pE(zA), zA;
}
}
function fi(Y, W, gA) {
return UE(Y, W, gA, !0);
}
function bi(Y, W, gA) {
return UE(Y, W, gA, !1);
}
var H = bi, EA = fi;
OQ.Fragment = Q, OQ.jsx = H, OQ.jsxs = EA;
}()), OQ;
}
process.env.NODE_ENV === "production" ? ao.exports = Yc() : ao.exports = Rc();
var y = ao.exports, qg = {}, ii = {};
ii.byteLength = pc;
ii.toByteArray = dc;
ii.fromByteArray = lc;
var UI = [], II = [], _c = typeof Uint8Array < "u" ? Uint8Array : Array, ui = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for (var tQ = 0, Sc = ui.length; tQ < Sc; ++tQ)
UI[tQ] = ui[tQ], II[ui.charCodeAt(tQ)] = tQ;
II[45] = 62;
II[95] = 63;
function Ps(i) {
var A = i.length;
if (A % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var g = i.indexOf("=");
g === -1 && (g = A);
var Q = g === A ? 0 : 4 - g % 4;
return [g, Q];
}
function pc(i) {
var A = Ps(i), g = A[0], Q = A[1];
return (g + Q) * 3 / 4 - Q;
}
function Uc(i, A, g) {
return (A + g) * 3 / 4 - g;
}
function dc(i) {
var A, g = Ps(i), Q = g[0], B = g[1], C = new _c(Uc(i, Q, B)), a = 0, D = B > 0 ? Q - 4 : Q, t;
for (t = 0; t < D; t += 4)
A = II[i.charCodeAt(t)] << 18 | II[i.charCodeAt(t + 1)] << 12 | II[i.charCodeAt(t + 2)] << 6 | II[i.charCodeAt(t + 3)], C[a++] = A >> 16 & 255, C[a++] = A >> 8 & 255, C[a++] = A & 255;
return B === 2 && (A = II[i.charCodeAt(t)] << 2 | II[i.charCodeAt(t + 1)] >> 4, C[a++] = A & 255), B === 1 && (A = II[i.charCodeAt(t)] << 10 | II[i.charCodeAt(t + 1)] << 4 | II[i.charCodeAt(t + 2)] >> 2, C[a++] = A >> 8 & 255, C[a++] = A & 255), C;
}
function qc(i) {
return UI[i >> 18 & 63] + UI[i >> 12 & 63] + UI[i >> 6 & 63] + UI[i & 63];
}
function Hc(i, A, g) {
for (var Q, B = [], C = A; C < g; C += 3)
Q = (i[C] << 16 & 16711680) + (i[C + 1] << 8 & 65280) + (i[C + 2] & 255), B.push(qc(Q));
return B.join("");
}
function lc(i) {
for (var A, g = i.length, Q = g % 3, B = [], C = 16383, a = 0, D = g - Q; a < D; a += C)
B.push(Hc(i, a, a + C > D ? D : a + C));
return Q === 1 ? (A = i[g - 1], B.push(
UI[A >> 2] + UI[A << 4 & 63] + "=="
)) : Q === 2 && (A = (i[g - 2] << 8) + i[g - 1], B.push(
UI[A >> 10] + UI[A >> 4 & 63] + UI[A << 2 & 63] + "="
)), B.join("");
}
var lo = {};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
lo.read = function(i, A, g, Q, B) {
var C, a, D = B * 8 - Q - 1, t = (1 << D) - 1, w = t >> 1, e = -7, c = g ? B - 1 : 0, n = g ? -1 : 1, h = i[A + c];
for (c += n, C = h & (1 << -e) - 1, h >>= -e, e += D; e > 0; C = C * 256 + i[A + c], c += n, e -= 8)
;
for (a = C & (1 << -e) - 1, C >>= -e, e += Q; e > 0; a = a * 256 + i[A + c], c += n, e -= 8)
;
if (C === 0)
C = 1 - w;
else {
if (C === t)
return a ? NaN : (h ? -1 : 1) * (1 / 0);
a = a + Math.pow(2, Q), C = C - w;
}
return (h ? -1 : 1) * a * Math.pow(2, C - Q);
};
lo.write = function(i, A, g, Q, B, C) {
var a, D, t, w = C * 8 - B - 1, e = (1 << w) - 1, c = e >> 1, n = B === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h = Q ? 0 : C - 1, M = Q ? 1 : -1, J = A < 0 || A === 0 && 1 / A < 0 ? 1 : 0;
for (A = Math.abs(A), isNaN(A) || A === 1 / 0 ? (D = isNaN(A) ? 1 : 0, a = e) : (a = Math.floor(Math.log(A) / Math.LN2), A * (t = Math.pow(2, -a)) < 1 && (a--, t *= 2), a + c >= 1 ? A += n / t : A += n * Math.pow(2, 1 - c), A * t >= 2 && (a++, t /= 2), a + c >= e ? (D = 0, a = e) : a + c >= 1 ? (D = (A * t - 1) * Math.pow(2, B), a = a + c) : (D = A * Math.pow(2, c - 1) * Math.pow(2, B), a = 0)); B >= 8; i[g + h] = D & 255, h += M, D /= 256, B -= 8)
;
for (a = a << B | D, w += B; w > 0; i[g + h] = a & 255, h += M, a /= 256, w -= 8)
;
i[g + h - M] |= J * 128;
};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
(function(i) {
const A = ii, g = lo, Q = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
i.Buffer = D, i.SlowBuffer = U, i.INSPECT_MAX_BYTES = 50;
const B = 2147483647;
i.kMaxLength = B, D.TYPED_ARRAY_SUPPORT = C(), !D.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 C() {
try {
const F = new Uint8Array(1), G = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(G, Uint8Array.prototype), Object.setPrototypeOf(F, G), F.foo() === 42;
} catch {
return !1;
}
}
Object.defineProperty(D.prototype, "parent", {
enumerable: !0,
get: function() {
if (D.isBuffer(this))
return this.buffer;
}
}), Object.defineProperty(D.prototype, "offset", {
enumerable: !0,
get: function() {
if (D.isBuffer(this))
return this.byteOffset;
}
});
function a(F) {
if (F > B)
throw new RangeError('The value "' + F + '" is invalid for option "size"');
const G = new Uint8Array(F);
return Object.setPrototypeOf(G, D.prototype), G;
}
function D(F, G, k) {
if (typeof F == "number") {
if (typeof G == "string")
throw new TypeError(
'The "string" argument must be of type string. Received type number'
);
return c(F);
}
return t(F, G, k);
}
D.poolSize = 8192;
function t(F, G, k) {
if (typeof F == "string")
return n(F, G);
if (ArrayBuffer.isView(F))
return M(F);
if (F == null)
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof F
);
if (SA(F, ArrayBuffer) || F && SA(F.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (SA(F, SharedArrayBuffer) || F && SA(F.buffer, SharedArrayBuffer)))
return J(F, G, k);
if (typeof F == "number")
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
);
const S = F.valueOf && F.valueOf();
if (S != null && S !== F)
return D.from(S, G, k);
const l = _(F);
if (l) return l;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof F[Symbol.toPrimitive] == "function")
return D.from(F[Symbol.toPrimitive]("string"), G, k);
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof F
);
}
D.from = function(F, G, k) {
return t(F, G, k);
}, Object.setPrototypeOf(D.prototype, Uint8Array.prototype), Object.setPrototypeOf(D, Uint8Array);
function w(F) {
if (typeof F != "number")
throw new TypeError('"size" argument must be of type number');
if (F < 0)
throw new RangeError('The value "' + F + '" is invalid for option "size"');
}
function e(F, G, k) {
return w(F), F <= 0 ? a(F) : G !== void 0 ? typeof k == "string" ? a(F).fill(G, k) : a(F).fill(G) : a(F);
}
D.alloc = function(F, G, k) {
return e(F, G, k);
};
function c(F) {
return w(F), a(F < 0 ? 0 : p(F) | 0);
}
D.allocUnsafe = function(F) {
return c(F);
}, D.allocUnsafeSlow = function(F) {
return c(F);
};
function n(F, G) {
if ((typeof G != "string" || G === "") && (G = "utf8"), !D.isEncoding(G))
throw new TypeError("Unknown encoding: " + G);
const k = d(F, G) | 0;
let S = a(k);
const l = S.write(F, G);
return l !== k && (S = S.slice(0, l)), S;
}
function h(F) {
const G = F.length < 0 ? 0 : p(F.length) | 0, k = a(G);
for (let S = 0; S < G; S += 1)
k[S] = F[S] & 255;
return k;
}
function M(F) {
if (SA(F, Uint8Array)) {
const G = new Uint8Array(F);
return J(G.buffer, G.byteOffset, G.byteLength);
}
return h(F);
}
function J(F, G, k) {
if (G < 0 || F.byteLength < G)
throw new RangeError('"offset" is outside of buffer bounds');
if (F.byteLength < G + (k || 0))
throw new RangeError('"length" is outside of buffer bounds');
let S;
return G === void 0 && k === void 0 ? S = new Uint8Array(F) : k === void 0 ? S = new Uint8Array(F, G) : S = new Uint8Array(F, G, k), Object.setPrototypeOf(S, D.prototype), S;
}
function _(F) {
if (D.isBuffer(F)) {
const G = p(F.length) | 0, k = a(G);
return k.length === 0 || F.copy(k, 0, 0, G), k;
}
if (F.length !== void 0)
return typeof F.length != "number" || tI(F.length) ? a(0) : h(F);
if (F.type === "Buffer" && Array.isArray(F.data))
return h(F.data);
}
function p(F) {
if (F >= B)
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + B.toString(16) + " bytes");
return F | 0;
}
function U(F) {
return +F != F && (F = 0), D.alloc(+F);
}
D.isBuffer = function(G) {
return G != null && G._isBuffer === !0 && G !== D.prototype;
}, D.compare = function(G, k) {
if (SA(G, Uint8Array) && (G = D.from(G, G.offset, G.byteLength)), SA(k, Uint8Array) && (k = D.from(k, k.offset, k.byteLength)), !D.isBuffer(G) || !D.isBuffer(k))
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
);
if (G === k) return 0;
let S = G.length, l = k.length;
for (let m = 0, z = Math.min(S, l); m < z; ++m)
if (G[m] !== k[m]) {
S = G[m], l = k[m];
break;
}
return S < l ? -1 : l < S ? 1 : 0;
}, D.isEncoding = function(G) {
switch (String(G).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1;
}
}, D.concat = function(G, k) {
if (!Array.isArray(G))
throw new TypeError('"list" argument must be an Array of Buffers');
if (G.length === 0)
return D.alloc(0);
let S;
if (k === void 0)
for (k = 0, S = 0; S < G.length; ++S)
k += G[S].length;
const l = D.allocUnsafe(k);
let m = 0;
for (S = 0; S < G.length; ++S) {
let z = G[S];
if (SA(z, Uint8Array))
m + z.length > l.length ? (D.isBuffer(z) || (z = D.from(z)), z.copy(l, m)) : Uint8Array.prototype.set.call(
l,
z,
m
);
else if (D.isBuffer(z))
z.copy(l, m);
else
throw new TypeError('"list" argument must be an Array of Buffers');
m += z.length;
}
return l;
};
function d(F, G) {
if (D.isBuffer(F))
return F.length;
if (ArrayBuffer.isView(F) || SA(F, ArrayBuffer))
return F.byteLength;
if (typeof F != "string")
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof F
);
const k = F.length, S = arguments.length > 2 && arguments[2] === !0;
if (!S && k === 0) return 0;
let l = !1;
for (; ; )
switch (G) {
case "ascii":
case "latin1":
case "binary":
return k;
case "utf8":
case "utf-8":
return mA(F).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return k * 2;
case "hex":
return k >>> 1;
case "base64":
return lg(F).length;
default:
if (l)
return S ? -1 : mA(F).length;
G = ("" + G).toLowerCase(), l = !0;
}
}
D.byteLength = d;
function q(F, G, k) {
let S = !1;
if ((G === void 0 || G < 0) && (G = 0), G > this.length || ((k === void 0 || k > this.length) && (k = this.length), k <= 0) || (k >>>= 0, G >>>= 0, k <= G))
return "";
for (F || (F = "utf8"); ; )
switch (F) {
case "hex":
return V(this, G, k);
case "utf8":
case "utf-8":
return $(this, G, k);
case "ascii":
return CA(this, G, k);
case "latin1":
case "binary":
return x(this, G, k);
case "base64":
return oA(this, G, k);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return DA(this, G, k);
default:
if (S) throw new TypeError("Unknown encoding: " + F);
F = (F + "").toLowerCase(), S = !0;
}
}
D.prototype._isBuffer = !0;
function L(F, G, k) {
const S = F[G];
F[G] = F[k], F[k] = S;
}
D.prototype.swap16 = function() {
const G = this.length;
if (G % 2 !== 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let k = 0; k < G; k += 2)
L(this, k, k + 1);
return this;
}, D.prototype.swap32 = function() {
const G = this.length;
if (G % 4 !== 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let k = 0; k < G; k += 4)
L(this, k, k + 3), L(this, k + 1, k + 2);
return this;
}, D.prototype.swap64 = function() {
const G = this.length;
if (G % 8 !== 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let k = 0; k < G; k += 8)
L(this, k, k + 7), L(this, k + 1, k + 6), L(this, k + 2, k + 5), L(this, k + 3, k + 4);
return this;
}, D.prototype.toString = function() {
const G = this.length;
return G === 0 ? "" : arguments.length === 0 ? $(this, 0, G) : q.apply(this, arguments);
}, D.prototype.toLocaleString = D.prototype.toString, D.prototype.equals = function(G) {
if (!D.isBuffer(G)) throw new TypeError("Argument must be a Buffer");
return this === G ? !0 : D.compare(this, G) === 0;
}, D.prototype.inspect = function() {
let G = "";
const k = i.INSPECT_MAX_BYTES;
return G = this.toString("hex", 0, k).replace(/(.{2})/g, "$1 ").trim(), this.length > k && (G += " ... "), "<Buffer " + G + ">";
}, Q && (D.prototype[Q] = D.prototype.inspect), D.prototype.compare = function(G, k, S, l, m) {
if (SA(G, Uint8Array) && (G = D.from(G, G.offset, G.byteLength)), !D.isBuffer(G))
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof G
);
if (k === void 0 && (k = 0), S === void 0 && (S = G ? G.length : 0), l === void 0 && (l = 0), m === void 0 && (m = this.length), k < 0 || S > G.length || l < 0 || m > this.length)
throw new RangeError("out of range index");
if (l >= m && k >= S)
return 0;
if (l >= m)
return -1;
if (k >= S)
return 1;
if (k >>>= 0, S >>>= 0, l >>>= 0, m >>>= 0, this === G) return 0;
let z = m - l, UA = S - k;
const $A = Math.min(z, UA), XA = this.slice(l, m), Ag = G.slice(k, S);
for (let ZA = 0; ZA < $A; ++ZA)
if (XA[ZA] !== Ag[ZA]) {
z = XA[ZA], UA = Ag[ZA];
break;
}
return z < UA ? -1 : UA < z ? 1 : 0;
};
function f(F, G, k, S, l) {
if (F.length === 0) return -1;
if (typeof k == "string" ? (S = k, k = 0) : k > 2147483647 ? k = 2147483647 : k < -2147483648 && (k = -2147483648), k = +k, tI(k) && (k = l ? 0 : F.length - 1), k < 0 && (k = F.length + k), k >= F.length) {
if (l) return -1;
k = F.length - 1;
} else if (k < 0)
if (l) k = 0;
else return -1;
if (typeof G == "string" && (G = D.from(G, S)), D.isBuffer(G))
return G.length === 0 ? -1 : j(F, G, k, S, l);
if (typeof G == "number")
return G = G & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(F, G, k) : Uint8Array.prototype.lastIndexOf.call(F, G, k) : j(F, [G], k, S, l);
throw new TypeError("val must be string, number or Buffer");
}
function j(F, G, k, S, l) {
let m = 1, z = F.length, UA = G.length;
if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) {
if (F.length < 2 || G.length < 2)
return -1;
m = 2, z /= 2, UA /= 2, k /= 2;
}
function $A(Ag, ZA) {
return m === 1 ? Ag[ZA] : Ag.readUInt16BE(ZA * m);
}
let XA;
if (l) {
let Ag = -1;
for (XA = k; XA < z; XA++)
if ($A(F, XA) === $A(G, Ag === -1 ? 0 : XA - Ag)) {
if (Ag === -1 && (Ag = XA), XA - Ag + 1 === UA) return Ag * m;
} else
Ag !== -1 && (XA -= XA - Ag), Ag = -1;
} else
for (k + UA > z && (k = z - UA), XA = k; XA >= 0; XA--) {
let Ag = !0;
for (let ZA = 0; ZA < UA; ZA++)
if ($A(F, XA + ZA) !== $A(G, ZA)) {
Ag = !1;
break;
}
if (Ag) return XA;
}
return -1;
}
D.prototype.includes = function(G, k, S) {
return this.indexOf(G, k, S) !== -1;
}, D.prototype.indexOf = function(G, k, S) {
return f(this, G, k, S, !0);
}, D.prototype.lastIndexOf = function(G, k, S) {
return f(this, G, k, S, !1);
};
function Z(F, G, k, S) {
k = Number(k) || 0;
const l = F.length - k;
S ? (S = Number(S), S > l && (S = l)) : S = l;
const m = G.length;
S > m / 2 && (S = m / 2);
let z;
for (z = 0; z < S; ++z) {
const UA = parseInt(G.substr(z * 2, 2), 16);
if (tI(UA)) return z;
F[k + z] = UA;
}
return z;
}
function O(F, G, k, S) {
return AI(mA(G, F.length - k), F, k, S);
}
function BA(F, G, k, S) {
return AI(hg(G), F, k, S);
}
function aA(F, G, k, S) {
return AI(lg(G), F, k, S);
}
function tA(F, G, k, S) {
return AI(eg(G, F.length - k), F, k, S);
}
D.prototype.write = function(G, k, S, l) {
if (k === void 0)
l = "utf8", S = this.length, k = 0;
else if (S === void 0 && typeof k == "string")
l = k, S = this.length, k = 0;
else if (isFinite(k))
k = k >>> 0, isFinite(S) ? (S = S >>> 0, l === void 0 && (l = "utf8")) : (l = S, S = void 0);
else
throw new Error(
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
);
const m = this.length - k;
if ((S === void 0 || S > m) && (S = m), G.length > 0 && (S < 0 || k < 0) || k > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
l || (l = "utf8");
let z = !1;
for (; ; )
switch (l) {
case "hex":
return Z(this, G, k, S);
case "utf8":
case "utf-8":
return O(this, G, k, S);
case "ascii":
case "latin1":
case "binary":
return BA(this, G, k, S);
case "base64":
return aA(this, G, k, S);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return tA(this, G, k, S);
default:
if (z) throw new TypeError("Unknown encoding: " + l);
l = ("" + l).toLowerCase(), z = !0;
}
}, D.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
function oA(F, G, k) {
return G === 0 && k === F.length ? A.fromByteArray(F) : A.fromByteArray(F.slice(G, k));
}
function $(F, G, k) {
k = Math.min(F.length, k);
const S = [];
let l = G;
for (; l < k; ) {
const m = F[l];
let z = null, UA = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
if (l + UA <= k) {
let $A, XA, Ag, ZA;
switch (UA) {
case 1:
m < 128 && (z = m);
break;
case 2:
$A = F[l + 1], ($A & 192) === 128 && (ZA = (m & 31) << 6 | $A & 63, ZA > 127 && (z = ZA));
break;
case 3:
$A = F[l + 1], XA = F[l + 2], ($A & 192) === 128 && (XA & 192) === 128 && (ZA = (m & 15) << 12 | ($A & 63) << 6 | XA & 63, ZA > 2047 && (ZA < 55296 || ZA > 57343) && (z = ZA));
break;
case 4:
$A = F[l + 1], XA = F[l + 2], Ag = F[l + 3], ($A & 192) === 128 && (XA & 192) === 128 && (Ag & 192) === 128 && (ZA = (m & 15) << 18 | ($A & 63) << 12 | (XA & 63) << 6 | Ag & 63, ZA > 65535 && ZA < 1114112 && (z = ZA));
}
}
z === null ? (z = 65533, UA = 1) : z > 65535 && (z -= 65536, S.push(z >>> 10 & 1023 | 55296), z = 56320 | z & 1023), S.push(z), l += UA;
}
return P(S);
}
const IA = 4096;
function P(F) {
const G = F.length;
if (G <= IA)
return String.fromCharCode.apply(String, F);
let k = "", S = 0;
for (; S < G; )
k += String.fromCharCode.apply(
String,
F.slice(S, S += IA)
);
return k;
}
function CA(F, G, k) {
let S = "";
k = Math.min(F.length, k);
for (let l = G; l < k; ++l)
S += String.fromCharCode(F[l] & 127);
return S;
}
function x(F, G, k) {
let S = "";
k = Math.min(F.length, k);
for (let l = G; l < k; ++l)
S += String.fromCharCode(F[l]);
return S;
}
function V(F, G, k) {
const S = F.length;
(!G || G < 0) && (G = 0), (!k || k < 0 || k > S) && (k = S);
let l = "";
for (let m = G; m < k; ++m)
l += WQ[F[m]];
return l;
}
function DA(F, G, k) {
const S = F.slice(G, k);
let l = "";
for (let m = 0; m < S.length - 1; m += 2)
l += String.fromCharCode(S[m] + S[m + 1] * 256);
return l;
}
D.prototype.slice = function(G, k) {
const S = this.length;
G = ~~G, k = k === void 0 ? S : ~~k, G < 0 ? (G += S, G < 0 && (G = 0)) : G > S && (G = S), k < 0 ? (k += S, k < 0 && (k = 0)) : k > S && (k = S), k < G && (k = G);
const l = this.subarray(G, k);
return Object.setPrototypeOf(l, D.prototype), l;
};
function iA(F, G, k) {
if (F % 1 !== 0 || F < 0) throw new RangeError("offset is not uint");
if (F + G > k) throw new RangeError("Trying to access beyond buffer length");
}
D.prototype.readUintLE = D.prototype.readUIntLE = function(G, k, S) {
G = G >>> 0, k = k >>> 0, S || iA(G, k, this.length);
let l = this[G], m = 1, z = 0;
for (; ++z < k && (m *= 256); )
l += this[G + z] * m;
return l;
}, D.prototype.readUintBE = D.prototype.readUIntBE = function(G, k, S) {
G = G >>> 0, k = k >>> 0, S || iA(G, k, this.length);
let l = this[G + --k], m = 1;
for (; k > 0 && (m *= 256); )
l += this[G + --k] * m;
return l;
}, D.prototype.readUint8 = D.prototype.readUInt8 = function(G, k) {
return G = G >>> 0, k || iA(G, 1, this.length), this[G];
}, D.prototype.readUint16LE = D.prototype.readUInt16LE = function(G, k) {
return G = G >>> 0, k || iA(G, 2, this.length), this[G] | this[G + 1] << 8;
}, D.prototype.readUint16BE = D.prototype.readUInt16BE = function(G, k) {
return G = G >>> 0, k || iA(G, 2, this.length), this[G] << 8 | this[G + 1];
}, D.prototype.readUint32LE = D.prototype.readUInt32LE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), (this[G] | this[G + 1] << 8 | this[G + 2] << 16) + this[G + 3] * 16777216;
}, D.prototype.readUint32BE = D.prototype.readUInt32BE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), this[G] * 16777216 + (this[G + 1] << 16 | this[G + 2] << 8 | this[G + 3]);
}, D.prototype.readBigUInt64LE = Lg(function(G) {
G = G >>> 0, RA(G, "offset");
const k = this[G], S = this[G + 7];
(k === void 0 || S === void 0) && uA(G, this.length - 8);
const l = k + this[++G] * 2 ** 8 + this[++G] * 2 ** 16 + this[++G] * 2 ** 24, m = this[++G] + this[++G] * 2 ** 8 + this[++G] * 2 ** 16 + S * 2 ** 24;
return BigInt(l) + (BigInt(m) << BigInt(32));
}), D.prototype.readBigUInt64BE = Lg(function(G) {
G = G >>> 0, RA(G, "offset");
const k = this[G], S = this[G + 7];
(k === void 0 || S === void 0) && uA(G, this.length - 8);
const l = k * 2 ** 24 + this[++G] * 2 ** 16 + this[++G] * 2 ** 8 + this[++G], m = this[++G] * 2 ** 24 + this[++G] * 2 ** 16 + this[++G] * 2 ** 8 + S;
return (BigInt(l) << BigInt(32)) + BigInt(m);
}), D.prototype.readIntLE = function(G, k, S) {
G = G >>> 0, k = k >>> 0, S || iA(G, k, this.length);
let l = this[G], m = 1, z = 0;
for (; ++z < k && (m *= 256); )
l += this[G + z] * m;
return m *= 128, l >= m && (l -= Math.pow(2, 8 * k)), l;
}, D.prototype.readIntBE = function(G, k, S) {
G = G >>> 0, k = k >>> 0, S || iA(G, k, this.length);
let l = k, m = 1, z = this[G + --l];
for (; l > 0 && (m *= 256); )
z += this[G + --l] * m;
return m *= 128, z >= m && (z -= Math.pow(2, 8 * k)), z;
}, D.prototype.readInt8 = function(G, k) {
return G = G >>> 0, k || iA(G, 1, this.length), this[G] & 128 ? (255 - this[G] + 1) * -1 : this[G];
}, D.prototype.readInt16LE = function(G, k) {
G = G >>> 0, k || iA(G, 2, this.length);
const S = this[G] | this[G + 1] << 8;
return S & 32768 ? S | 4294901760 : S;
}, D.prototype.readInt16BE = function(G, k) {
G = G >>> 0, k || iA(G, 2, this.length);
const S = this[G + 1] | this[G] << 8;
return S & 32768 ? S | 4294901760 : S;
}, D.prototype.readInt32LE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), this[G] | this[G + 1] << 8 | this[G + 2] << 16 | this[G + 3] << 24;
}, D.prototype.readInt32BE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), this[G] << 24 | this[G + 1] << 16 | this[G + 2] << 8 | this[G + 3];
}, D.prototype.readBigInt64LE = Lg(function(G) {
G = G >>> 0, RA(G, "offset");
const k = this[G], S = this[G + 7];
(k === void 0 || S === void 0) && uA(G, this.length - 8);
const l = this[G + 4] + this[G + 5] * 2 ** 8 + this[G + 6] * 2 ** 16 + (S << 24);
return (BigInt(l) << BigInt(32)) + BigInt(k + this[++G] * 2 ** 8 + this[++G] * 2 ** 16 + this[++G] * 2 ** 24);
}), D.prototype.readBigInt64BE = Lg(function(G) {
G = G >>> 0, RA(G, "offset");
const k = this[G], S = this[G + 7];
(k === void 0 || S === void 0) && uA(G, this.length - 8);
const l = (k << 24) + // Overflow
this[++G] * 2 ** 16 + this[++G] * 2 ** 8 + this[++G];
return (BigInt(l) << BigInt(32)) + BigInt(this[++G] * 2 ** 24 + this[++G] * 2 ** 16 + this[++G] * 2 ** 8 + S);
}), D.prototype.readFloatLE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), g.read(this, G, !0, 23, 4);
}, D.prototype.readFloatBE = function(G, k) {
return G = G >>> 0, k || iA(G, 4, this.length), g.read(this, G, !1, 23, 4);
}, D.prototype.readDoubleLE = function(G, k) {
return G = G >>> 0, k || iA(G, 8, this.length), g.read(this, G, !0, 52, 8);
}, D.prototype.readDoubleBE = function(G, k) {
return G = G >>> 0, k || iA(G, 8, this.length), g.read(this, G, !1, 52, 8);
};
function cA(F, G, k, S, l, m) {
if (!D.isBuffer(F)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (G > l || G < m) throw new RangeError('"value" argument is out of bounds');
if (k + S > F.length) throw new RangeError("Index out of range");
}
D.prototype.writeUintLE = D.prototype.writeUIntLE = function(G, k, S, l) {
if (G = +G, k = k >>> 0, S = S >>> 0, !l) {
const UA = Math.pow(2, 8 * S) - 1;
cA(this, G, k, S, UA, 0);
}
let m = 1, z = 0;
for (this[k] = G & 255; ++z < S && (m *= 256); )
this[k + z] = G / m & 255;
return k + S;
}, D.prototype.writeUintBE = D.prototype.writeUIntBE = function(G, k, S, l) {
if (G = +G, k = k >>> 0, S = S >>> 0, !l) {
const UA = Math.pow(2, 8 * S) - 1;
cA(this, G, k, S, UA, 0);
}
let m = S - 1, z = 1;
for (this[k + m] = G & 255; --m >= 0 && (z *= 256); )
this[k + m] = G / z & 255;
return k + S;
}, D.prototype.writeUint8 = D.prototype.writeUInt8 = function(G, k, S) {
return G = +G, k = k >>> 0, S || cA(this, G, k, 1, 255, 0), this[k] = G & 255, k + 1;
}, D.prototype.writeUint16LE = D.prototype.writeUInt16LE = function(G, k, S) {
return G = +G, k = k >>> 0, S || cA(this, G, k, 2, 65535, 0), this[k] = G & 255, this[k + 1] = G >>> 8, k + 2;
}, D.prototype.writeUint16BE = D.prototype.writeUInt16BE = function(G, k, S) {
return G = +G, k = k >>> 0, S || cA(this, G, k, 2, 65535, 0), this[k] = G >>> 8, this[k + 1] = G & 255, k + 2;
}, D.prototype.writeUint32LE = D.prototype.writeUInt32LE = function(G, k, S) {
return G = +G, k = k >>> 0, S || cA(this, G, k, 4, 4294967295, 0), this[k + 3] = G >>> 24, this[k + 2] = G >>> 16, this[k + 1] = G >>> 8, this[k] = G & 255, k + 4;
}, D.prototype.writeUint32BE = D.prototype.writeUInt32BE = function(G, k, S) {
return G = +G, k = k >>> 0, S || cA(this, G, k, 4, 4294967295, 0), this[k] = G >>> 24, this[k + 1] = G >>> 16, this[k + 2] = G >>> 8, this[k + 3] = G & 255, k + 4;
};
function lA(F, G, k, S, l) {
HA(G, S, l, F, k, 7);
let m = Number(G & BigInt(4294967295));
F[k++] = m, m = m >> 8, F[k++] = m, m = m >> 8, F[k++] = m, m = m >> 8, F[k++] = m;
let z = Number(G >> BigInt(32) & BigInt(4294967295));
return F[k++] = z, z = z >> 8, F[k++] = z, z = z >> 8, F[k++] = z, z = z >> 8, F[k++] = z, k;
}
function bA(F, G, k, S, l) {
HA(G, S, l, F, k, 7);
let m = Number(G & BigInt(4294967295));
F[k + 7] = m, m =