const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/index-CvUp9klu.js","chunks/___vite-browser-external_commonjs-proxy-DIugEvg0.js","chunks/index-BkMDDkpV.js","chunks/cardano-e2kMgYtl.js","chunks/request-fingerprint-BANtRL63.js","chunks/midnight-tx-recovery-hUiL_-xC.js","chunks/Logo1am-CaBWyNpM.js","chunks/_virtual_wxt-plugins-CDnz5Vh6.js","chunks/__vite-plugin-wasm-helper-D7K_KhUE.js","chunks/index-Dudsifbi.js","chunks/cardano-dust-Dtj1ts72.js","chunks/cardano_message_signing-CcrxYRax.js","chunks/DebugPanel-BYMERHCM.js"])))=>i.map(i=>d[i]);
import { d as Rte, e as Nte, u as vw, b as Pa, f as zt, _ as sr, g as Nm, W as Vte, l as Dte, D as Bte, h as FO, E as ir, s as n5, j as Fte, k as Lte, m as r5, t as iU, n as zte, o as fg, p as LO, A as Ute, q as vT, v as Hte, w as oU, a as jte } from "./request-fingerprint-BANtRL63.js";
import { a as It, k as lt, f as pt, j as Ct, $ as qte, w as ST, x as zO, b as pe, m as qe, g as rt, c as I, D as Wte, p as Ze, l as ds, u as fs, h as ii, n as Ji, e as de, o as ga, i as F, L as Vm, t as Q, y as Kte, v as Ot, P as kT, d as Pi, z as Kx, q as Vt, A as Vf, F as _r, M as td, S as TT, B as r2, C as H7, s as aU, E as $te, G as cU, H as Xte } from "./Logo1am-CaBWyNpM.js";
import { _ as lU } from "./__vite-plugin-wasm-helper-D7K_KhUE.js";
import { b as UO, _ as Gte, a as uU, c as Zte, d as Jte, r as dU, h as Yte, e as vf, f as fU, g as pU, n as Qte, F as hU, i as s2, j as If, k as Hi, l as s5, m as ene, o as m_, p as tne, q as nne, s as HO, t as rne, u as jO, x as qO, y as sne, z as Sw, A as ine, B as one, C as ane, D as cne, E as Vo, G as lne, H as une, I as WO, J as dne, K as KO, L as $O, M as fne, N as XO, O as pne, P as gU, Q as hne, R as gne, S as bne, T as mne, U as yne, V as wne, W as _ne, X as xne, Y as vne, Z as Sne, $ as CT, a0 as ET, a1 as pg, a2 as kne, w as IT, v as bU, a3 as j7, a4 as Tne, __tla as __tla_0 } from "./cardano-e2kMgYtl.js";
let PUe, gxt, $r, Fit, ose, JU, qQ, gM, QQ, yot, _ot, m2t, zi, b2t, wot, sst, yn, mU, du, oT, og, yU, ht, Sot, EQ, g9, sb, bu, WQ, X2t, dLe, lr, _n, dg, dxt, z2t, K2t, J2t, W2t, N2t, fxt, ryt, Ly, zl, hd, zy, Op, q2t, V2t, M2t, cxt, rxt, $pt, v2t, oxt, nxt, k2t, pxt, S2t, H2t, Xpt, A2t, B2t, uxt, T2t, U2t, P2t, E2t, Z2t, I2t, j2t, D2t, $2t, F2t, axt, ixt, sxt, txt, Q2t, ext, Y2t, lxt, lw, G2t, hu, Qf, ug, Hd, rs, hxt, Ate, Ap, Pp, KQ, uRe, R2t, L2t, O2t, C2t, Lwt, To, sp, Hy, l6, PH, u_t, Xwt, Mp, Xg, Fa, cC, wn, Bn, gr, kwe, Ma, mt, wr, ln, yf, Zb, st, pr, Fr, _c, ym, Ad, vwe, qc, xwe, _we, lRe, ev, F_e, Ft, mg, Pr, vg, ad, xg, tj, lv, P0, ip, O0, Xt, B_e, k2, j, ze, Fe, dn, Xi, wt, Zt, B$, nt, Gg, eh, St, yo, Swe, Gy, jt, V, XM, Zwt, Gwt, tn, Io, ud, Ywt, T_e, Y2, l_t, L_e, N_e, s_t, Jwt, Kwt, R_e, Ydt, bte, Gdt, w2t, Zdt, qdt, x2t, _2t, y2t, Jdt, mte, A1, N_t, Os, Or, $f, OG, ARe, en, D_t, ri, k_t, C_t, A3, V_t, Wl, F_t, or, Cn, wl, f_t, d_t, p_t, yv, Pd, py, c_t, Ae, yr, OP, $s, gu, $n, v9, _9, hg, qt, x9, xn, Vy, xi, Dit, Ny, zQ, Zd, sH, jQ, g2t, fc, sT;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    mU = function(t) {
        return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
    };
    Lwt = function(t) {
        if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
        var e = t.default;
        if (typeof e == "function") {
            var n = function r() {
                return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
            };
            n.prototype = e.prototype;
        } else n = {};
        return Object.defineProperty(n, "__esModule", {
            value: !0
        }), Object.keys(t).forEach(function(r) {
            var s = Object.getOwnPropertyDescriptor(t, r);
            Object.defineProperty(n, r, s.get ? s : {
                enumerable: !0,
                get: function() {
                    return t[r];
                }
            });
        }), n;
    };
    var i5 = {}, bb = {}, GO;
    function Cne() {
        if (GO) return bb;
        GO = 1, bb.byteLength = a, bb.toByteArray = l, bb.fromByteArray = f;
        for(var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, i = r.length; s < i; ++s)t[s] = r[s], e[r.charCodeAt(s)] = s;
        e[45] = 62, e[95] = 63;
        function o(p) {
            var h = p.length;
            if (h % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
            var m = p.indexOf("=");
            m === -1 && (m = h);
            var w = m === h ? 0 : 4 - m % 4;
            return [
                m,
                w
            ];
        }
        function a(p) {
            var h = o(p), m = h[0], w = h[1];
            return (m + w) * 3 / 4 - w;
        }
        function c(p, h, m) {
            return (h + m) * 3 / 4 - m;
        }
        function l(p) {
            var h, m = o(p), w = m[0], v = m[1], k = new n(c(p, w, v)), _ = 0, A = v > 0 ? w - 4 : w, P;
            for(P = 0; P < A; P += 4)h = e[p.charCodeAt(P)] << 18 | e[p.charCodeAt(P + 1)] << 12 | e[p.charCodeAt(P + 2)] << 6 | e[p.charCodeAt(P + 3)], k[_++] = h >> 16 & 255, k[_++] = h >> 8 & 255, k[_++] = h & 255;
            return v === 2 && (h = e[p.charCodeAt(P)] << 2 | e[p.charCodeAt(P + 1)] >> 4, k[_++] = h & 255), v === 1 && (h = e[p.charCodeAt(P)] << 10 | e[p.charCodeAt(P + 1)] << 4 | e[p.charCodeAt(P + 2)] >> 2, k[_++] = h >> 8 & 255, k[_++] = h & 255), k;
        }
        function u(p) {
            return t[p >> 18 & 63] + t[p >> 12 & 63] + t[p >> 6 & 63] + t[p & 63];
        }
        function d(p, h, m) {
            for(var w, v = [], k = h; k < m; k += 3)w = (p[k] << 16 & 16711680) + (p[k + 1] << 8 & 65280) + (p[k + 2] & 255), v.push(u(w));
            return v.join("");
        }
        function f(p) {
            for(var h, m = p.length, w = m % 3, v = [], k = 16383, _ = 0, A = m - w; _ < A; _ += k)v.push(d(p, _, _ + k > A ? A : _ + k));
            return w === 1 ? (h = p[m - 1], v.push(t[h >> 2] + t[h << 4 & 63] + "==")) : w === 2 && (h = (p[m - 2] << 8) + p[m - 1], v.push(t[h >> 10] + t[h >> 4 & 63] + t[h << 2 & 63] + "=")), v.join("");
        }
        return bb;
    }
    var kw = {};
    var ZO;
    function Ene() {
        return ZO || (ZO = 1, kw.read = function(t, e, n, r, s) {
            var i, o, a = s * 8 - r - 1, c = (1 << a) - 1, l = c >> 1, u = -7, d = n ? s - 1 : 0, f = n ? -1 : 1, p = t[e + d];
            for(d += f, i = p & (1 << -u) - 1, p >>= -u, u += a; u > 0; i = i * 256 + t[e + d], d += f, u -= 8);
            for(o = i & (1 << -u) - 1, i >>= -u, u += r; u > 0; o = o * 256 + t[e + d], d += f, u -= 8);
            if (i === 0) i = 1 - l;
            else {
                if (i === c) return o ? NaN : (p ? -1 : 1) * (1 / 0);
                o = o + Math.pow(2, r), i = i - l;
            }
            return (p ? -1 : 1) * o * Math.pow(2, i - r);
        }, kw.write = function(t, e, n, r, s, i) {
            var o, a, c, l = i * 8 - s - 1, u = (1 << l) - 1, d = u >> 1, f = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = r ? 0 : i - 1, h = r ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
            for(e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, o = u) : (o = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -o)) < 1 && (o--, c *= 2), o + d >= 1 ? e += f / c : e += f * Math.pow(2, 1 - d), e * c >= 2 && (o++, c /= 2), o + d >= u ? (a = 0, o = u) : o + d >= 1 ? (a = (e * c - 1) * Math.pow(2, s), o = o + d) : (a = e * Math.pow(2, d - 1) * Math.pow(2, s), o = 0)); s >= 8; t[n + p] = a & 255, p += h, a /= 256, s -= 8);
            for(o = o << s | a, l += s; l > 0; t[n + p] = o & 255, p += h, o /= 256, l -= 8);
            t[n + p - h] |= m * 128;
        }), kw;
    }
    var JO;
    yU = function() {
        return JO || (JO = 1, (function(t) {
            const e = Cne(), n = Ene(), r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
            t.Buffer = a, t.SlowBuffer = k, t.INSPECT_MAX_BYTES = 50;
            const s = 2147483647;
            t.kMaxLength = s, a.TYPED_ARRAY_SUPPORT = i(), !a.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 i() {
                try {
                    const D = new Uint8Array(1), S = {
                        foo: function() {
                            return 42;
                        }
                    };
                    return Object.setPrototypeOf(S, Uint8Array.prototype), Object.setPrototypeOf(D, S), D.foo() === 42;
                } catch  {
                    return !1;
                }
            }
            Object.defineProperty(a.prototype, "parent", {
                enumerable: !0,
                get: function() {
                    if (a.isBuffer(this)) return this.buffer;
                }
            }), Object.defineProperty(a.prototype, "offset", {
                enumerable: !0,
                get: function() {
                    if (a.isBuffer(this)) return this.byteOffset;
                }
            });
            function o(D) {
                if (D > s) throw new RangeError('The value "' + D + '" is invalid for option "size"');
                const S = new Uint8Array(D);
                return Object.setPrototypeOf(S, a.prototype), S;
            }
            function a(D, S, E) {
                if (typeof D == "number") {
                    if (typeof S == "string") throw new TypeError('The "string" argument must be of type string. Received type number');
                    return d(D);
                }
                return c(D, S, E);
            }
            a.poolSize = 8192;
            function c(D, S, E) {
                if (typeof D == "string") return f(D, S);
                if (ArrayBuffer.isView(D)) return h(D);
                if (D == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof D);
                if (De(D, ArrayBuffer) || D && De(D.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (De(D, SharedArrayBuffer) || D && De(D.buffer, SharedArrayBuffer))) return m(D, S, E);
                if (typeof D == "number") throw new TypeError('The "value" argument must not be of type number. Received type number');
                const $ = D.valueOf && D.valueOf();
                if ($ != null && $ !== D) return a.from($, S, E);
                const re = w(D);
                if (re) return re;
                if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof D[Symbol.toPrimitive] == "function") return a.from(D[Symbol.toPrimitive]("string"), S, E);
                throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof D);
            }
            a.from = function(D, S, E) {
                return c(D, S, E);
            }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
            function l(D) {
                if (typeof D != "number") throw new TypeError('"size" argument must be of type number');
                if (D < 0) throw new RangeError('The value "' + D + '" is invalid for option "size"');
            }
            function u(D, S, E) {
                return l(D), D <= 0 ? o(D) : S !== void 0 ? typeof E == "string" ? o(D).fill(S, E) : o(D).fill(S) : o(D);
            }
            a.alloc = function(D, S, E) {
                return u(D, S, E);
            };
            function d(D) {
                return l(D), o(D < 0 ? 0 : v(D) | 0);
            }
            a.allocUnsafe = function(D) {
                return d(D);
            }, a.allocUnsafeSlow = function(D) {
                return d(D);
            };
            function f(D, S) {
                if ((typeof S != "string" || S === "") && (S = "utf8"), !a.isEncoding(S)) throw new TypeError("Unknown encoding: " + S);
                const E = _(D, S) | 0;
                let $ = o(E);
                const re = $.write(D, S);
                return re !== E && ($ = $.slice(0, re)), $;
            }
            function p(D) {
                const S = D.length < 0 ? 0 : v(D.length) | 0, E = o(S);
                for(let $ = 0; $ < S; $ += 1)E[$] = D[$] & 255;
                return E;
            }
            function h(D) {
                if (De(D, Uint8Array)) {
                    const S = new Uint8Array(D);
                    return m(S.buffer, S.byteOffset, S.byteLength);
                }
                return p(D);
            }
            function m(D, S, E) {
                if (S < 0 || D.byteLength < S) throw new RangeError('"offset" is outside of buffer bounds');
                if (D.byteLength < S + (E || 0)) throw new RangeError('"length" is outside of buffer bounds');
                let $;
                return S === void 0 && E === void 0 ? $ = new Uint8Array(D) : E === void 0 ? $ = new Uint8Array(D, S) : $ = new Uint8Array(D, S, E), Object.setPrototypeOf($, a.prototype), $;
            }
            function w(D) {
                if (a.isBuffer(D)) {
                    const S = v(D.length) | 0, E = o(S);
                    return E.length === 0 || D.copy(E, 0, 0, S), E;
                }
                if (D.length !== void 0) return typeof D.length != "number" || Re(D.length) ? o(0) : p(D);
                if (D.type === "Buffer" && Array.isArray(D.data)) return p(D.data);
            }
            function v(D) {
                if (D >= s) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s.toString(16) + " bytes");
                return D | 0;
            }
            function k(D) {
                return +D != D && (D = 0), a.alloc(+D);
            }
            a.isBuffer = function(S) {
                return S != null && S._isBuffer === !0 && S !== a.prototype;
            }, a.compare = function(S, E) {
                if (De(S, Uint8Array) && (S = a.from(S, S.offset, S.byteLength)), De(E, Uint8Array) && (E = a.from(E, E.offset, E.byteLength)), !a.isBuffer(S) || !a.isBuffer(E)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
                if (S === E) return 0;
                let $ = S.length, re = E.length;
                for(let ae = 0, me = Math.min($, re); ae < me; ++ae)if (S[ae] !== E[ae]) {
                    $ = S[ae], re = E[ae];
                    break;
                }
                return $ < re ? -1 : re < $ ? 1 : 0;
            }, a.isEncoding = function(S) {
                switch(String(S).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;
                }
            }, a.concat = function(S, E) {
                if (!Array.isArray(S)) throw new TypeError('"list" argument must be an Array of Buffers');
                if (S.length === 0) return a.alloc(0);
                let $;
                if (E === void 0) for(E = 0, $ = 0; $ < S.length; ++$)E += S[$].length;
                const re = a.allocUnsafe(E);
                let ae = 0;
                for($ = 0; $ < S.length; ++$){
                    let me = S[$];
                    if (De(me, Uint8Array)) ae + me.length > re.length ? (a.isBuffer(me) || (me = a.from(me)), me.copy(re, ae)) : Uint8Array.prototype.set.call(re, me, ae);
                    else if (a.isBuffer(me)) me.copy(re, ae);
                    else throw new TypeError('"list" argument must be an Array of Buffers');
                    ae += me.length;
                }
                return re;
            };
            function _(D, S) {
                if (a.isBuffer(D)) return D.length;
                if (ArrayBuffer.isView(D) || De(D, ArrayBuffer)) return D.byteLength;
                if (typeof D != "string") throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof D);
                const E = D.length, $ = arguments.length > 2 && arguments[2] === !0;
                if (!$ && E === 0) return 0;
                let re = !1;
                for(;;)switch(S){
                    case "ascii":
                    case "latin1":
                    case "binary":
                        return E;
                    case "utf8":
                    case "utf-8":
                        return Ve(D).length;
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return E * 2;
                    case "hex":
                        return E >>> 1;
                    case "base64":
                        return Qe(D).length;
                    default:
                        if (re) return $ ? -1 : Ve(D).length;
                        S = ("" + S).toLowerCase(), re = !0;
                }
            }
            a.byteLength = _;
            function A(D, S, E) {
                let $ = !1;
                if ((S === void 0 || S < 0) && (S = 0), S > this.length || ((E === void 0 || E > this.length) && (E = this.length), E <= 0) || (E >>>= 0, S >>>= 0, E <= S)) return "";
                for(D || (D = "utf8");;)switch(D){
                    case "hex":
                        return L(this, S, E);
                    case "utf8":
                    case "utf-8":
                        return g(this, S, E);
                    case "ascii":
                        return R(this, S, E);
                    case "latin1":
                    case "binary":
                        return N(this, S, E);
                    case "base64":
                        return M(this, S, E);
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return z(this, S, E);
                    default:
                        if ($) throw new TypeError("Unknown encoding: " + D);
                        D = (D + "").toLowerCase(), $ = !0;
                }
            }
            a.prototype._isBuffer = !0;
            function P(D, S, E) {
                const $ = D[S];
                D[S] = D[E], D[E] = $;
            }
            a.prototype.swap16 = function() {
                const S = this.length;
                if (S % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
                for(let E = 0; E < S; E += 2)P(this, E, E + 1);
                return this;
            }, a.prototype.swap32 = function() {
                const S = this.length;
                if (S % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
                for(let E = 0; E < S; E += 4)P(this, E, E + 3), P(this, E + 1, E + 2);
                return this;
            }, a.prototype.swap64 = function() {
                const S = this.length;
                if (S % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
                for(let E = 0; E < S; E += 8)P(this, E, E + 7), P(this, E + 1, E + 6), P(this, E + 2, E + 5), P(this, E + 3, E + 4);
                return this;
            }, a.prototype.toString = function() {
                const S = this.length;
                return S === 0 ? "" : arguments.length === 0 ? g(this, 0, S) : A.apply(this, arguments);
            }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(S) {
                if (!a.isBuffer(S)) throw new TypeError("Argument must be a Buffer");
                return this === S ? !0 : a.compare(this, S) === 0;
            }, a.prototype.inspect = function() {
                let S = "";
                const E = t.INSPECT_MAX_BYTES;
                return S = this.toString("hex", 0, E).replace(/(.{2})/g, "$1 ").trim(), this.length > E && (S += " ... "), "<Buffer " + S + ">";
            }, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(S, E, $, re, ae) {
                if (De(S, Uint8Array) && (S = a.from(S, S.offset, S.byteLength)), !a.isBuffer(S)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof S);
                if (E === void 0 && (E = 0), $ === void 0 && ($ = S ? S.length : 0), re === void 0 && (re = 0), ae === void 0 && (ae = this.length), E < 0 || $ > S.length || re < 0 || ae > this.length) throw new RangeError("out of range index");
                if (re >= ae && E >= $) return 0;
                if (re >= ae) return -1;
                if (E >= $) return 1;
                if (E >>>= 0, $ >>>= 0, re >>>= 0, ae >>>= 0, this === S) return 0;
                let me = ae - re, Oe = $ - E;
                const ut = Math.min(me, Oe), dt = this.slice(re, ae), Ut = S.slice(E, $);
                for(let at = 0; at < ut; ++at)if (dt[at] !== Ut[at]) {
                    me = dt[at], Oe = Ut[at];
                    break;
                }
                return me < Oe ? -1 : Oe < me ? 1 : 0;
            };
            function U(D, S, E, $, re) {
                if (D.length === 0) return -1;
                if (typeof E == "string" ? ($ = E, E = 0) : E > 2147483647 ? E = 2147483647 : E < -2147483648 && (E = -2147483648), E = +E, Re(E) && (E = re ? 0 : D.length - 1), E < 0 && (E = D.length + E), E >= D.length) {
                    if (re) return -1;
                    E = D.length - 1;
                } else if (E < 0) if (re) E = 0;
                else return -1;
                if (typeof S == "string" && (S = a.from(S, $)), a.isBuffer(S)) return S.length === 0 ? -1 : K(D, S, E, $, re);
                if (typeof S == "number") return S = S & 255, typeof Uint8Array.prototype.indexOf == "function" ? re ? Uint8Array.prototype.indexOf.call(D, S, E) : Uint8Array.prototype.lastIndexOf.call(D, S, E) : K(D, [
                    S
                ], E, $, re);
                throw new TypeError("val must be string, number or Buffer");
            }
            function K(D, S, E, $, re) {
                let ae = 1, me = D.length, Oe = S.length;
                if ($ !== void 0 && ($ = String($).toLowerCase(), $ === "ucs2" || $ === "ucs-2" || $ === "utf16le" || $ === "utf-16le")) {
                    if (D.length < 2 || S.length < 2) return -1;
                    ae = 2, me /= 2, Oe /= 2, E /= 2;
                }
                function ut(Ut, at) {
                    return ae === 1 ? Ut[at] : Ut.readUInt16BE(at * ae);
                }
                let dt;
                if (re) {
                    let Ut = -1;
                    for(dt = E; dt < me; dt++)if (ut(D, dt) === ut(S, Ut === -1 ? 0 : dt - Ut)) {
                        if (Ut === -1 && (Ut = dt), dt - Ut + 1 === Oe) return Ut * ae;
                    } else Ut !== -1 && (dt -= dt - Ut), Ut = -1;
                } else for(E + Oe > me && (E = me - Oe), dt = E; dt >= 0; dt--){
                    let Ut = !0;
                    for(let at = 0; at < Oe; at++)if (ut(D, dt + at) !== ut(S, at)) {
                        Ut = !1;
                        break;
                    }
                    if (Ut) return dt;
                }
                return -1;
            }
            a.prototype.includes = function(S, E, $) {
                return this.indexOf(S, E, $) !== -1;
            }, a.prototype.indexOf = function(S, E, $) {
                return U(this, S, E, $, !0);
            }, a.prototype.lastIndexOf = function(S, E, $) {
                return U(this, S, E, $, !1);
            };
            function X(D, S, E, $) {
                E = Number(E) || 0;
                const re = D.length - E;
                $ ? ($ = Number($), $ > re && ($ = re)) : $ = re;
                const ae = S.length;
                $ > ae / 2 && ($ = ae / 2);
                let me;
                for(me = 0; me < $; ++me){
                    const Oe = parseInt(S.substr(me * 2, 2), 16);
                    if (Re(Oe)) return me;
                    D[E + me] = Oe;
                }
                return me;
            }
            function G(D, S, E, $) {
                return le(Ve(S, D.length - E), D, E, $);
            }
            function ce(D, S, E, $) {
                return le(Ne(S), D, E, $);
            }
            function ie(D, S, E, $) {
                return le(Qe(S), D, E, $);
            }
            function Y(D, S, E, $) {
                return le(be(S, D.length - E), D, E, $);
            }
            a.prototype.write = function(S, E, $, re) {
                if (E === void 0) re = "utf8", $ = this.length, E = 0;
                else if ($ === void 0 && typeof E == "string") re = E, $ = this.length, E = 0;
                else if (isFinite(E)) E = E >>> 0, isFinite($) ? ($ = $ >>> 0, re === void 0 && (re = "utf8")) : (re = $, $ = void 0);
                else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
                const ae = this.length - E;
                if (($ === void 0 || $ > ae) && ($ = ae), S.length > 0 && ($ < 0 || E < 0) || E > this.length) throw new RangeError("Attempt to write outside buffer bounds");
                re || (re = "utf8");
                let me = !1;
                for(;;)switch(re){
                    case "hex":
                        return X(this, S, E, $);
                    case "utf8":
                    case "utf-8":
                        return G(this, S, E, $);
                    case "ascii":
                    case "latin1":
                    case "binary":
                        return ce(this, S, E, $);
                    case "base64":
                        return ie(this, S, E, $);
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return Y(this, S, E, $);
                    default:
                        if (me) throw new TypeError("Unknown encoding: " + re);
                        re = ("" + re).toLowerCase(), me = !0;
                }
            }, a.prototype.toJSON = function() {
                return {
                    type: "Buffer",
                    data: Array.prototype.slice.call(this._arr || this, 0)
                };
            };
            function M(D, S, E) {
                return S === 0 && E === D.length ? e.fromByteArray(D) : e.fromByteArray(D.slice(S, E));
            }
            function g(D, S, E) {
                E = Math.min(D.length, E);
                const $ = [];
                let re = S;
                for(; re < E;){
                    const ae = D[re];
                    let me = null, Oe = ae > 239 ? 4 : ae > 223 ? 3 : ae > 191 ? 2 : 1;
                    if (re + Oe <= E) {
                        let ut, dt, Ut, at;
                        switch(Oe){
                            case 1:
                                ae < 128 && (me = ae);
                                break;
                            case 2:
                                ut = D[re + 1], (ut & 192) === 128 && (at = (ae & 31) << 6 | ut & 63, at > 127 && (me = at));
                                break;
                            case 3:
                                ut = D[re + 1], dt = D[re + 2], (ut & 192) === 128 && (dt & 192) === 128 && (at = (ae & 15) << 12 | (ut & 63) << 6 | dt & 63, at > 2047 && (at < 55296 || at > 57343) && (me = at));
                                break;
                            case 4:
                                ut = D[re + 1], dt = D[re + 2], Ut = D[re + 3], (ut & 192) === 128 && (dt & 192) === 128 && (Ut & 192) === 128 && (at = (ae & 15) << 18 | (ut & 63) << 12 | (dt & 63) << 6 | Ut & 63, at > 65535 && at < 1114112 && (me = at));
                        }
                    }
                    me === null ? (me = 65533, Oe = 1) : me > 65535 && (me -= 65536, $.push(me >>> 10 & 1023 | 55296), me = 56320 | me & 1023), $.push(me), re += Oe;
                }
                return C($);
            }
            const y = 4096;
            function C(D) {
                const S = D.length;
                if (S <= y) return String.fromCharCode.apply(String, D);
                let E = "", $ = 0;
                for(; $ < S;)E += String.fromCharCode.apply(String, D.slice($, $ += y));
                return E;
            }
            function R(D, S, E) {
                let $ = "";
                E = Math.min(D.length, E);
                for(let re = S; re < E; ++re)$ += String.fromCharCode(D[re] & 127);
                return $;
            }
            function N(D, S, E) {
                let $ = "";
                E = Math.min(D.length, E);
                for(let re = S; re < E; ++re)$ += String.fromCharCode(D[re]);
                return $;
            }
            function L(D, S, E) {
                const $ = D.length;
                (!S || S < 0) && (S = 0), (!E || E < 0 || E > $) && (E = $);
                let re = "";
                for(let ae = S; ae < E; ++ae)re += ee[D[ae]];
                return re;
            }
            function z(D, S, E) {
                const $ = D.slice(S, E);
                let re = "";
                for(let ae = 0; ae < $.length - 1; ae += 2)re += String.fromCharCode($[ae] + $[ae + 1] * 256);
                return re;
            }
            a.prototype.slice = function(S, E) {
                const $ = this.length;
                S = ~~S, E = E === void 0 ? $ : ~~E, S < 0 ? (S += $, S < 0 && (S = 0)) : S > $ && (S = $), E < 0 ? (E += $, E < 0 && (E = 0)) : E > $ && (E = $), E < S && (E = S);
                const re = this.subarray(S, E);
                return Object.setPrototypeOf(re, a.prototype), re;
            };
            function B(D, S, E) {
                if (D % 1 !== 0 || D < 0) throw new RangeError("offset is not uint");
                if (D + S > E) throw new RangeError("Trying to access beyond buffer length");
            }
            a.prototype.readUintLE = a.prototype.readUIntLE = function(S, E, $) {
                S = S >>> 0, E = E >>> 0, $ || B(S, E, this.length);
                let re = this[S], ae = 1, me = 0;
                for(; ++me < E && (ae *= 256);)re += this[S + me] * ae;
                return re;
            }, a.prototype.readUintBE = a.prototype.readUIntBE = function(S, E, $) {
                S = S >>> 0, E = E >>> 0, $ || B(S, E, this.length);
                let re = this[S + --E], ae = 1;
                for(; E > 0 && (ae *= 256);)re += this[S + --E] * ae;
                return re;
            }, a.prototype.readUint8 = a.prototype.readUInt8 = function(S, E) {
                return S = S >>> 0, E || B(S, 1, this.length), this[S];
            }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(S, E) {
                return S = S >>> 0, E || B(S, 2, this.length), this[S] | this[S + 1] << 8;
            }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(S, E) {
                return S = S >>> 0, E || B(S, 2, this.length), this[S] << 8 | this[S + 1];
            }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), (this[S] | this[S + 1] << 8 | this[S + 2] << 16) + this[S + 3] * 16777216;
            }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), this[S] * 16777216 + (this[S + 1] << 16 | this[S + 2] << 8 | this[S + 3]);
            }, a.prototype.readBigUInt64LE = oe(function(S) {
                S = S >>> 0, Ue(S, "offset");
                const E = this[S], $ = this[S + 7];
                (E === void 0 || $ === void 0) && Ie(S, this.length - 8);
                const re = E + this[++S] * 2 ** 8 + this[++S] * 2 ** 16 + this[++S] * 2 ** 24, ae = this[++S] + this[++S] * 2 ** 8 + this[++S] * 2 ** 16 + $ * 2 ** 24;
                return BigInt(re) + (BigInt(ae) << BigInt(32));
            }), a.prototype.readBigUInt64BE = oe(function(S) {
                S = S >>> 0, Ue(S, "offset");
                const E = this[S], $ = this[S + 7];
                (E === void 0 || $ === void 0) && Ie(S, this.length - 8);
                const re = E * 2 ** 24 + this[++S] * 2 ** 16 + this[++S] * 2 ** 8 + this[++S], ae = this[++S] * 2 ** 24 + this[++S] * 2 ** 16 + this[++S] * 2 ** 8 + $;
                return (BigInt(re) << BigInt(32)) + BigInt(ae);
            }), a.prototype.readIntLE = function(S, E, $) {
                S = S >>> 0, E = E >>> 0, $ || B(S, E, this.length);
                let re = this[S], ae = 1, me = 0;
                for(; ++me < E && (ae *= 256);)re += this[S + me] * ae;
                return ae *= 128, re >= ae && (re -= Math.pow(2, 8 * E)), re;
            }, a.prototype.readIntBE = function(S, E, $) {
                S = S >>> 0, E = E >>> 0, $ || B(S, E, this.length);
                let re = E, ae = 1, me = this[S + --re];
                for(; re > 0 && (ae *= 256);)me += this[S + --re] * ae;
                return ae *= 128, me >= ae && (me -= Math.pow(2, 8 * E)), me;
            }, a.prototype.readInt8 = function(S, E) {
                return S = S >>> 0, E || B(S, 1, this.length), this[S] & 128 ? (255 - this[S] + 1) * -1 : this[S];
            }, a.prototype.readInt16LE = function(S, E) {
                S = S >>> 0, E || B(S, 2, this.length);
                const $ = this[S] | this[S + 1] << 8;
                return $ & 32768 ? $ | 4294901760 : $;
            }, a.prototype.readInt16BE = function(S, E) {
                S = S >>> 0, E || B(S, 2, this.length);
                const $ = this[S + 1] | this[S] << 8;
                return $ & 32768 ? $ | 4294901760 : $;
            }, a.prototype.readInt32LE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), this[S] | this[S + 1] << 8 | this[S + 2] << 16 | this[S + 3] << 24;
            }, a.prototype.readInt32BE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), this[S] << 24 | this[S + 1] << 16 | this[S + 2] << 8 | this[S + 3];
            }, a.prototype.readBigInt64LE = oe(function(S) {
                S = S >>> 0, Ue(S, "offset");
                const E = this[S], $ = this[S + 7];
                (E === void 0 || $ === void 0) && Ie(S, this.length - 8);
                const re = this[S + 4] + this[S + 5] * 2 ** 8 + this[S + 6] * 2 ** 16 + ($ << 24);
                return (BigInt(re) << BigInt(32)) + BigInt(E + this[++S] * 2 ** 8 + this[++S] * 2 ** 16 + this[++S] * 2 ** 24);
            }), a.prototype.readBigInt64BE = oe(function(S) {
                S = S >>> 0, Ue(S, "offset");
                const E = this[S], $ = this[S + 7];
                (E === void 0 || $ === void 0) && Ie(S, this.length - 8);
                const re = (E << 24) + this[++S] * 2 ** 16 + this[++S] * 2 ** 8 + this[++S];
                return (BigInt(re) << BigInt(32)) + BigInt(this[++S] * 2 ** 24 + this[++S] * 2 ** 16 + this[++S] * 2 ** 8 + $);
            }), a.prototype.readFloatLE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), n.read(this, S, !0, 23, 4);
            }, a.prototype.readFloatBE = function(S, E) {
                return S = S >>> 0, E || B(S, 4, this.length), n.read(this, S, !1, 23, 4);
            }, a.prototype.readDoubleLE = function(S, E) {
                return S = S >>> 0, E || B(S, 8, this.length), n.read(this, S, !0, 52, 8);
            }, a.prototype.readDoubleBE = function(S, E) {
                return S = S >>> 0, E || B(S, 8, this.length), n.read(this, S, !1, 52, 8);
            };
            function x(D, S, E, $, re, ae) {
                if (!a.isBuffer(D)) throw new TypeError('"buffer" argument must be a Buffer instance');
                if (S > re || S < ae) throw new RangeError('"value" argument is out of bounds');
                if (E + $ > D.length) throw new RangeError("Index out of range");
            }
            a.prototype.writeUintLE = a.prototype.writeUIntLE = function(S, E, $, re) {
                if (S = +S, E = E >>> 0, $ = $ >>> 0, !re) {
                    const Oe = Math.pow(2, 8 * $) - 1;
                    x(this, S, E, $, Oe, 0);
                }
                let ae = 1, me = 0;
                for(this[E] = S & 255; ++me < $ && (ae *= 256);)this[E + me] = S / ae & 255;
                return E + $;
            }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(S, E, $, re) {
                if (S = +S, E = E >>> 0, $ = $ >>> 0, !re) {
                    const Oe = Math.pow(2, 8 * $) - 1;
                    x(this, S, E, $, Oe, 0);
                }
                let ae = $ - 1, me = 1;
                for(this[E + ae] = S & 255; --ae >= 0 && (me *= 256);)this[E + ae] = S / me & 255;
                return E + $;
            }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 1, 255, 0), this[E] = S & 255, E + 1;
            }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 2, 65535, 0), this[E] = S & 255, this[E + 1] = S >>> 8, E + 2;
            }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 2, 65535, 0), this[E] = S >>> 8, this[E + 1] = S & 255, E + 2;
            }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 4, 4294967295, 0), this[E + 3] = S >>> 24, this[E + 2] = S >>> 16, this[E + 1] = S >>> 8, this[E] = S & 255, E + 4;
            }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 4, 4294967295, 0), this[E] = S >>> 24, this[E + 1] = S >>> 16, this[E + 2] = S >>> 8, this[E + 3] = S & 255, E + 4;
            };
            function O(D, S, E, $, re) {
                Ce(S, $, re, D, E, 7);
                let ae = Number(S & BigInt(4294967295));
                D[E++] = ae, ae = ae >> 8, D[E++] = ae, ae = ae >> 8, D[E++] = ae, ae = ae >> 8, D[E++] = ae;
                let me = Number(S >> BigInt(32) & BigInt(4294967295));
                return D[E++] = me, me = me >> 8, D[E++] = me, me = me >> 8, D[E++] = me, me = me >> 8, D[E++] = me, E;
            }
            function q(D, S, E, $, re) {
                Ce(S, $, re, D, E, 7);
                let ae = Number(S & BigInt(4294967295));
                D[E + 7] = ae, ae = ae >> 8, D[E + 6] = ae, ae = ae >> 8, D[E + 5] = ae, ae = ae >> 8, D[E + 4] = ae;
                let me = Number(S >> BigInt(32) & BigInt(4294967295));
                return D[E + 3] = me, me = me >> 8, D[E + 2] = me, me = me >> 8, D[E + 1] = me, me = me >> 8, D[E] = me, E + 8;
            }
            a.prototype.writeBigUInt64LE = oe(function(S, E = 0) {
                return O(this, S, E, BigInt(0), BigInt("0xffffffffffffffff"));
            }), a.prototype.writeBigUInt64BE = oe(function(S, E = 0) {
                return q(this, S, E, BigInt(0), BigInt("0xffffffffffffffff"));
            }), a.prototype.writeIntLE = function(S, E, $, re) {
                if (S = +S, E = E >>> 0, !re) {
                    const ut = Math.pow(2, 8 * $ - 1);
                    x(this, S, E, $, ut - 1, -ut);
                }
                let ae = 0, me = 1, Oe = 0;
                for(this[E] = S & 255; ++ae < $ && (me *= 256);)S < 0 && Oe === 0 && this[E + ae - 1] !== 0 && (Oe = 1), this[E + ae] = (S / me >> 0) - Oe & 255;
                return E + $;
            }, a.prototype.writeIntBE = function(S, E, $, re) {
                if (S = +S, E = E >>> 0, !re) {
                    const ut = Math.pow(2, 8 * $ - 1);
                    x(this, S, E, $, ut - 1, -ut);
                }
                let ae = $ - 1, me = 1, Oe = 0;
                for(this[E + ae] = S & 255; --ae >= 0 && (me *= 256);)S < 0 && Oe === 0 && this[E + ae + 1] !== 0 && (Oe = 1), this[E + ae] = (S / me >> 0) - Oe & 255;
                return E + $;
            }, a.prototype.writeInt8 = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 1, 127, -128), S < 0 && (S = 255 + S + 1), this[E] = S & 255, E + 1;
            }, a.prototype.writeInt16LE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 2, 32767, -32768), this[E] = S & 255, this[E + 1] = S >>> 8, E + 2;
            }, a.prototype.writeInt16BE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 2, 32767, -32768), this[E] = S >>> 8, this[E + 1] = S & 255, E + 2;
            }, a.prototype.writeInt32LE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 4, 2147483647, -2147483648), this[E] = S & 255, this[E + 1] = S >>> 8, this[E + 2] = S >>> 16, this[E + 3] = S >>> 24, E + 4;
            }, a.prototype.writeInt32BE = function(S, E, $) {
                return S = +S, E = E >>> 0, $ || x(this, S, E, 4, 2147483647, -2147483648), S < 0 && (S = 4294967295 + S + 1), this[E] = S >>> 24, this[E + 1] = S >>> 16, this[E + 2] = S >>> 8, this[E + 3] = S & 255, E + 4;
            }, a.prototype.writeBigInt64LE = oe(function(S, E = 0) {
                return O(this, S, E, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
            }), a.prototype.writeBigInt64BE = oe(function(S, E = 0) {
                return q(this, S, E, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
            });
            function H(D, S, E, $, re, ae) {
                if (E + $ > D.length) throw new RangeError("Index out of range");
                if (E < 0) throw new RangeError("Index out of range");
            }
            function Z(D, S, E, $, re) {
                return S = +S, E = E >>> 0, re || H(D, S, E, 4), n.write(D, S, E, $, 23, 4), E + 4;
            }
            a.prototype.writeFloatLE = function(S, E, $) {
                return Z(this, S, E, !0, $);
            }, a.prototype.writeFloatBE = function(S, E, $) {
                return Z(this, S, E, !1, $);
            };
            function te(D, S, E, $, re) {
                return S = +S, E = E >>> 0, re || H(D, S, E, 8), n.write(D, S, E, $, 52, 8), E + 8;
            }
            a.prototype.writeDoubleLE = function(S, E, $) {
                return te(this, S, E, !0, $);
            }, a.prototype.writeDoubleBE = function(S, E, $) {
                return te(this, S, E, !1, $);
            }, a.prototype.copy = function(S, E, $, re) {
                if (!a.isBuffer(S)) throw new TypeError("argument should be a Buffer");
                if ($ || ($ = 0), !re && re !== 0 && (re = this.length), E >= S.length && (E = S.length), E || (E = 0), re > 0 && re < $ && (re = $), re === $ || S.length === 0 || this.length === 0) return 0;
                if (E < 0) throw new RangeError("targetStart out of bounds");
                if ($ < 0 || $ >= this.length) throw new RangeError("Index out of range");
                if (re < 0) throw new RangeError("sourceEnd out of bounds");
                re > this.length && (re = this.length), S.length - E < re - $ && (re = S.length - E + $);
                const ae = re - $;
                return this === S && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(E, $, re) : Uint8Array.prototype.set.call(S, this.subarray($, re), E), ae;
            }, a.prototype.fill = function(S, E, $, re) {
                if (typeof S == "string") {
                    if (typeof E == "string" ? (re = E, E = 0, $ = this.length) : typeof $ == "string" && (re = $, $ = this.length), re !== void 0 && typeof re != "string") throw new TypeError("encoding must be a string");
                    if (typeof re == "string" && !a.isEncoding(re)) throw new TypeError("Unknown encoding: " + re);
                    if (S.length === 1) {
                        const me = S.charCodeAt(0);
                        (re === "utf8" && me < 128 || re === "latin1") && (S = me);
                    }
                } else typeof S == "number" ? S = S & 255 : typeof S == "boolean" && (S = Number(S));
                if (E < 0 || this.length < E || this.length < $) throw new RangeError("Out of range index");
                if ($ <= E) return this;
                E = E >>> 0, $ = $ === void 0 ? this.length : $ >>> 0, S || (S = 0);
                let ae;
                if (typeof S == "number") for(ae = E; ae < $; ++ae)this[ae] = S;
                else {
                    const me = a.isBuffer(S) ? S : a.from(S, re), Oe = me.length;
                    if (Oe === 0) throw new TypeError('The value "' + S + '" is invalid for argument "value"');
                    for(ae = 0; ae < $ - E; ++ae)this[ae + E] = me[ae % Oe];
                }
                return this;
            };
            const J = {};
            function se(D, S, E) {
                J[D] = class extends E {
                    constructor(){
                        super(), Object.defineProperty(this, "message", {
                            value: S.apply(this, arguments),
                            writable: !0,
                            configurable: !0
                        }), this.name = `${this.name} [${D}]`, this.stack, delete this.name;
                    }
                    get code() {
                        return D;
                    }
                    set code(re) {
                        Object.defineProperty(this, "code", {
                            configurable: !0,
                            enumerable: !0,
                            value: re,
                            writable: !0
                        });
                    }
                    toString() {
                        return `${this.name} [${D}]: ${this.message}`;
                    }
                };
            }
            se("ERR_BUFFER_OUT_OF_BOUNDS", function(D) {
                return D ? `${D} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
            }, RangeError), se("ERR_INVALID_ARG_TYPE", function(D, S) {
                return `The "${D}" argument must be of type number. Received type ${typeof S}`;
            }, TypeError), se("ERR_OUT_OF_RANGE", function(D, S, E) {
                let $ = `The value of "${D}" is out of range.`, re = E;
                return Number.isInteger(E) && Math.abs(E) > 2 ** 32 ? re = fe(String(E)) : typeof E == "bigint" && (re = String(E), (E > BigInt(2) ** BigInt(32) || E < -(BigInt(2) ** BigInt(32))) && (re = fe(re)), re += "n"), $ += ` It must be ${S}. Received ${re}`, $;
            }, RangeError);
            function fe(D) {
                let S = "", E = D.length;
                const $ = D[0] === "-" ? 1 : 0;
                for(; E >= $ + 4; E -= 3)S = `_${D.slice(E - 3, E)}${S}`;
                return `${D.slice(0, E)}${S}`;
            }
            function ge(D, S, E) {
                Ue(S, "offset"), (D[S] === void 0 || D[S + E] === void 0) && Ie(S, D.length - (E + 1));
            }
            function Ce(D, S, E, $, re, ae) {
                if (D > E || D < S) {
                    const me = typeof S == "bigint" ? "n" : "";
                    let Oe;
                    throw S === 0 || S === BigInt(0) ? Oe = `>= 0${me} and < 2${me} ** ${(ae + 1) * 8}${me}` : Oe = `>= -(2${me} ** ${(ae + 1) * 8 - 1}${me}) and < 2 ** ${(ae + 1) * 8 - 1}${me}`, new J.ERR_OUT_OF_RANGE("value", Oe, D);
                }
                ge($, re, ae);
            }
            function Ue(D, S) {
                if (typeof D != "number") throw new J.ERR_INVALID_ARG_TYPE(S, "number", D);
            }
            function Ie(D, S, E) {
                throw Math.floor(D) !== D ? (Ue(D, E), new J.ERR_OUT_OF_RANGE("offset", "an integer", D)) : S < 0 ? new J.ERR_BUFFER_OUT_OF_BOUNDS : new J.ERR_OUT_OF_RANGE("offset", `>= 0 and <= ${S}`, D);
            }
            const Le = /[^+/0-9A-Za-z-_]/g;
            function Ge(D) {
                if (D = D.split("=")[0], D = D.trim().replace(Le, ""), D.length < 2) return "";
                for(; D.length % 4 !== 0;)D = D + "=";
                return D;
            }
            function Ve(D, S) {
                S = S || 1 / 0;
                let E;
                const $ = D.length;
                let re = null;
                const ae = [];
                for(let me = 0; me < $; ++me){
                    if (E = D.charCodeAt(me), E > 55295 && E < 57344) {
                        if (!re) {
                            if (E > 56319) {
                                (S -= 3) > -1 && ae.push(239, 191, 189);
                                continue;
                            } else if (me + 1 === $) {
                                (S -= 3) > -1 && ae.push(239, 191, 189);
                                continue;
                            }
                            re = E;
                            continue;
                        }
                        if (E < 56320) {
                            (S -= 3) > -1 && ae.push(239, 191, 189), re = E;
                            continue;
                        }
                        E = (re - 55296 << 10 | E - 56320) + 65536;
                    } else re && (S -= 3) > -1 && ae.push(239, 191, 189);
                    if (re = null, E < 128) {
                        if ((S -= 1) < 0) break;
                        ae.push(E);
                    } else if (E < 2048) {
                        if ((S -= 2) < 0) break;
                        ae.push(E >> 6 | 192, E & 63 | 128);
                    } else if (E < 65536) {
                        if ((S -= 3) < 0) break;
                        ae.push(E >> 12 | 224, E >> 6 & 63 | 128, E & 63 | 128);
                    } else if (E < 1114112) {
                        if ((S -= 4) < 0) break;
                        ae.push(E >> 18 | 240, E >> 12 & 63 | 128, E >> 6 & 63 | 128, E & 63 | 128);
                    } else throw new Error("Invalid code point");
                }
                return ae;
            }
            function Ne(D) {
                const S = [];
                for(let E = 0; E < D.length; ++E)S.push(D.charCodeAt(E) & 255);
                return S;
            }
            function be(D, S) {
                let E, $, re;
                const ae = [];
                for(let me = 0; me < D.length && !((S -= 2) < 0); ++me)E = D.charCodeAt(me), $ = E >> 8, re = E % 256, ae.push(re), ae.push($);
                return ae;
            }
            function Qe(D) {
                return e.toByteArray(Ge(D));
            }
            function le(D, S, E, $) {
                let re;
                for(re = 0; re < $ && !(re + E >= S.length || re >= D.length); ++re)S[re + E] = D[re];
                return re;
            }
            function De(D, S) {
                return D instanceof S || D != null && D.constructor != null && D.constructor.name != null && D.constructor.name === S.name;
            }
            function Re(D) {
                return D !== D;
            }
            const ee = (function() {
                const D = "0123456789abcdef", S = new Array(256);
                for(let E = 0; E < 16; ++E){
                    const $ = E * 16;
                    for(let re = 0; re < 16; ++re)S[$ + re] = D[E] + D[re];
                }
                return S;
            })();
            function oe(D) {
                return typeof BigInt > "u" ? ye : D;
            }
            function ye() {
                throw new Error("BigInt not supported");
            }
        })(i5)), i5;
    };
    var Ine = yU();
    const i2 = globalThis;
    i2.Buffer || (i2.Buffer = Ine.Buffer);
    i2.global || (i2.global = globalThis);
    const YO = globalThis;
    YO.process || (YO.process = {
        env: {},
        browser: !0,
        version: ""
    });
    xi = Rte;
    function AT(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function ep(t, e = "") {
        if (!Number.isSafeInteger(t) || t < 0) {
            const n = e && `"${e}" `;
            throw new Error(`${n}expected integer >= 0, got ${t}`);
        }
    }
    function hr(t, e, n = "") {
        const r = AT(t), s = t?.length, i = e !== void 0;
        if (!r || i && s !== e) {
            const o = n && `"${n}" `, a = i ? ` of length ${e}` : "", c = r ? `length=${s}` : `type=${typeof t}`;
            throw new Error(o + "expected Uint8Array" + a + ", got " + c);
        }
        return t;
    }
    function wU(t) {
        if (typeof t != "function" || typeof t.create != "function") throw new Error("Hash must wrapped by utils.createHasher");
        ep(t.outputLen), ep(t.blockLen);
    }
    function o2(t, e = !0) {
        if (t.destroyed) throw new Error("Hash instance has been destroyed");
        if (e && t.finished) throw new Error("Hash#digest() has already been called");
    }
    function Ane(t, e) {
        hr(t, void 0, "digestInto() output");
        const n = e.outputLen;
        if (t.length < n) throw new Error('"digestInto() output" expected to be of length >=' + n);
    }
    function gd(...t) {
        for(let e = 0; e < t.length; e++)t[e].fill(0);
    }
    function jh(t) {
        return new DataView(t.buffer, t.byteOffset, t.byteLength);
    }
    function oc(t, e) {
        return t << 32 - e | t >>> e;
    }
    function Tw(t, e) {
        return t << e | t >>> 32 - e >>> 0;
    }
    const _U = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Pne = Array.from({
        length: 256
    }, (t, e)=>e.toString(16).padStart(2, "0"));
    function $x(t) {
        if (hr(t), _U) return t.toHex();
        let e = "";
        for(let n = 0; n < t.length; n++)e += Pne[t[n]];
        return e;
    }
    const ol = {
        _0: 48,
        _9: 57,
        A: 65,
        F: 70,
        a: 97,
        f: 102
    };
    function QO(t) {
        if (t >= ol._0 && t <= ol._9) return t - ol._0;
        if (t >= ol.A && t <= ol.F) return t - (ol.A - 10);
        if (t >= ol.a && t <= ol.f) return t - (ol.a - 10);
    }
    function a2(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        if (_U) return Uint8Array.fromHex(t);
        const e = t.length, n = e / 2;
        if (e % 2) throw new Error("hex string expected, got unpadded hex of length " + e);
        const r = new Uint8Array(n);
        for(let s = 0, i = 0; s < n; s++, i += 2){
            const o = QO(t.charCodeAt(i)), a = QO(t.charCodeAt(i + 1));
            if (o === void 0 || a === void 0) {
                const c = t[i] + t[i + 1];
                throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + i);
            }
            r[s] = o * 16 + a;
        }
        return r;
    }
    function Yo(...t) {
        let e = 0;
        for(let r = 0; r < t.length; r++){
            const s = t[r];
            hr(s), e += s.length;
        }
        const n = new Uint8Array(e);
        for(let r = 0, s = 0; r < t.length; r++){
            const i = t[r];
            n.set(i, s), s += i.length;
        }
        return n;
    }
    function PT(t, e = {}) {
        const n = (s, i)=>t(i).update(s).digest(), r = t(void 0);
        return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.create = (s)=>t(s), Object.assign(n, e), Object.freeze(n);
    }
    function xU(t = 32) {
        const e = typeof globalThis == "object" ? globalThis.crypto : null;
        if (typeof e?.getRandomValues != "function") throw new Error("crypto.getRandomValues must be defined");
        return e.getRandomValues(new Uint8Array(t));
    }
    const vU = (t)=>({
            oid: Uint8Array.from([
                6,
                9,
                96,
                134,
                72,
                1,
                101,
                3,
                4,
                2,
                t
            ])
        });
    function One(t, e, n) {
        return t & e ^ ~t & n;
    }
    function Mne(t, e, n) {
        return t & e ^ t & n ^ e & n;
    }
    let OT = class {
        blockLen;
        outputLen;
        padOffset;
        isLE;
        buffer;
        view;
        finished = !1;
        length = 0;
        pos = 0;
        destroyed = !1;
        constructor(e, n, r, s){
            this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = s, this.buffer = new Uint8Array(e), this.view = jh(this.buffer);
        }
        update(e) {
            o2(this), hr(e);
            const { view: n, buffer: r, blockLen: s } = this, i = e.length;
            for(let o = 0; o < i;){
                const a = Math.min(s - this.pos, i - o);
                if (a === s) {
                    const c = jh(e);
                    for(; s <= i - o; o += s)this.process(c, o);
                    continue;
                }
                r.set(e.subarray(o, o + a), this.pos), this.pos += a, o += a, this.pos === s && (this.process(n, 0), this.pos = 0);
            }
            return this.length += e.length, this.roundClean(), this;
        }
        digestInto(e) {
            o2(this), Ane(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, gd(this.buffer.subarray(o)), this.padOffset > s - o && (this.process(r, 0), o = 0);
            for(let d = o; d < s; d++)n[d] = 0;
            r.setBigUint64(s - 8, BigInt(this.length * 8), i), this.process(r, 0);
            const a = jh(e), c = this.outputLen;
            if (c % 4) throw new Error("_sha2: outputLen must be aligned to 32bit");
            const l = c / 4, u = this.get();
            if (l > u.length) throw new Error("_sha2: outputLen bigger than state");
            for(let d = 0; d < l; d++)a.setUint32(4 * d, u[d], i);
        }
        digest() {
            const { buffer: e, outputLen: n } = this;
            this.digestInto(e);
            const r = e.slice(0, n);
            return this.destroy(), r;
        }
        _cloneInto(e) {
            e ||= new this.constructor, e.set(...this.get());
            const { blockLen: n, buffer: r, length: s, finished: i, destroyed: o, pos: a } = this;
            return e.destroyed = o, e.finished = i, e.length = s, e.pos = a, s % n && e.buffer.set(r), e;
        }
        clone() {
            return this._cloneInto();
        }
    };
    const Du = Uint32Array.from([
        1779033703,
        3144134277,
        1013904242,
        2773480762,
        1359893119,
        2600822924,
        528734635,
        1541459225
    ]), Zs = Uint32Array.from([
        1779033703,
        4089235720,
        3144134277,
        2227873595,
        1013904242,
        4271175723,
        2773480762,
        1595750129,
        1359893119,
        2917565137,
        2600822924,
        725511199,
        528734635,
        4215389547,
        1541459225,
        327033209
    ]), Cw = BigInt(2 ** 32 - 1), eM = BigInt(32);
    function Rne(t, e = !1) {
        return e ? {
            h: Number(t & Cw),
            l: Number(t >> eM & Cw)
        } : {
            h: Number(t >> eM & Cw) | 0,
            l: Number(t & Cw) | 0
        };
    }
    function Nne(t, e = !1) {
        const n = t.length;
        let r = new Uint32Array(n), s = new Uint32Array(n);
        for(let i = 0; i < n; i++){
            const { h: o, l: a } = Rne(t[i], e);
            [r[i], s[i]] = [
                o,
                a
            ];
        }
        return [
            r,
            s
        ];
    }
    const tM = (t, e, n)=>t >>> n, nM = (t, e, n)=>t << 32 - n | e >>> n, dh = (t, e, n)=>t >>> n | e << 32 - n, fh = (t, e, n)=>t << 32 - n | e >>> n, Ew = (t, e, n)=>t << 64 - n | e >>> n - 32, Iw = (t, e, n)=>t >>> n - 32 | e << 64 - n;
    function al(t, e, n, r) {
        const s = (e >>> 0) + (r >>> 0);
        return {
            h: t + n + (s / 2 ** 32 | 0) | 0,
            l: s | 0
        };
    }
    const Vne = (t, e, n)=>(t >>> 0) + (e >>> 0) + (n >>> 0), Dne = (t, e, n, r)=>e + n + r + (t / 2 ** 32 | 0) | 0, Bne = (t, e, n, r)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0), Fne = (t, e, n, r, s)=>e + n + r + s + (t / 2 ** 32 | 0) | 0, Lne = (t, e, n, r, s)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0) + (s >>> 0), zne = (t, e, n, r, s, i)=>e + n + r + s + i + (t / 2 ** 32 | 0) | 0, Une = 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
    ]), Bu = new Uint32Array(64);
    let Hne = class extends OT {
        constructor(e){
            super(64, e, 8, !1);
        }
        get() {
            const { A: e, B: n, C: r, D: s, E: i, F: o, G: a, H: c } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c
            ];
        }
        set(e, n, r, s, i, o, a, c) {
            this.A = e | 0, this.B = n | 0, this.C = r | 0, this.D = s | 0, this.E = i | 0, this.F = o | 0, this.G = a | 0, this.H = c | 0;
        }
        process(e, n) {
            for(let d = 0; d < 16; d++, n += 4)Bu[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Bu[d - 15], p = Bu[d - 2], h = oc(f, 7) ^ oc(f, 18) ^ f >>> 3, m = oc(p, 17) ^ oc(p, 19) ^ p >>> 10;
                Bu[d] = m + Bu[d - 7] + h + Bu[d - 16] | 0;
            }
            let { A: r, B: s, C: i, D: o, E: a, F: c, G: l, H: u } = this;
            for(let d = 0; d < 64; d++){
                const f = oc(a, 6) ^ oc(a, 11) ^ oc(a, 25), p = u + f + One(a, c, l) + Une[d] + Bu[d] | 0, m = (oc(r, 2) ^ oc(r, 13) ^ oc(r, 22)) + Mne(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + m | 0;
            }
            r = r + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, u = u + this.H | 0, this.set(r, s, i, o, a, c, l, u);
        }
        roundClean() {
            gd(Bu);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), gd(this.buffer);
        }
    }, jne = class extends Hne {
        A = Du[0] | 0;
        B = Du[1] | 0;
        C = Du[2] | 0;
        D = Du[3] | 0;
        E = Du[4] | 0;
        F = Du[5] | 0;
        G = Du[6] | 0;
        H = Du[7] | 0;
        constructor(){
            super(32);
        }
    };
    const SU = Nne([
        "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))), qne = SU[0], Wne = SU[1], Fu = new Uint32Array(80), Lu = new Uint32Array(80);
    class Kne extends OT {
        constructor(e){
            super(128, e, 16, !1);
        }
        get() {
            const { Ah: e, Al: n, Bh: r, Bl: s, Ch: i, Cl: o, Dh: a, Dl: c, Eh: l, El: u, Fh: d, Fl: f, Gh: p, Gl: h, Hh: m, Hl: w } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c,
                l,
                u,
                d,
                f,
                p,
                h,
                m,
                w
            ];
        }
        set(e, n, r, s, i, o, a, c, l, u, d, f, p, h, m, w) {
            this.Ah = e | 0, this.Al = n | 0, this.Bh = r | 0, this.Bl = s | 0, this.Ch = i | 0, this.Cl = o | 0, this.Dh = a | 0, this.Dl = c | 0, this.Eh = l | 0, this.El = u | 0, this.Fh = d | 0, this.Fl = f | 0, this.Gh = p | 0, this.Gl = h | 0, this.Hh = m | 0, this.Hl = w | 0;
        }
        process(e, n) {
            for(let _ = 0; _ < 16; _++, n += 4)Fu[_] = e.getUint32(n), Lu[_] = e.getUint32(n += 4);
            for(let _ = 16; _ < 80; _++){
                const A = Fu[_ - 15] | 0, P = Lu[_ - 15] | 0, U = dh(A, P, 1) ^ dh(A, P, 8) ^ tM(A, P, 7), K = fh(A, P, 1) ^ fh(A, P, 8) ^ nM(A, P, 7), X = Fu[_ - 2] | 0, G = Lu[_ - 2] | 0, ce = dh(X, G, 19) ^ Ew(X, G, 61) ^ tM(X, G, 6), ie = fh(X, G, 19) ^ Iw(X, G, 61) ^ nM(X, G, 6), Y = Bne(K, ie, Lu[_ - 7], Lu[_ - 16]), M = Fne(Y, U, ce, Fu[_ - 7], Fu[_ - 16]);
                Fu[_] = M | 0, Lu[_] = Y | 0;
            }
            let { Ah: r, Al: s, Bh: i, Bl: o, Ch: a, Cl: c, Dh: l, Dl: u, Eh: d, El: f, Fh: p, Fl: h, Gh: m, Gl: w, Hh: v, Hl: k } = this;
            for(let _ = 0; _ < 80; _++){
                const A = dh(d, f, 14) ^ dh(d, f, 18) ^ Ew(d, f, 41), P = fh(d, f, 14) ^ fh(d, f, 18) ^ Iw(d, f, 41), U = d & p ^ ~d & m, K = f & h ^ ~f & w, X = Lne(k, P, K, Wne[_], Lu[_]), G = zne(X, v, A, U, qne[_], Fu[_]), ce = X | 0, ie = dh(r, s, 28) ^ Ew(r, s, 34) ^ Ew(r, s, 39), Y = fh(r, s, 28) ^ Iw(r, s, 34) ^ Iw(r, s, 39), M = r & i ^ r & a ^ i & a, g = s & o ^ s & c ^ o & c;
                v = m | 0, k = w | 0, m = p | 0, w = h | 0, p = d | 0, h = f | 0, { h: d, l: f } = al(l | 0, u | 0, G | 0, ce | 0), l = a | 0, u = c | 0, a = i | 0, c = o | 0, i = r | 0, o = s | 0;
                const y = Vne(ce, Y, g);
                r = Dne(y, G, ie, M), s = y | 0;
            }
            ({ h: r, l: s } = al(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = al(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: c } = al(this.Ch | 0, this.Cl | 0, a | 0, c | 0), { h: l, l: u } = al(this.Dh | 0, this.Dl | 0, l | 0, u | 0), { h: d, l: f } = al(this.Eh | 0, this.El | 0, d | 0, f | 0), { h: p, l: h } = al(this.Fh | 0, this.Fl | 0, p | 0, h | 0), { h: m, l: w } = al(this.Gh | 0, this.Gl | 0, m | 0, w | 0), { h: v, l: k } = al(this.Hh | 0, this.Hl | 0, v | 0, k | 0), this.set(r, s, i, o, a, c, l, u, d, f, p, h, m, w, v, k);
        }
        roundClean() {
            gd(Fu, Lu);
        }
        destroy() {
            gd(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    }
    class $ne extends Kne {
        Ah = Zs[0] | 0;
        Al = Zs[1] | 0;
        Bh = Zs[2] | 0;
        Bl = Zs[3] | 0;
        Ch = Zs[4] | 0;
        Cl = Zs[5] | 0;
        Dh = Zs[6] | 0;
        Dl = Zs[7] | 0;
        Eh = Zs[8] | 0;
        El = Zs[9] | 0;
        Fh = Zs[10] | 0;
        Fl = Zs[11] | 0;
        Gh = Zs[12] | 0;
        Gl = Zs[13] | 0;
        Hh = Zs[14] | 0;
        Hl = Zs[15] | 0;
        constructor(){
            super(64);
        }
    }
    const MT = PT(()=>new jne, vU(1)), rM = PT(()=>new $ne, vU(3));
    const RT = BigInt(0), q7 = BigInt(1);
    function c2(t, e = "") {
        if (typeof t != "boolean") {
            const n = e && `"${e}" `;
            throw new Error(n + "expected boolean, got type=" + typeof t);
        }
        return t;
    }
    function kU(t) {
        if (typeof t == "bigint") {
            if (!y_(t)) throw new Error("positive bigint expected, got " + t);
        } else ep(t);
        return t;
    }
    function Aw(t) {
        const e = kU(t).toString(16);
        return e.length & 1 ? "0" + e : e;
    }
    function TU(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        return t === "" ? RT : BigInt("0x" + t);
    }
    function Xx(t) {
        return TU($x(t));
    }
    function CU(t) {
        return TU($x(Xne(hr(t)).reverse()));
    }
    function NT(t, e) {
        ep(e), t = kU(t);
        const n = a2(t.toString(16).padStart(e * 2, "0"));
        if (n.length !== e) throw new Error("number too large");
        return n;
    }
    function EU(t, e) {
        return NT(t, e).reverse();
    }
    function Xne(t) {
        return Uint8Array.from(t);
    }
    const y_ = (t)=>typeof t == "bigint" && RT <= t;
    function Gne(t, e, n) {
        return y_(t) && y_(e) && y_(n) && e <= t && t < n;
    }
    function Zne(t, e, n, r) {
        if (!Gne(e, n, r)) throw new Error("expected valid " + t + ": " + n + " <= n < " + r + ", got " + e);
    }
    function Jne(t) {
        let e;
        for(e = 0; t > RT; t >>= q7, e += 1);
        return e;
    }
    const VT = (t)=>(q7 << BigInt(t)) - q7;
    function Yne(t, e, n) {
        if (ep(t, "hashLen"), ep(e, "qByteLen"), typeof n != "function") throw new Error("hmacFn must be a function");
        const r = (w)=>new Uint8Array(w), s = Uint8Array.of(), i = Uint8Array.of(0), o = Uint8Array.of(1), a = 1e3;
        let c = r(t), l = r(t), u = 0;
        const d = ()=>{
            c.fill(1), l.fill(0), u = 0;
        }, f = (...w)=>n(l, Yo(c, ...w)), p = (w = s)=>{
            l = f(i, w), c = f(), w.length !== 0 && (l = f(o, w), c = f());
        }, h = ()=>{
            if (u++ >= a) throw new Error("drbg: tried max amount of iterations");
            let w = 0;
            const v = [];
            for(; w < e;){
                c = f();
                const k = c.slice();
                v.push(k), w += c.length;
            }
            return Yo(...v);
        };
        return (w, v)=>{
            d(), p(w);
            let k;
            for(; !(k = v(h()));)p();
            return d(), k;
        };
    }
    function DT(t, e = {}, n = {}) {
        if (!t || typeof t != "object") throw new Error("expected valid options object");
        function r(i, o, a) {
            const c = t[i];
            if (a && c === void 0) return;
            const l = typeof c;
            if (l !== o || c === null) throw new Error(`param "${i}" is invalid: expected ${o}, got ${l}`);
        }
        const s = (i, o)=>Object.entries(i).forEach(([a, c])=>r(a, c, o));
        s(e, !1), s(n, !0);
    }
    function sM(t) {
        const e = new WeakMap;
        return (n, ...r)=>{
            const s = e.get(n);
            if (s !== void 0) return s;
            const i = t(n, ...r);
            return e.set(n, i), i;
        };
    }
    const Ki = BigInt(0), vi = BigInt(1), Af = BigInt(2), IU = BigInt(3), AU = BigInt(4), PU = BigInt(5), Qne = BigInt(7), OU = BigInt(8), ere = BigInt(9), MU = BigInt(16);
    function Ia(t, e) {
        const n = t % e;
        return n >= Ki ? n : e + n;
    }
    function Do(t, e, n) {
        let r = t;
        for(; e-- > Ki;)r *= r, r %= n;
        return r;
    }
    function iM(t, e) {
        if (t === Ki) throw new Error("invert: expected non-zero number");
        if (e <= Ki) throw new Error("invert: expected positive modulus, got " + e);
        let n = Ia(t, e), r = e, s = Ki, i = vi;
        for(; n !== Ki;){
            const a = r / n, c = r % n, l = s - i * a;
            r = n, n = c, s = i, i = l;
        }
        if (r !== vi) throw new Error("invert: does not exist");
        return Ia(s, e);
    }
    function BT(t, e, n) {
        if (!t.eql(t.sqr(e), n)) throw new Error("Cannot find square root");
    }
    function RU(t, e) {
        const n = (t.ORDER + vi) / AU, r = t.pow(e, n);
        return BT(t, r, e), r;
    }
    function tre(t, e) {
        const n = (t.ORDER - PU) / OU, r = t.mul(e, Af), s = t.pow(r, n), i = t.mul(e, s), o = t.mul(t.mul(i, Af), s), a = t.mul(i, t.sub(o, t.ONE));
        return BT(t, a, e), a;
    }
    function nre(t) {
        const e = Gx(t), n = NU(t), r = n(e, e.neg(e.ONE)), s = n(e, r), i = n(e, e.neg(r)), o = (t + Qne) / MU;
        return (a, c)=>{
            let l = a.pow(c, o), u = a.mul(l, r);
            const d = a.mul(l, s), f = a.mul(l, i), p = a.eql(a.sqr(u), c), h = a.eql(a.sqr(d), c);
            l = a.cmov(l, u, p), u = a.cmov(f, d, h);
            const m = a.eql(a.sqr(u), c), w = a.cmov(l, u, m);
            return BT(a, w, c), w;
        };
    }
    function NU(t) {
        if (t < IU) throw new Error("sqrt is not defined for small field");
        let e = t - vi, n = 0;
        for(; e % Af === Ki;)e /= Af, n++;
        let r = Af;
        const s = Gx(t);
        for(; oM(s, r) === 1;)if (r++ > 1e3) throw new Error("Cannot find square root: probably non-prime P");
        if (n === 1) return RU;
        let i = s.pow(r, e);
        const o = (e + vi) / Af;
        return function(c, l) {
            if (c.is0(l)) return l;
            if (oM(c, l) !== 1) throw new Error("Cannot find square root");
            let u = n, d = c.mul(c.ONE, i), f = c.pow(l, e), p = c.pow(l, o);
            for(; !c.eql(f, c.ONE);){
                if (c.is0(f)) return c.ZERO;
                let h = 1, m = c.sqr(f);
                for(; !c.eql(m, c.ONE);)if (h++, m = c.sqr(m), h === u) throw new Error("Cannot find square root");
                const w = vi << BigInt(u - h - 1), v = c.pow(d, w);
                u = h, d = c.sqr(v), f = c.mul(f, d), p = c.mul(p, v);
            }
            return p;
        };
    }
    function rre(t) {
        return t % AU === IU ? RU : t % OU === PU ? tre : t % MU === ere ? nre(t) : NU(t);
    }
    const sre = [
        "create",
        "isValid",
        "is0",
        "neg",
        "inv",
        "sqrt",
        "sqr",
        "eql",
        "add",
        "sub",
        "mul",
        "pow",
        "div",
        "addN",
        "subN",
        "mulN",
        "sqrN"
    ];
    function ire(t) {
        const e = {
            ORDER: "bigint",
            BYTES: "number",
            BITS: "number"
        }, n = sre.reduce((r, s)=>(r[s] = "function", r), e);
        return DT(t, n), t;
    }
    function ore(t, e, n) {
        if (n < Ki) throw new Error("invalid exponent, negatives unsupported");
        if (n === Ki) return t.ONE;
        if (n === vi) return e;
        let r = t.ONE, s = e;
        for(; n > Ki;)n & vi && (r = t.mul(r, s)), s = t.sqr(s), n >>= vi;
        return r;
    }
    function VU(t, e, n = !1) {
        const r = new Array(e.length).fill(n ? t.ZERO : void 0), s = e.reduce((o, a, c)=>t.is0(a) ? o : (r[c] = o, t.mul(o, a)), t.ONE), i = t.inv(s);
        return e.reduceRight((o, a, c)=>t.is0(a) ? o : (r[c] = t.mul(o, r[c]), t.mul(o, a)), i), r;
    }
    function oM(t, e) {
        const n = (t.ORDER - vi) / Af, r = t.pow(e, n), s = t.eql(r, t.ONE), i = t.eql(r, t.ZERO), o = t.eql(r, t.neg(t.ONE));
        if (!s && !i && !o) throw new Error("invalid Legendre symbol result");
        return s ? 1 : i ? 0 : -1;
    }
    function are(t, e) {
        e !== void 0 && ep(e);
        const n = e !== void 0 ? e : t.toString(2).length, r = Math.ceil(n / 8);
        return {
            nBitLength: n,
            nByteLength: r
        };
    }
    class cre {
        ORDER;
        BITS;
        BYTES;
        isLE;
        ZERO = Ki;
        ONE = vi;
        _lengths;
        _sqrt;
        _mod;
        constructor(e, n = {}){
            if (e <= Ki) throw new Error("invalid field: expected ORDER > 0, got " + e);
            let r;
            this.isLE = !1, n != null && typeof n == "object" && (typeof n.BITS == "number" && (r = n.BITS), typeof n.sqrt == "function" && (this.sqrt = n.sqrt), typeof n.isLE == "boolean" && (this.isLE = n.isLE), n.allowedLengths && (this._lengths = n.allowedLengths?.slice()), typeof n.modFromBytes == "boolean" && (this._mod = n.modFromBytes));
            const { nBitLength: s, nByteLength: i } = are(e, r);
            if (i > 2048) throw new Error("invalid field: expected ORDER of <= 2048 bytes");
            this.ORDER = e, this.BITS = s, this.BYTES = i, this._sqrt = void 0, Object.preventExtensions(this);
        }
        create(e) {
            return Ia(e, this.ORDER);
        }
        isValid(e) {
            if (typeof e != "bigint") throw new Error("invalid field element: expected bigint, got " + typeof e);
            return Ki <= e && e < this.ORDER;
        }
        is0(e) {
            return e === Ki;
        }
        isValidNot0(e) {
            return !this.is0(e) && this.isValid(e);
        }
        isOdd(e) {
            return (e & vi) === vi;
        }
        neg(e) {
            return Ia(-e, this.ORDER);
        }
        eql(e, n) {
            return e === n;
        }
        sqr(e) {
            return Ia(e * e, this.ORDER);
        }
        add(e, n) {
            return Ia(e + n, this.ORDER);
        }
        sub(e, n) {
            return Ia(e - n, this.ORDER);
        }
        mul(e, n) {
            return Ia(e * n, this.ORDER);
        }
        pow(e, n) {
            return ore(this, e, n);
        }
        div(e, n) {
            return Ia(e * iM(n, this.ORDER), this.ORDER);
        }
        sqrN(e) {
            return e * e;
        }
        addN(e, n) {
            return e + n;
        }
        subN(e, n) {
            return e - n;
        }
        mulN(e, n) {
            return e * n;
        }
        inv(e) {
            return iM(e, this.ORDER);
        }
        sqrt(e) {
            return this._sqrt || (this._sqrt = rre(this.ORDER)), this._sqrt(this, e);
        }
        toBytes(e) {
            return this.isLE ? EU(e, this.BYTES) : NT(e, this.BYTES);
        }
        fromBytes(e, n = !1) {
            hr(e);
            const { _lengths: r, BYTES: s, isLE: i, ORDER: o, _mod: a } = this;
            if (r) {
                if (!r.includes(e.length) || e.length > s) throw new Error("Field.fromBytes: expected " + r + " bytes, got " + e.length);
                const l = new Uint8Array(s);
                l.set(e, i ? 0 : l.length - e.length), e = l;
            }
            if (e.length !== s) throw new Error("Field.fromBytes: expected " + s + " bytes, got " + e.length);
            let c = i ? CU(e) : Xx(e);
            if (a && (c = Ia(c, o)), !n && !this.isValid(c)) throw new Error("invalid field element: outside of range 0..ORDER");
            return c;
        }
        invertBatch(e) {
            return VU(this, e);
        }
        cmov(e, n, r) {
            return r ? n : e;
        }
    }
    function Gx(t, e = {}) {
        return new cre(t, e);
    }
    function DU(t) {
        if (typeof t != "bigint") throw new Error("field order must be bigint");
        const e = t.toString(2).length;
        return Math.ceil(e / 8);
    }
    function BU(t) {
        const e = DU(t);
        return e + Math.ceil(e / 2);
    }
    function lre(t, e, n = !1) {
        hr(t);
        const r = t.length, s = DU(e), i = BU(e);
        if (r < 16 || r < i || r > 1024) throw new Error("expected " + i + "-1024 bytes of input, got " + r);
        const o = n ? CU(t) : Xx(t), a = Ia(o, e - vi) + vi;
        return n ? EU(a, s) : NT(a, s);
    }
    const s0 = BigInt(0), Pf = BigInt(1);
    function l2(t, e) {
        const n = e.negate();
        return t ? n : e;
    }
    function aM(t, e) {
        const n = VU(t.Fp, e.map((r)=>r.Z));
        return e.map((r, s)=>t.fromAffine(r.toAffine(n[s])));
    }
    function FU(t, e) {
        if (!Number.isSafeInteger(t) || t <= 0 || t > e) throw new Error("invalid window size, expected [1.." + e + "], got W=" + t);
    }
    function o5(t, e) {
        FU(t, e);
        const n = Math.ceil(e / t) + 1, r = 2 ** (t - 1), s = 2 ** t, i = VT(t), o = BigInt(t);
        return {
            windows: n,
            windowSize: r,
            mask: i,
            maxNumber: s,
            shiftBy: o
        };
    }
    function cM(t, e, n) {
        const { windowSize: r, mask: s, maxNumber: i, shiftBy: o } = n;
        let a = Number(t & s), c = t >> o;
        a > r && (a -= i, c += Pf);
        const l = e * r, u = l + Math.abs(a) - 1, d = a === 0, f = a < 0, p = e % 2 !== 0;
        return {
            nextN: c,
            offset: u,
            isZero: d,
            isNeg: f,
            isNegF: p,
            offsetF: l
        };
    }
    const a5 = new WeakMap, LU = new WeakMap;
    function c5(t) {
        return LU.get(t) || 1;
    }
    function lM(t) {
        if (t !== s0) throw new Error("invalid wNAF");
    }
    class ure {
        BASE;
        ZERO;
        Fn;
        bits;
        constructor(e, n){
            this.BASE = e.BASE, this.ZERO = e.ZERO, this.Fn = e.Fn, this.bits = n;
        }
        _unsafeLadder(e, n, r = this.ZERO) {
            let s = e;
            for(; n > s0;)n & Pf && (r = r.add(s)), s = s.double(), n >>= Pf;
            return r;
        }
        precomputeWindow(e, n) {
            const { windows: r, windowSize: s } = o5(n, this.bits), i = [];
            let o = e, a = o;
            for(let c = 0; c < r; c++){
                a = o, i.push(a);
                for(let l = 1; l < s; l++)a = a.add(o), i.push(a);
                o = a.double();
            }
            return i;
        }
        wNAF(e, n, r) {
            if (!this.Fn.isValid(r)) throw new Error("invalid scalar");
            let s = this.ZERO, i = this.BASE;
            const o = o5(e, this.bits);
            for(let a = 0; a < o.windows; a++){
                const { nextN: c, offset: l, isZero: u, isNeg: d, isNegF: f, offsetF: p } = cM(r, a, o);
                r = c, u ? i = i.add(l2(f, n[p])) : s = s.add(l2(d, n[l]));
            }
            return lM(r), {
                p: s,
                f: i
            };
        }
        wNAFUnsafe(e, n, r, s = this.ZERO) {
            const i = o5(e, this.bits);
            for(let o = 0; o < i.windows && r !== s0; o++){
                const { nextN: a, offset: c, isZero: l, isNeg: u } = cM(r, o, i);
                if (r = a, !l) {
                    const d = n[c];
                    s = s.add(u ? d.negate() : d);
                }
            }
            return lM(r), s;
        }
        getPrecomputes(e, n, r) {
            let s = a5.get(n);
            return s || (s = this.precomputeWindow(n, e), e !== 1 && (typeof r == "function" && (s = r(s)), a5.set(n, s))), s;
        }
        cached(e, n, r) {
            const s = c5(e);
            return this.wNAF(s, this.getPrecomputes(s, e, r), n);
        }
        unsafe(e, n, r, s) {
            const i = c5(e);
            return i === 1 ? this._unsafeLadder(e, n, s) : this.wNAFUnsafe(i, this.getPrecomputes(i, e, r), n, s);
        }
        createCache(e, n) {
            FU(n, this.bits), LU.set(e, n), a5.delete(e);
        }
        hasCache(e) {
            return c5(e) !== 1;
        }
    }
    function dre(t, e, n, r) {
        let s = e, i = t.ZERO, o = t.ZERO;
        for(; n > s0 || r > s0;)n & Pf && (i = i.add(s)), r & Pf && (o = o.add(s)), s = s.double(), n >>= Pf, r >>= Pf;
        return {
            p1: i,
            p2: o
        };
    }
    function uM(t, e, n) {
        if (e) {
            if (e.ORDER !== t) throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
            return ire(e), e;
        } else return Gx(t, {
            isLE: n
        });
    }
    function fre(t, e, n = {}, r) {
        if (r === void 0 && (r = t === "edwards"), !e || typeof e != "object") throw new Error(`expected valid ${t} CURVE object`);
        for (const c of [
            "p",
            "n",
            "h"
        ]){
            const l = e[c];
            if (!(typeof l == "bigint" && l > s0)) throw new Error(`CURVE.${c} must be positive bigint`);
        }
        const s = uM(e.p, n.Fp, r), i = uM(e.n, n.Fn, r), a = [
            "Gx",
            "Gy",
            "a",
            "b"
        ];
        for (const c of a)if (!s.isValid(e[c])) throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);
        return e = Object.freeze(Object.assign({}, e)), {
            CURVE: e,
            Fp: s,
            Fn: i
        };
    }
    function pre(t, e) {
        return function(r) {
            const s = t(r);
            return {
                secretKey: s,
                publicKey: e(s)
            };
        };
    }
    class zU {
        oHash;
        iHash;
        blockLen;
        outputLen;
        finished = !1;
        destroyed = !1;
        constructor(e, n){
            if (wU(e), hr(n, void 0, "key"), this.iHash = e.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 r = this.blockLen, s = new Uint8Array(r);
            s.set(n.length > r ? e.create().update(n).digest() : n);
            for(let i = 0; i < s.length; i++)s[i] ^= 54;
            this.iHash.update(s), this.oHash = e.create();
            for(let i = 0; i < s.length; i++)s[i] ^= 106;
            this.oHash.update(s), gd(s);
        }
        update(e) {
            return o2(this), this.iHash.update(e), this;
        }
        digestInto(e) {
            o2(this), hr(e, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
        }
        digest() {
            const e = new Uint8Array(this.oHash.outputLen);
            return this.digestInto(e), e;
        }
        _cloneInto(e) {
            e ||= Object.create(Object.getPrototypeOf(this), {});
            const { oHash: n, iHash: r, finished: s, destroyed: i, blockLen: o, outputLen: a } = this;
            return e = e, e.finished = s, e.destroyed = i, e.blockLen = o, e.outputLen = a, e.oHash = n._cloneInto(e.oHash), e.iHash = r._cloneInto(e.iHash), e;
        }
        clone() {
            return this._cloneInto();
        }
        destroy() {
            this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
        }
    }
    const u2 = (t, e, n)=>new zU(t, e).update(n).digest();
    u2.create = (t, e)=>new zU(t, e);
    const dM = (t, e)=>(t + (t >= 0 ? e : -e) / UU) / e;
    function hre(t, e, n) {
        const [[r, s], [i, o]] = e, a = dM(o * t, n), c = dM(-s * t, n);
        let l = t - a * r - c * i, u = -a * s - c * o;
        const d = l < Al, f = u < Al;
        d && (l = -l), f && (u = -u);
        const p = VT(Math.ceil(Jne(n) / 2)) + qh;
        if (l < Al || l >= p || u < Al || u >= p) throw new Error("splitScalar (endomorphism): failed, k=" + t);
        return {
            k1neg: d,
            k1: l,
            k2neg: f,
            k2: u
        };
    }
    function W7(t) {
        if (![
            "compact",
            "recovered",
            "der"
        ].includes(t)) throw new Error('Signature format must be "compact", "recovered", or "der"');
        return t;
    }
    function l5(t, e) {
        const n = {};
        for (let r of Object.keys(e))n[r] = t[r] === void 0 ? e[r] : t[r];
        return c2(n.lowS, "lowS"), c2(n.prehash, "prehash"), n.format !== void 0 && W7(n.format), n;
    }
    let gre = class extends Error {
        constructor(e = ""){
            super(e);
        }
    };
    const Xu = {
        Err: gre,
        _tlv: {
            encode: (t, e)=>{
                const { Err: n } = Xu;
                if (t < 0 || t > 256) throw new n("tlv.encode: wrong tag");
                if (e.length & 1) throw new n("tlv.encode: unpadded data");
                const r = e.length / 2, s = Aw(r);
                if (s.length / 2 & 128) throw new n("tlv.encode: long form length too big");
                const i = r > 127 ? Aw(s.length / 2 | 128) : "";
                return Aw(t) + i + s + e;
            },
            decode (t, e) {
                const { Err: n } = Xu;
                let r = 0;
                if (t < 0 || t > 256) throw new n("tlv.encode: wrong tag");
                if (e.length < 2 || e[r++] !== t) throw new n("tlv.decode: wrong tlv");
                const s = e[r++], i = !!(s & 128);
                let o = 0;
                if (!i) o = s;
                else {
                    const c = s & 127;
                    if (!c) throw new n("tlv.decode(long): indefinite length not supported");
                    if (c > 4) throw new n("tlv.decode(long): byte length is too big");
                    const l = e.subarray(r, r + c);
                    if (l.length !== c) throw new n("tlv.decode: length bytes not complete");
                    if (l[0] === 0) throw new n("tlv.decode(long): zero leftmost byte");
                    for (const u of l)o = o << 8 | u;
                    if (r += c, o < 128) throw new n("tlv.decode(long): not minimal encoding");
                }
                const a = e.subarray(r, r + o);
                if (a.length !== o) throw new n("tlv.decode: wrong value length");
                return {
                    v: a,
                    l: e.subarray(r + o)
                };
            }
        },
        _int: {
            encode (t) {
                const { Err: e } = Xu;
                if (t < Al) throw new e("integer: negative integers are not allowed");
                let n = Aw(t);
                if (Number.parseInt(n[0], 16) & 8 && (n = "00" + n), n.length & 1) throw new e("unexpected DER parsing assertion: unpadded hex");
                return n;
            },
            decode (t) {
                const { Err: e } = Xu;
                if (t[0] & 128) throw new e("invalid signature integer: negative");
                if (t[0] === 0 && !(t[1] & 128)) throw new e("invalid signature integer: unnecessary leading zero");
                return Xx(t);
            }
        },
        toSig (t) {
            const { Err: e, _int: n, _tlv: r } = Xu, s = hr(t, void 0, "signature"), { v: i, l: o } = r.decode(48, s);
            if (o.length) throw new e("invalid signature: left bytes after parsing");
            const { v: a, l: c } = r.decode(2, i), { v: l, l: u } = r.decode(2, c);
            if (u.length) throw new e("invalid signature: left bytes after parsing");
            return {
                r: n.decode(a),
                s: n.decode(l)
            };
        },
        hexFromSig (t) {
            const { _tlv: e, _int: n } = Xu, r = e.encode(2, n.encode(t.r)), s = e.encode(2, n.encode(t.s)), i = r + s;
            return e.encode(48, i);
        }
    }, Al = BigInt(0), qh = BigInt(1), UU = BigInt(2), Pw = BigInt(3), bre = BigInt(4);
    function mre(t, e = {}) {
        const n = fre("weierstrass", t, e), { Fp: r, Fn: s } = n;
        let i = n.CURVE;
        const { h: o, n: a } = i;
        DT(e, {}, {
            allowInfinityPoint: "boolean",
            clearCofactor: "function",
            isTorsionFree: "function",
            fromBytes: "function",
            toBytes: "function",
            endo: "object"
        });
        const { endo: c } = e;
        if (c && (!r.is0(i.a) || typeof c.beta != "bigint" || !Array.isArray(c.basises))) throw new Error('invalid endo: expected "beta": bigint and "basises": array');
        const l = jU(r, s);
        function u() {
            if (!r.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
        }
        function d(Y, M, g) {
            const { x: y, y: C } = M.toAffine(), R = r.toBytes(y);
            if (c2(g, "isCompressed"), g) {
                u();
                const N = !r.isOdd(C);
                return Yo(HU(N), R);
            } else return Yo(Uint8Array.of(4), R, r.toBytes(C));
        }
        function f(Y) {
            hr(Y, void 0, "Point");
            const { publicKey: M, publicKeyUncompressed: g } = l, y = Y.length, C = Y[0], R = Y.subarray(1);
            if (y === M && (C === 2 || C === 3)) {
                const N = r.fromBytes(R);
                if (!r.isValid(N)) throw new Error("bad point: is not on curve, wrong x");
                const L = m(N);
                let z;
                try {
                    z = r.sqrt(L);
                } catch (O) {
                    const q = O instanceof Error ? ": " + O.message : "";
                    throw new Error("bad point: is not on curve, sqrt error" + q);
                }
                u();
                const B = r.isOdd(z);
                return (C & 1) === 1 !== B && (z = r.neg(z)), {
                    x: N,
                    y: z
                };
            } else if (y === g && C === 4) {
                const N = r.BYTES, L = r.fromBytes(R.subarray(0, N)), z = r.fromBytes(R.subarray(N, N * 2));
                if (!w(L, z)) throw new Error("bad point: is not on curve");
                return {
                    x: L,
                    y: z
                };
            } else throw new Error(`bad point: got length ${y}, expected compressed=${M} or uncompressed=${g}`);
        }
        const p = e.toBytes || d, h = e.fromBytes || f;
        function m(Y) {
            const M = r.sqr(Y), g = r.mul(M, Y);
            return r.add(r.add(g, r.mul(Y, i.a)), i.b);
        }
        function w(Y, M) {
            const g = r.sqr(M), y = m(Y);
            return r.eql(g, y);
        }
        if (!w(i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
        const v = r.mul(r.pow(i.a, Pw), bre), k = r.mul(r.sqr(i.b), BigInt(27));
        if (r.is0(r.add(v, k))) throw new Error("bad curve params: a or b");
        function _(Y, M, g = !1) {
            if (!r.isValid(M) || g && r.is0(M)) throw new Error(`bad point coordinate ${Y}`);
            return M;
        }
        function A(Y) {
            if (!(Y instanceof G)) throw new Error("Weierstrass Point expected");
        }
        function P(Y) {
            if (!c || !c.basises) throw new Error("no endo");
            return hre(Y, c.basises, s.ORDER);
        }
        const U = sM((Y, M)=>{
            const { X: g, Y: y, Z: C } = Y;
            if (r.eql(C, r.ONE)) return {
                x: g,
                y
            };
            const R = Y.is0();
            M == null && (M = R ? r.ONE : r.inv(C));
            const N = r.mul(g, M), L = r.mul(y, M), z = r.mul(C, M);
            if (R) return {
                x: r.ZERO,
                y: r.ZERO
            };
            if (!r.eql(z, r.ONE)) throw new Error("invZ was invalid");
            return {
                x: N,
                y: L
            };
        }), K = sM((Y)=>{
            if (Y.is0()) {
                if (e.allowInfinityPoint && !r.is0(Y.Y)) return;
                throw new Error("bad point: ZERO");
            }
            const { x: M, y: g } = Y.toAffine();
            if (!r.isValid(M) || !r.isValid(g)) throw new Error("bad point: x or y not field elements");
            if (!w(M, g)) throw new Error("bad point: equation left != right");
            if (!Y.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
            return !0;
        });
        function X(Y, M, g, y, C) {
            return g = new G(r.mul(g.X, Y), g.Y, g.Z), M = l2(y, M), g = l2(C, g), M.add(g);
        }
        class G {
            static BASE = new G(i.Gx, i.Gy, r.ONE);
            static ZERO = new G(r.ZERO, r.ONE, r.ZERO);
            static Fp = r;
            static Fn = s;
            X;
            Y;
            Z;
            constructor(M, g, y){
                this.X = _("x", M), this.Y = _("y", g, !0), this.Z = _("z", y), Object.freeze(this);
            }
            static CURVE() {
                return i;
            }
            static fromAffine(M) {
                const { x: g, y } = M || {};
                if (!M || !r.isValid(g) || !r.isValid(y)) throw new Error("invalid affine point");
                if (M instanceof G) throw new Error("projective point not allowed");
                return r.is0(g) && r.is0(y) ? G.ZERO : new G(g, y, r.ONE);
            }
            static fromBytes(M) {
                const g = G.fromAffine(h(hr(M, void 0, "point")));
                return g.assertValidity(), g;
            }
            static fromHex(M) {
                return G.fromBytes(a2(M));
            }
            get x() {
                return this.toAffine().x;
            }
            get y() {
                return this.toAffine().y;
            }
            precompute(M = 8, g = !0) {
                return ie.createCache(this, M), g || this.multiply(Pw), this;
            }
            assertValidity() {
                K(this);
            }
            hasEvenY() {
                const { y: M } = this.toAffine();
                if (!r.isOdd) throw new Error("Field doesn't support isOdd");
                return !r.isOdd(M);
            }
            equals(M) {
                A(M);
                const { X: g, Y: y, Z: C } = this, { X: R, Y: N, Z: L } = M, z = r.eql(r.mul(g, L), r.mul(R, C)), B = r.eql(r.mul(y, L), r.mul(N, C));
                return z && B;
            }
            negate() {
                return new G(this.X, r.neg(this.Y), this.Z);
            }
            double() {
                const { a: M, b: g } = i, y = r.mul(g, Pw), { X: C, Y: R, Z: N } = this;
                let L = r.ZERO, z = r.ZERO, B = r.ZERO, x = r.mul(C, C), O = r.mul(R, R), q = r.mul(N, N), H = r.mul(C, R);
                return H = r.add(H, H), B = r.mul(C, N), B = r.add(B, B), L = r.mul(M, B), z = r.mul(y, q), z = r.add(L, z), L = r.sub(O, z), z = r.add(O, z), z = r.mul(L, z), L = r.mul(H, L), B = r.mul(y, B), q = r.mul(M, q), H = r.sub(x, q), H = r.mul(M, H), H = r.add(H, B), B = r.add(x, x), x = r.add(B, x), x = r.add(x, q), x = r.mul(x, H), z = r.add(z, x), q = r.mul(R, N), q = r.add(q, q), x = r.mul(q, H), L = r.sub(L, x), B = r.mul(q, O), B = r.add(B, B), B = r.add(B, B), new G(L, z, B);
            }
            add(M) {
                A(M);
                const { X: g, Y: y, Z: C } = this, { X: R, Y: N, Z: L } = M;
                let z = r.ZERO, B = r.ZERO, x = r.ZERO;
                const O = i.a, q = r.mul(i.b, Pw);
                let H = r.mul(g, R), Z = r.mul(y, N), te = r.mul(C, L), J = r.add(g, y), se = r.add(R, N);
                J = r.mul(J, se), se = r.add(H, Z), J = r.sub(J, se), se = r.add(g, C);
                let fe = r.add(R, L);
                return se = r.mul(se, fe), fe = r.add(H, te), se = r.sub(se, fe), fe = r.add(y, C), z = r.add(N, L), fe = r.mul(fe, z), z = r.add(Z, te), fe = r.sub(fe, z), x = r.mul(O, se), z = r.mul(q, te), x = r.add(z, x), z = r.sub(Z, x), x = r.add(Z, x), B = r.mul(z, x), Z = r.add(H, H), Z = r.add(Z, H), te = r.mul(O, te), se = r.mul(q, se), Z = r.add(Z, te), te = r.sub(H, te), te = r.mul(O, te), se = r.add(se, te), H = r.mul(Z, se), B = r.add(B, H), H = r.mul(fe, se), z = r.mul(J, z), z = r.sub(z, H), H = r.mul(J, Z), x = r.mul(fe, x), x = r.add(x, H), new G(z, B, x);
            }
            subtract(M) {
                return this.add(M.negate());
            }
            is0() {
                return this.equals(G.ZERO);
            }
            multiply(M) {
                const { endo: g } = e;
                if (!s.isValidNot0(M)) throw new Error("invalid scalar: out of range");
                let y, C;
                const R = (N)=>ie.cached(this, N, (L)=>aM(G, L));
                if (g) {
                    const { k1neg: N, k1: L, k2neg: z, k2: B } = P(M), { p: x, f: O } = R(L), { p: q, f: H } = R(B);
                    C = O.add(H), y = X(g.beta, x, q, N, z);
                } else {
                    const { p: N, f: L } = R(M);
                    y = N, C = L;
                }
                return aM(G, [
                    y,
                    C
                ])[0];
            }
            multiplyUnsafe(M) {
                const { endo: g } = e, y = this;
                if (!s.isValid(M)) throw new Error("invalid scalar: out of range");
                if (M === Al || y.is0()) return G.ZERO;
                if (M === qh) return y;
                if (ie.hasCache(this)) return this.multiply(M);
                if (g) {
                    const { k1neg: C, k1: R, k2neg: N, k2: L } = P(M), { p1: z, p2: B } = dre(G, y, R, L);
                    return X(g.beta, z, B, C, N);
                } else return ie.unsafe(y, M);
            }
            toAffine(M) {
                return U(this, M);
            }
            isTorsionFree() {
                const { isTorsionFree: M } = e;
                return o === qh ? !0 : M ? M(G, this) : ie.unsafe(this, a).is0();
            }
            clearCofactor() {
                const { clearCofactor: M } = e;
                return o === qh ? this : M ? M(G, this) : this.multiplyUnsafe(o);
            }
            isSmallOrder() {
                return this.multiplyUnsafe(o).is0();
            }
            toBytes(M = !0) {
                return c2(M, "isCompressed"), this.assertValidity(), p(G, this, M);
            }
            toHex(M = !0) {
                return $x(this.toBytes(M));
            }
            toString() {
                return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
            }
        }
        const ce = s.BITS, ie = new ure(G, e.endo ? Math.ceil(ce / 2) : ce);
        return G.BASE.precompute(8), G;
    }
    function HU(t) {
        return Uint8Array.of(t ? 2 : 3);
    }
    function jU(t, e) {
        return {
            secretKey: e.BYTES,
            publicKey: 1 + t.BYTES,
            publicKeyUncompressed: 1 + 2 * t.BYTES,
            publicKeyHasPrefix: !0,
            signature: 2 * e.BYTES
        };
    }
    function yre(t, e = {}) {
        const { Fn: n } = t, r = e.randomBytes || xU, s = Object.assign(jU(t.Fp, n), {
            seed: BU(n.ORDER)
        });
        function i(p) {
            try {
                const h = n.fromBytes(p);
                return n.isValidNot0(h);
            } catch  {
                return !1;
            }
        }
        function o(p, h) {
            const { publicKey: m, publicKeyUncompressed: w } = s;
            try {
                const v = p.length;
                return h === !0 && v !== m || h === !1 && v !== w ? !1 : !!t.fromBytes(p);
            } catch  {
                return !1;
            }
        }
        function a(p = r(s.seed)) {
            return lre(hr(p, s.seed, "seed"), n.ORDER);
        }
        function c(p, h = !0) {
            return t.BASE.multiply(n.fromBytes(p)).toBytes(h);
        }
        function l(p) {
            const { secretKey: h, publicKey: m, publicKeyUncompressed: w } = s;
            if (!AT(p) || "_lengths" in n && n._lengths || h === m) return;
            const v = hr(p, void 0, "key").length;
            return v === m || v === w;
        }
        function u(p, h, m = !0) {
            if (l(p) === !0) throw new Error("first arg must be private key");
            if (l(h) === !1) throw new Error("second arg must be public key");
            const w = n.fromBytes(p);
            return t.fromBytes(h).multiply(w).toBytes(m);
        }
        const d = {
            isValidSecretKey: i,
            isValidPublicKey: o,
            randomSecretKey: a
        }, f = pre(a, c);
        return Object.freeze({
            getPublicKey: c,
            getSharedSecret: u,
            keygen: f,
            Point: t,
            utils: d,
            lengths: s
        });
    }
    function wre(t, e, n = {}) {
        wU(e), DT(n, {}, {
            hmac: "function",
            lowS: "boolean",
            randomBytes: "function",
            bits2int: "function",
            bits2int_modN: "function"
        }), n = Object.assign({}, n);
        const r = n.randomBytes || xU, s = n.hmac || ((g, y)=>u2(e, g, y)), { Fp: i, Fn: o } = t, { ORDER: a, BITS: c } = o, { keygen: l, getPublicKey: u, getSharedSecret: d, utils: f, lengths: p } = yre(t, n), h = {
            prehash: !0,
            lowS: typeof n.lowS == "boolean" ? n.lowS : !0,
            format: "compact",
            extraEntropy: !1
        }, m = a * UU < i.ORDER;
        function w(g) {
            const y = a >> qh;
            return g > y;
        }
        function v(g, y) {
            if (!o.isValidNot0(y)) throw new Error(`invalid signature ${g}: out of range 1..Point.Fn.ORDER`);
            return y;
        }
        function k() {
            if (m) throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
        }
        function _(g, y) {
            W7(y);
            const C = p.signature, R = y === "compact" ? C : y === "recovered" ? C + 1 : void 0;
            return hr(g, R);
        }
        class A {
            r;
            s;
            recovery;
            constructor(y, C, R){
                if (this.r = v("r", y), this.s = v("s", C), R != null) {
                    if (k(), ![
                        0,
                        1,
                        2,
                        3
                    ].includes(R)) throw new Error("invalid recovery id");
                    this.recovery = R;
                }
                Object.freeze(this);
            }
            static fromBytes(y, C = h.format) {
                _(y, C);
                let R;
                if (C === "der") {
                    const { r: B, s: x } = Xu.toSig(hr(y));
                    return new A(B, x);
                }
                C === "recovered" && (R = y[0], C = "compact", y = y.subarray(1));
                const N = p.signature / 2, L = y.subarray(0, N), z = y.subarray(N, N * 2);
                return new A(o.fromBytes(L), o.fromBytes(z), R);
            }
            static fromHex(y, C) {
                return this.fromBytes(a2(y), C);
            }
            assertRecovery() {
                const { recovery: y } = this;
                if (y == null) throw new Error("invalid recovery id: must be present");
                return y;
            }
            addRecoveryBit(y) {
                return new A(this.r, this.s, y);
            }
            recoverPublicKey(y) {
                const { r: C, s: R } = this, N = this.assertRecovery(), L = N === 2 || N === 3 ? C + a : C;
                if (!i.isValid(L)) throw new Error("invalid recovery id: sig.r+curve.n != R.x");
                const z = i.toBytes(L), B = t.fromBytes(Yo(HU((N & 1) === 0), z)), x = o.inv(L), O = U(hr(y, void 0, "msgHash")), q = o.create(-O * x), H = o.create(R * x), Z = t.BASE.multiplyUnsafe(q).add(B.multiplyUnsafe(H));
                if (Z.is0()) throw new Error("invalid recovery: point at infinify");
                return Z.assertValidity(), Z;
            }
            hasHighS() {
                return w(this.s);
            }
            toBytes(y = h.format) {
                if (W7(y), y === "der") return a2(Xu.hexFromSig(this));
                const { r: C, s: R } = this, N = o.toBytes(C), L = o.toBytes(R);
                return y === "recovered" ? (k(), Yo(Uint8Array.of(this.assertRecovery()), N, L)) : Yo(N, L);
            }
            toHex(y) {
                return $x(this.toBytes(y));
            }
        }
        const P = n.bits2int || function(y) {
            if (y.length > 8192) throw new Error("input is too large");
            const C = Xx(y), R = y.length * 8 - c;
            return R > 0 ? C >> BigInt(R) : C;
        }, U = n.bits2int_modN || function(y) {
            return o.create(P(y));
        }, K = VT(c);
        function X(g) {
            return Zne("num < 2^" + c, g, Al, K), o.toBytes(g);
        }
        function G(g, y) {
            return hr(g, void 0, "message"), y ? hr(e(g), void 0, "prehashed message") : g;
        }
        function ce(g, y, C) {
            const { lowS: R, prehash: N, extraEntropy: L } = l5(C, h);
            g = G(g, N);
            const z = U(g), B = o.fromBytes(y);
            if (!o.isValidNot0(B)) throw new Error("invalid private key");
            const x = [
                X(B),
                X(z)
            ];
            if (L != null && L !== !1) {
                const Z = L === !0 ? r(p.secretKey) : L;
                x.push(hr(Z, void 0, "extraEntropy"));
            }
            const O = Yo(...x), q = z;
            function H(Z) {
                const te = P(Z);
                if (!o.isValidNot0(te)) return;
                const J = o.inv(te), se = t.BASE.multiply(te).toAffine(), fe = o.create(se.x);
                if (fe === Al) return;
                const ge = o.create(J * o.create(q + fe * B));
                if (ge === Al) return;
                let Ce = (se.x === fe ? 0 : 2) | Number(se.y & qh), Ue = ge;
                return R && w(ge) && (Ue = o.neg(ge), Ce ^= 1), new A(fe, Ue, m ? void 0 : Ce);
            }
            return {
                seed: O,
                k2sig: H
            };
        }
        function ie(g, y, C = {}) {
            const { seed: R, k2sig: N } = ce(g, y, C);
            return Yne(e.outputLen, o.BYTES, s)(R, N).toBytes(C.format);
        }
        function Y(g, y, C, R = {}) {
            const { lowS: N, prehash: L, format: z } = l5(R, h);
            if (C = hr(C, void 0, "publicKey"), y = G(y, L), !AT(g)) {
                const B = g instanceof A ? ", use sig.toBytes()" : "";
                throw new Error("verify expects Uint8Array signature" + B);
            }
            _(g, z);
            try {
                const B = A.fromBytes(g, z), x = t.fromBytes(C);
                if (N && B.hasHighS()) return !1;
                const { r: O, s: q } = B, H = U(y), Z = o.inv(q), te = o.create(H * Z), J = o.create(O * Z), se = t.BASE.multiplyUnsafe(te).add(x.multiplyUnsafe(J));
                return se.is0() ? !1 : o.create(se.x) === O;
            } catch  {
                return !1;
            }
        }
        function M(g, y, C = {}) {
            const { prehash: R } = l5(C, h);
            return y = G(y, R), A.fromBytes(g, "recovered").recoverPublicKey(y).toBytes();
        }
        return Object.freeze({
            keygen: l,
            getPublicKey: u,
            getSharedSecret: d,
            utils: f,
            lengths: p,
            Point: t,
            sign: ie,
            verify: Y,
            recoverPublicKey: M,
            Signature: A,
            hash: e
        });
    }
    const FT = {
        p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
        n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
        h: BigInt(1),
        a: BigInt(0),
        b: BigInt(7),
        Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
        Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
    }, _re = {
        beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
        basises: [
            [
                BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
                -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")
            ],
            [
                BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
                BigInt("0x3086d221a7d46bcde86c90e49284eb15")
            ]
        ]
    }, fM = BigInt(2);
    function xre(t) {
        const e = FT.p, n = BigInt(3), r = BigInt(6), s = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = t * t * t % e, u = l * l * t % e, d = Do(u, n, e) * u % e, f = Do(d, n, e) * u % e, p = Do(f, fM, e) * l % e, h = Do(p, s, e) * p % e, m = Do(h, i, e) * h % e, w = Do(m, a, e) * m % e, v = Do(w, c, e) * w % e, k = Do(v, a, e) * m % e, _ = Do(k, n, e) * u % e, A = Do(_, o, e) * h % e, P = Do(A, r, e) * l % e, U = Do(P, fM, e);
        if (!K7.eql(K7.sqr(U), t)) throw new Error("Cannot find square root");
        return U;
    }
    const K7 = Gx(FT.p, {
        sqrt: xre
    }), vre = mre(FT, {
        Fp: K7,
        endo: _re
    }), Ah = wre(vre, MT), Sre = Uint8Array.from([
        7,
        4,
        13,
        1,
        10,
        6,
        15,
        3,
        12,
        0,
        9,
        5,
        2,
        14,
        11,
        8
    ]), qU = Uint8Array.from(new Array(16).fill(0).map((t, e)=>e)), kre = qU.map((t)=>(9 * t + 5) % 16), WU = (()=>{
        const n = [
            [
                qU
            ],
            [
                kre
            ]
        ];
        for(let r = 0; r < 4; r++)for (let s of n)s.push(s[r].map((i)=>Sre[i]));
        return n;
    })(), KU = WU[0], $U = WU[1], XU = [
        [
            11,
            14,
            15,
            12,
            5,
            8,
            7,
            9,
            11,
            13,
            14,
            15,
            6,
            7,
            9,
            8
        ],
        [
            12,
            13,
            11,
            15,
            6,
            9,
            9,
            7,
            12,
            15,
            11,
            13,
            7,
            8,
            7,
            7
        ],
        [
            13,
            15,
            14,
            11,
            7,
            7,
            6,
            8,
            13,
            14,
            13,
            12,
            5,
            5,
            6,
            9
        ],
        [
            14,
            11,
            12,
            14,
            8,
            6,
            5,
            5,
            15,
            12,
            15,
            14,
            9,
            9,
            8,
            6
        ],
        [
            15,
            12,
            13,
            13,
            9,
            5,
            8,
            6,
            14,
            11,
            12,
            11,
            8,
            6,
            5,
            5
        ]
    ].map((t)=>Uint8Array.from(t)), Tre = KU.map((t, e)=>t.map((n)=>XU[e][n])), Cre = $U.map((t, e)=>t.map((n)=>XU[e][n])), Ere = Uint32Array.from([
        0,
        1518500249,
        1859775393,
        2400959708,
        2840853838
    ]), Ire = Uint32Array.from([
        1352829926,
        1548603684,
        1836072691,
        2053994217,
        0
    ]);
    function pM(t, e, n, r) {
        return t === 0 ? e ^ n ^ r : t === 1 ? e & n | ~e & r : t === 2 ? (e | ~n) ^ r : t === 3 ? e & r | n & ~r : e ^ (n | ~r);
    }
    const Ow = new Uint32Array(16);
    class Are extends OT {
        h0 = 1732584193;
        h1 = -271733879;
        h2 = -1732584194;
        h3 = 271733878;
        h4 = -1009589776;
        constructor(){
            super(64, 20, 8, !0);
        }
        get() {
            const { h0: e, h1: n, h2: r, h3: s, h4: i } = this;
            return [
                e,
                n,
                r,
                s,
                i
            ];
        }
        set(e, n, r, s, i) {
            this.h0 = e | 0, this.h1 = n | 0, this.h2 = r | 0, this.h3 = s | 0, this.h4 = i | 0;
        }
        process(e, n) {
            for(let p = 0; p < 16; p++, n += 4)Ow[p] = e.getUint32(n, !0);
            let r = this.h0 | 0, s = r, i = this.h1 | 0, o = i, a = this.h2 | 0, c = a, l = this.h3 | 0, u = l, d = this.h4 | 0, f = d;
            for(let p = 0; p < 5; p++){
                const h = 4 - p, m = Ere[p], w = Ire[p], v = KU[p], k = $U[p], _ = Tre[p], A = Cre[p];
                for(let P = 0; P < 16; P++){
                    const U = Tw(r + pM(p, i, a, l) + Ow[v[P]] + m, _[P]) + d | 0;
                    r = d, d = l, l = Tw(a, 10) | 0, a = i, i = U;
                }
                for(let P = 0; P < 16; P++){
                    const U = Tw(s + pM(h, o, c, u) + Ow[k[P]] + w, A[P]) + f | 0;
                    s = f, f = u, u = Tw(c, 10) | 0, c = o, o = U;
                }
            }
            this.set(this.h1 + a + u | 0, this.h2 + l + f | 0, this.h3 + d + s | 0, this.h4 + r + o | 0, this.h0 + i + c | 0);
        }
        roundClean() {
            gd(Ow);
        }
        destroy() {
            this.destroyed = !0, gd(this.buffer), this.set(0, 0, 0, 0, 0);
        }
    }
    const Pre = PT(()=>new Are);
    const $b = Ah.Point, { Fn: mb } = $b, u5 = Nte(MT), Ore = Uint8Array.from("Bitcoin seed".split(""), (t)=>t.charCodeAt(0)), d5 = {
        private: 76066276,
        public: 76067358
    }, f5 = 2147483648, Mre = (t)=>Pre(MT(t)), Rre = (t)=>jh(t).getUint32(0, !1), Mw = (t)=>{
        if (!Number.isSafeInteger(t) || t < 0 || t > 2 ** 32 - 1) throw new Error("invalid number, should be from 0 to 2**32-1, got " + t);
        const e = new Uint8Array(4);
        return jh(e).setUint32(0, t, !1), e;
    };
    class Sf {
        get fingerprint() {
            if (!this.pubHash) throw new Error("No publicKey set!");
            return Rre(this.pubHash);
        }
        get identifier() {
            return this.pubHash;
        }
        get pubKeyHash() {
            return this.pubHash;
        }
        get privateKey() {
            return this._privateKey || null;
        }
        get publicKey() {
            return this._publicKey || null;
        }
        get privateExtendedKey() {
            const e = this._privateKey;
            if (!e) throw new Error("No private key");
            return u5.encode(this.serialize(this.versions.private, Yo(Uint8Array.of(0), e)));
        }
        get publicExtendedKey() {
            if (!this._publicKey) throw new Error("No public key");
            return u5.encode(this.serialize(this.versions.public, this._publicKey));
        }
        static fromMasterSeed(e, n = d5) {
            if (hr(e), 8 * e.length < 128 || 8 * e.length > 512) throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got " + e.length);
            const r = u2(rM, Ore, e), s = r.slice(0, 32), i = r.slice(32);
            return new Sf({
                versions: n,
                chainCode: i,
                privateKey: s
            });
        }
        static fromExtendedKey(e, n = d5) {
            const r = u5.decode(e), s = jh(r), i = s.getUint32(0, !1), o = {
                versions: n,
                depth: r[4],
                parentFingerprint: s.getUint32(5, !1),
                index: s.getUint32(9, !1),
                chainCode: r.slice(13, 45)
            }, a = r.slice(45), c = a[0] === 0;
            if (i !== n[c ? "private" : "public"]) throw new Error("Version mismatch");
            return c ? new Sf({
                ...o,
                privateKey: a.slice(1)
            }) : new Sf({
                ...o,
                publicKey: a
            });
        }
        static fromJSON(e) {
            return Sf.fromExtendedKey(e.xpriv);
        }
        versions;
        depth = 0;
        index = 0;
        chainCode = null;
        parentFingerprint = 0;
        _privateKey;
        _publicKey;
        pubHash;
        constructor(e){
            if (!e || typeof e != "object") throw new Error("HDKey.constructor must not be called directly");
            if (this.versions = e.versions || d5, this.depth = e.depth || 0, this.chainCode = e.chainCode || null, this.index = e.index || 0, this.parentFingerprint = e.parentFingerprint || 0, !this.depth && (this.parentFingerprint || this.index)) throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");
            if (this.depth > 255) throw new Error("HDKey: depth exceeds the serializable value 255");
            if (e.publicKey && e.privateKey) throw new Error("HDKey: publicKey and privateKey at same time.");
            if (e.privateKey) {
                if (!Ah.utils.isValidSecretKey(e.privateKey)) throw new Error("Invalid private key");
                this._privateKey = e.privateKey, this._publicKey = Ah.getPublicKey(e.privateKey, !0);
            } else if (e.publicKey) this._publicKey = $b.fromBytes(e.publicKey).toBytes(!0);
            else throw new Error("HDKey: no public or private key provided");
            this.pubHash = Mre(this._publicKey);
        }
        derive(e) {
            if (!/^[mM]'?/.test(e)) throw new Error('Path must start with "m" or "M"');
            if (/^[mM]'?$/.test(e)) return this;
            const n = e.replace(/^[mM]'?\//, "").split("/");
            let r = this;
            for (const s of n){
                const i = /^(\d+)('?)$/.exec(s), o = i && i[1];
                if (!i || i.length !== 3 || typeof o != "string") throw new Error("invalid child index: " + s);
                let a = +o;
                if (!Number.isSafeInteger(a) || a >= f5) throw new Error("Invalid index");
                i[2] === "'" && (a += f5), r = r.deriveChild(a);
            }
            return r;
        }
        deriveChild(e) {
            if (!this._publicKey || !this.chainCode) throw new Error("No publicKey or chainCode set");
            let n = Mw(e);
            if (e >= f5) {
                const c = this._privateKey;
                if (!c) throw new Error("Could not derive hardened child key");
                n = Yo(Uint8Array.of(0), c, n);
            } else n = Yo(this._publicKey, n);
            const r = u2(rM, this.chainCode, n), s = r.slice(0, 32), i = r.slice(32);
            if (!Ah.utils.isValidSecretKey(s)) throw new Error("Tweak bigger than curve order");
            const o = {
                versions: this.versions,
                chainCode: i,
                depth: this.depth + 1,
                parentFingerprint: this.fingerprint,
                index: e
            }, a = mb.fromBytes(s);
            try {
                if (this._privateKey) {
                    const c = mb.create(mb.fromBytes(this._privateKey) + a);
                    if (!mb.isValidNot0(c)) throw new Error("The tweak was out of range or the resulted private key is invalid");
                    o.privateKey = mb.toBytes(c);
                } else {
                    const c = $b.fromBytes(this._publicKey).add($b.BASE.multiply(a));
                    if (c.equals($b.ZERO)) throw new Error("The tweak was equal to negative P, which made the result key invalid");
                    o.publicKey = c.toBytes(!0);
                }
                return new Sf(o);
            } catch  {
                return this.deriveChild(e + 1);
            }
        }
        sign(e) {
            if (!this._privateKey) throw new Error("No privateKey set!");
            return hr(e, 32), Ah.sign(e, this._privateKey, {
                prehash: !1
            });
        }
        verify(e, n) {
            if (hr(e, 32), hr(n, 64), !this._publicKey) throw new Error("No publicKey set!");
            return Ah.verify(n, e, this._publicKey, {
                prehash: !1
            });
        }
        wipePrivateData() {
            return this._privateKey && (this._privateKey.fill(0), this._privateKey = void 0), this;
        }
        toJSON() {
            return {
                xpriv: this.privateExtendedKey,
                xpub: this.publicExtendedKey
            };
        }
        serialize(e, n) {
            if (!this.chainCode) throw new Error("No chainCode set");
            return hr(n, 33), Yo(Mw(e), new Uint8Array([
                this.depth
            ]), Mw(this.parentFingerprint), Mw(this.index), this.chainCode, n);
        }
    }
    const ph = {
        NightExternal: 0,
        Dust: 2,
        Zswap: 3
    }, Nre = 44, Vre = 2400, Dre = {
        fromResults: (t)=>{
            const { succeededKeys: e, failedRoles: n } = t.reduce((r, s)=>(s.result.type === "keyDerived" ? r.succeededKeys[s.role] = s.result.key : r.failedRoles.push(s.role), r), {
                succeededKeys: {},
                failedRoles: []
            });
            return n.length > 0 ? {
                type: "keyOutOfBounds",
                roles: n
            } : {
                type: "keysDerived",
                keys: e
            };
        }
    };
    class LT {
        rootKey;
        constructor(e){
            this.rootKey = e;
        }
        static fromSeed(e) {
            try {
                const n = Sf.fromMasterSeed(e);
                return {
                    type: "seedOk",
                    hdWallet: new LT(n)
                };
            } catch (n) {
                return {
                    type: "seedError",
                    error: n
                };
            }
        }
        selectAccount(e) {
            return new Bre(this.rootKey, e);
        }
        clear() {
            this.rootKey.wipePrivateData();
        }
    }
    class Bre {
        rootKey;
        account;
        constructor(e, n){
            this.account = n, this.rootKey = e;
        }
        selectRole(e) {
            return new GU(this.rootKey, this.account, e);
        }
        selectRoles(e) {
            return new Fre(this.rootKey, this.account, e);
        }
    }
    class GU {
        rootKey;
        account;
        role;
        constructor(e, n, r){
            this.role = r, this.account = n, this.rootKey = e;
        }
        deriveKeyAt(e) {
            const n = `m/${Nre}'/${Vre}'/${this.account}'/${this.role}/${e}`, r = this.rootKey.derive(n);
            return r.privateKey ? {
                type: "keyDerived",
                key: r.privateKey
            } : {
                type: "keyOutOfBounds"
            };
        }
    }
    class Fre {
        rootKey;
        account;
        roles;
        constructor(e, n, r){
            this.roles = r, this.rootKey = e, this.account = n;
        }
        deriveKeysAt(e) {
            const n = this.roles.map((r)=>({
                    role: r,
                    result: new GU(this.rootKey, this.account, r).deriveKeyAt(e)
                }));
            return Dre.fromResults(n);
        }
    }
    function Lre(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function zre(t, e = "") {
        if (!Number.isSafeInteger(t) || t < 0) {
            const n = e && `"${e}" `;
            throw new Error(`${n}expected integer >= 0, got ${t}`);
        }
    }
    function zT(t, e, n = "") {
        const r = Lre(t), s = t?.length;
        if (!r || e !== void 0) {
            const o = n && `"${n}" `, a = "", c = r ? `length=${s}` : `type=${typeof t}`;
            throw new Error(o + "expected Uint8Array" + a + ", got " + c);
        }
        return t;
    }
    function hM(t, e = !0) {
        if (t.destroyed) throw new Error("Hash instance has been destroyed");
        if (e && t.finished) throw new Error("Hash#digest() has already been called");
    }
    function Ure(t, e) {
        zT(t, void 0, "digestInto() output");
        const n = e.outputLen;
        if (t.length < n) throw new Error('"digestInto() output" expected to be of length >=' + n);
    }
    function $7(...t) {
        for(let e = 0; e < t.length; e++)t[e].fill(0);
    }
    function p5(t) {
        return new DataView(t.buffer, t.byteOffset, t.byteLength);
    }
    function ac(t, e) {
        return t << 32 - e | t >>> e;
    }
    function Hre(t, e = {}) {
        const n = (s, i)=>t(i).update(s).digest(), r = t(void 0);
        return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.create = (s)=>t(s), Object.assign(n, e), Object.freeze(n);
    }
    function jre(t = 32) {
        const e = typeof globalThis == "object" ? globalThis.crypto : null;
        if (typeof e?.getRandomValues != "function") throw new Error("crypto.getRandomValues must be defined");
        return e.getRandomValues(new Uint8Array(t));
    }
    const qre = (t)=>({
            oid: Uint8Array.from([
                6,
                9,
                96,
                134,
                72,
                1,
                101,
                3,
                4,
                2,
                t
            ])
        });
    function Wre(t, e, n) {
        return t & e ^ ~t & n;
    }
    function Kre(t, e, n) {
        return t & e ^ t & n ^ e & n;
    }
    class $re {
        blockLen;
        outputLen;
        padOffset;
        isLE;
        buffer;
        view;
        finished = !1;
        length = 0;
        pos = 0;
        destroyed = !1;
        constructor(e, n, r, s){
            this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = s, this.buffer = new Uint8Array(e), this.view = p5(this.buffer);
        }
        update(e) {
            hM(this), zT(e);
            const { view: n, buffer: r, blockLen: s } = this, i = e.length;
            for(let o = 0; o < i;){
                const a = Math.min(s - this.pos, i - o);
                if (a === s) {
                    const c = p5(e);
                    for(; s <= i - o; o += s)this.process(c, o);
                    continue;
                }
                r.set(e.subarray(o, o + a), this.pos), this.pos += a, o += a, this.pos === s && (this.process(n, 0), this.pos = 0);
            }
            return this.length += e.length, this.roundClean(), this;
        }
        digestInto(e) {
            hM(this), Ure(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, $7(this.buffer.subarray(o)), this.padOffset > s - o && (this.process(r, 0), o = 0);
            for(let d = o; d < s; d++)n[d] = 0;
            r.setBigUint64(s - 8, BigInt(this.length * 8), i), this.process(r, 0);
            const a = p5(e), c = this.outputLen;
            if (c % 4) throw new Error("_sha2: outputLen must be aligned to 32bit");
            const l = c / 4, u = this.get();
            if (l > u.length) throw new Error("_sha2: outputLen bigger than state");
            for(let d = 0; d < l; d++)a.setUint32(4 * d, u[d], i);
        }
        digest() {
            const { buffer: e, outputLen: n } = this;
            this.digestInto(e);
            const r = e.slice(0, n);
            return this.destroy(), r;
        }
        _cloneInto(e) {
            e ||= new this.constructor, e.set(...this.get());
            const { blockLen: n, buffer: r, length: s, finished: i, destroyed: o, pos: a } = this;
            return e.destroyed = o, e.finished = i, e.length = s, e.pos = a, s % n && e.buffer.set(r), e;
        }
        clone() {
            return this._cloneInto();
        }
    }
    const zu = Uint32Array.from([
        1779033703,
        3144134277,
        1013904242,
        2773480762,
        1359893119,
        2600822924,
        528734635,
        1541459225
    ]), Xre = 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
    ]), Uu = new Uint32Array(64);
    class Gre extends $re {
        constructor(e){
            super(64, e, 8, !1);
        }
        get() {
            const { A: e, B: n, C: r, D: s, E: i, F: o, G: a, H: c } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c
            ];
        }
        set(e, n, r, s, i, o, a, c) {
            this.A = e | 0, this.B = n | 0, this.C = r | 0, this.D = s | 0, this.E = i | 0, this.F = o | 0, this.G = a | 0, this.H = c | 0;
        }
        process(e, n) {
            for(let d = 0; d < 16; d++, n += 4)Uu[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Uu[d - 15], p = Uu[d - 2], h = ac(f, 7) ^ ac(f, 18) ^ f >>> 3, m = ac(p, 17) ^ ac(p, 19) ^ p >>> 10;
                Uu[d] = m + Uu[d - 7] + h + Uu[d - 16] | 0;
            }
            let { A: r, B: s, C: i, D: o, E: a, F: c, G: l, H: u } = this;
            for(let d = 0; d < 64; d++){
                const f = ac(a, 6) ^ ac(a, 11) ^ ac(a, 25), p = u + f + Wre(a, c, l) + Xre[d] + Uu[d] | 0, m = (ac(r, 2) ^ ac(r, 13) ^ ac(r, 22)) + Kre(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + m | 0;
            }
            r = r + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, u = u + this.H | 0, this.set(r, s, i, o, a, c, l, u);
        }
        roundClean() {
            $7(Uu);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), $7(this.buffer);
        }
    }
    class Zre extends Gre {
        A = zu[0] | 0;
        B = zu[1] | 0;
        C = zu[2] | 0;
        D = zu[3] | 0;
        E = zu[4] | 0;
        F = zu[5] | 0;
        G = zu[6] | 0;
        H = zu[7] | 0;
        constructor(){
            super(32);
        }
    }
    const Jre = Hre(()=>new Zre, qre(1));
    const Yre = (t)=>t[0] === "あいこくしん";
    function Qre(t) {
        if (zT(t), ![
            16,
            20,
            24,
            28,
            32
        ].includes(t.length)) throw new Error("invalid entropy length");
    }
    function ese(t, e = 128) {
        if (zre(e), e % 32 !== 0 || e > 256) throw new TypeError("Invalid entropy");
        return rse(jre(e / 8), t);
    }
    const tse = (t)=>{
        const e = 8 - t.length / 4;
        return new Uint8Array([
            Jre(t)[0] >> e << e
        ]);
    };
    function nse(t) {
        if (!Array.isArray(t) || t.length !== 2048 || typeof t[0] != "string") throw new Error("Wordlist: expected array of 2048 strings");
        return t.forEach((e)=>{
            if (typeof e != "string") throw new Error("wordlist: non-string element: " + e);
        }), vw.chain(vw.checksum(1, tse), vw.radix2(11, !0), vw.alphabet(t));
    }
    function rse(t, e) {
        return Qre(t), nse(e).encode(t).join(Yre(e) ? "　" : " ");
    }
    let sse, ise, ase, cse;
    sse = `abandon
ability
able
about
above
absent
absorb
abstract
absurd
abuse
access
accident
account
accuse
achieve
acid
acoustic
acquire
across
act
action
actor
actress
actual
adapt
add
addict
address
adjust
admit
adult
advance
advice
aerobic
affair
afford
afraid
again
age
agent
agree
ahead
aim
air
airport
aisle
alarm
album
alcohol
alert
alien
all
alley
allow
almost
alone
alpha
already
also
alter
always
amateur
amazing
among
amount
amused
analyst
anchor
ancient
anger
angle
angry
animal
ankle
announce
annual
another
answer
antenna
antique
anxiety
any
apart
apology
appear
apple
approve
april
arch
arctic
area
arena
argue
arm
armed
armor
army
around
arrange
arrest
arrive
arrow
art
artefact
artist
artwork
ask
aspect
assault
asset
assist
assume
asthma
athlete
atom
attack
attend
attitude
attract
auction
audit
august
aunt
author
auto
autumn
average
avocado
avoid
awake
aware
away
awesome
awful
awkward
axis
baby
bachelor
bacon
badge
bag
balance
balcony
ball
bamboo
banana
banner
bar
barely
bargain
barrel
base
basic
basket
battle
beach
bean
beauty
because
become
beef
before
begin
behave
behind
believe
below
belt
bench
benefit
best
betray
better
between
beyond
bicycle
bid
bike
bind
biology
bird
birth
bitter
black
blade
blame
blanket
blast
bleak
bless
blind
blood
blossom
blouse
blue
blur
blush
board
boat
body
boil
bomb
bone
bonus
book
boost
border
boring
borrow
boss
bottom
bounce
box
boy
bracket
brain
brand
brass
brave
bread
breeze
brick
bridge
brief
bright
bring
brisk
broccoli
broken
bronze
broom
brother
brown
brush
bubble
buddy
budget
buffalo
build
bulb
bulk
bullet
bundle
bunker
burden
burger
burst
bus
business
busy
butter
buyer
buzz
cabbage
cabin
cable
cactus
cage
cake
call
calm
camera
camp
can
canal
cancel
candy
cannon
canoe
canvas
canyon
capable
capital
captain
car
carbon
card
cargo
carpet
carry
cart
case
cash
casino
castle
casual
cat
catalog
catch
category
cattle
caught
cause
caution
cave
ceiling
celery
cement
census
century
cereal
certain
chair
chalk
champion
change
chaos
chapter
charge
chase
chat
cheap
check
cheese
chef
cherry
chest
chicken
chief
child
chimney
choice
choose
chronic
chuckle
chunk
churn
cigar
cinnamon
circle
citizen
city
civil
claim
clap
clarify
claw
clay
clean
clerk
clever
click
client
cliff
climb
clinic
clip
clock
clog
close
cloth
cloud
clown
club
clump
cluster
clutch
coach
coast
coconut
code
coffee
coil
coin
collect
color
column
combine
come
comfort
comic
common
company
concert
conduct
confirm
congress
connect
consider
control
convince
cook
cool
copper
copy
coral
core
corn
correct
cost
cotton
couch
country
couple
course
cousin
cover
coyote
crack
cradle
craft
cram
crane
crash
crater
crawl
crazy
cream
credit
creek
crew
cricket
crime
crisp
critic
crop
cross
crouch
crowd
crucial
cruel
cruise
crumble
crunch
crush
cry
crystal
cube
culture
cup
cupboard
curious
current
curtain
curve
cushion
custom
cute
cycle
dad
damage
damp
dance
danger
daring
dash
daughter
dawn
day
deal
debate
debris
decade
december
decide
decline
decorate
decrease
deer
defense
define
defy
degree
delay
deliver
demand
demise
denial
dentist
deny
depart
depend
deposit
depth
deputy
derive
describe
desert
design
desk
despair
destroy
detail
detect
develop
device
devote
diagram
dial
diamond
diary
dice
diesel
diet
differ
digital
dignity
dilemma
dinner
dinosaur
direct
dirt
disagree
discover
disease
dish
dismiss
disorder
display
distance
divert
divide
divorce
dizzy
doctor
document
dog
doll
dolphin
domain
donate
donkey
donor
door
dose
double
dove
draft
dragon
drama
drastic
draw
dream
dress
drift
drill
drink
drip
drive
drop
drum
dry
duck
dumb
dune
during
dust
dutch
duty
dwarf
dynamic
eager
eagle
early
earn
earth
easily
east
easy
echo
ecology
economy
edge
edit
educate
effort
egg
eight
either
elbow
elder
electric
elegant
element
elephant
elevator
elite
else
embark
embody
embrace
emerge
emotion
employ
empower
empty
enable
enact
end
endless
endorse
enemy
energy
enforce
engage
engine
enhance
enjoy
enlist
enough
enrich
enroll
ensure
enter
entire
entry
envelope
episode
equal
equip
era
erase
erode
erosion
error
erupt
escape
essay
essence
estate
eternal
ethics
evidence
evil
evoke
evolve
exact
example
excess
exchange
excite
exclude
excuse
execute
exercise
exhaust
exhibit
exile
exist
exit
exotic
expand
expect
expire
explain
expose
express
extend
extra
eye
eyebrow
fabric
face
faculty
fade
faint
faith
fall
false
fame
family
famous
fan
fancy
fantasy
farm
fashion
fat
fatal
father
fatigue
fault
favorite
feature
february
federal
fee
feed
feel
female
fence
festival
fetch
fever
few
fiber
fiction
field
figure
file
film
filter
final
find
fine
finger
finish
fire
firm
first
fiscal
fish
fit
fitness
fix
flag
flame
flash
flat
flavor
flee
flight
flip
float
flock
floor
flower
fluid
flush
fly
foam
focus
fog
foil
fold
follow
food
foot
force
forest
forget
fork
fortune
forum
forward
fossil
foster
found
fox
fragile
frame
frequent
fresh
friend
fringe
frog
front
frost
frown
frozen
fruit
fuel
fun
funny
furnace
fury
future
gadget
gain
galaxy
gallery
game
gap
garage
garbage
garden
garlic
garment
gas
gasp
gate
gather
gauge
gaze
general
genius
genre
gentle
genuine
gesture
ghost
giant
gift
giggle
ginger
giraffe
girl
give
glad
glance
glare
glass
glide
glimpse
globe
gloom
glory
glove
glow
glue
goat
goddess
gold
good
goose
gorilla
gospel
gossip
govern
gown
grab
grace
grain
grant
grape
grass
gravity
great
green
grid
grief
grit
grocery
group
grow
grunt
guard
guess
guide
guilt
guitar
gun
gym
habit
hair
half
hammer
hamster
hand
happy
harbor
hard
harsh
harvest
hat
have
hawk
hazard
head
health
heart
heavy
hedgehog
height
hello
helmet
help
hen
hero
hidden
high
hill
hint
hip
hire
history
hobby
hockey
hold
hole
holiday
hollow
home
honey
hood
hope
horn
horror
horse
hospital
host
hotel
hour
hover
hub
huge
human
humble
humor
hundred
hungry
hunt
hurdle
hurry
hurt
husband
hybrid
ice
icon
idea
identify
idle
ignore
ill
illegal
illness
image
imitate
immense
immune
impact
impose
improve
impulse
inch
include
income
increase
index
indicate
indoor
industry
infant
inflict
inform
inhale
inherit
initial
inject
injury
inmate
inner
innocent
input
inquiry
insane
insect
inside
inspire
install
intact
interest
into
invest
invite
involve
iron
island
isolate
issue
item
ivory
jacket
jaguar
jar
jazz
jealous
jeans
jelly
jewel
job
join
joke
journey
joy
judge
juice
jump
jungle
junior
junk
just
kangaroo
keen
keep
ketchup
key
kick
kid
kidney
kind
kingdom
kiss
kit
kitchen
kite
kitten
kiwi
knee
knife
knock
know
lab
label
labor
ladder
lady
lake
lamp
language
laptop
large
later
latin
laugh
laundry
lava
law
lawn
lawsuit
layer
lazy
leader
leaf
learn
leave
lecture
left
leg
legal
legend
leisure
lemon
lend
length
lens
leopard
lesson
letter
level
liar
liberty
library
license
life
lift
light
like
limb
limit
link
lion
liquid
list
little
live
lizard
load
loan
lobster
local
lock
logic
lonely
long
loop
lottery
loud
lounge
love
loyal
lucky
luggage
lumber
lunar
lunch
luxury
lyrics
machine
mad
magic
magnet
maid
mail
main
major
make
mammal
man
manage
mandate
mango
mansion
manual
maple
marble
march
margin
marine
market
marriage
mask
mass
master
match
material
math
matrix
matter
maximum
maze
meadow
mean
measure
meat
mechanic
medal
media
melody
melt
member
memory
mention
menu
mercy
merge
merit
merry
mesh
message
metal
method
middle
midnight
milk
million
mimic
mind
minimum
minor
minute
miracle
mirror
misery
miss
mistake
mix
mixed
mixture
mobile
model
modify
mom
moment
monitor
monkey
monster
month
moon
moral
more
morning
mosquito
mother
motion
motor
mountain
mouse
move
movie
much
muffin
mule
multiply
muscle
museum
mushroom
music
must
mutual
myself
mystery
myth
naive
name
napkin
narrow
nasty
nation
nature
near
neck
need
negative
neglect
neither
nephew
nerve
nest
net
network
neutral
never
news
next
nice
night
noble
noise
nominee
noodle
normal
north
nose
notable
note
nothing
notice
novel
now
nuclear
number
nurse
nut
oak
obey
object
oblige
obscure
observe
obtain
obvious
occur
ocean
october
odor
off
offer
office
often
oil
okay
old
olive
olympic
omit
once
one
onion
online
only
open
opera
opinion
oppose
option
orange
orbit
orchard
order
ordinary
organ
orient
original
orphan
ostrich
other
outdoor
outer
output
outside
oval
oven
over
own
owner
oxygen
oyster
ozone
pact
paddle
page
pair
palace
palm
panda
panel
panic
panther
paper
parade
parent
park
parrot
party
pass
patch
path
patient
patrol
pattern
pause
pave
payment
peace
peanut
pear
peasant
pelican
pen
penalty
pencil
people
pepper
perfect
permit
person
pet
phone
photo
phrase
physical
piano
picnic
picture
piece
pig
pigeon
pill
pilot
pink
pioneer
pipe
pistol
pitch
pizza
place
planet
plastic
plate
play
please
pledge
pluck
plug
plunge
poem
poet
point
polar
pole
police
pond
pony
pool
popular
portion
position
possible
post
potato
pottery
poverty
powder
power
practice
praise
predict
prefer
prepare
present
pretty
prevent
price
pride
primary
print
priority
prison
private
prize
problem
process
produce
profit
program
project
promote
proof
property
prosper
protect
proud
provide
public
pudding
pull
pulp
pulse
pumpkin
punch
pupil
puppy
purchase
purity
purpose
purse
push
put
puzzle
pyramid
quality
quantum
quarter
question
quick
quit
quiz
quote
rabbit
raccoon
race
rack
radar
radio
rail
rain
raise
rally
ramp
ranch
random
range
rapid
rare
rate
rather
raven
raw
razor
ready
real
reason
rebel
rebuild
recall
receive
recipe
record
recycle
reduce
reflect
reform
refuse
region
regret
regular
reject
relax
release
relief
rely
remain
remember
remind
remove
render
renew
rent
reopen
repair
repeat
replace
report
require
rescue
resemble
resist
resource
response
result
retire
retreat
return
reunion
reveal
review
reward
rhythm
rib
ribbon
rice
rich
ride
ridge
rifle
right
rigid
ring
riot
ripple
risk
ritual
rival
river
road
roast
robot
robust
rocket
romance
roof
rookie
room
rose
rotate
rough
round
route
royal
rubber
rude
rug
rule
run
runway
rural
sad
saddle
sadness
safe
sail
salad
salmon
salon
salt
salute
same
sample
sand
satisfy
satoshi
sauce
sausage
save
say
scale
scan
scare
scatter
scene
scheme
school
science
scissors
scorpion
scout
scrap
screen
script
scrub
sea
search
season
seat
second
secret
section
security
seed
seek
segment
select
sell
seminar
senior
sense
sentence
series
service
session
settle
setup
seven
shadow
shaft
shallow
share
shed
shell
sheriff
shield
shift
shine
ship
shiver
shock
shoe
shoot
shop
short
shoulder
shove
shrimp
shrug
shuffle
shy
sibling
sick
side
siege
sight
sign
silent
silk
silly
silver
similar
simple
since
sing
siren
sister
situate
six
size
skate
sketch
ski
skill
skin
skirt
skull
slab
slam
sleep
slender
slice
slide
slight
slim
slogan
slot
slow
slush
small
smart
smile
smoke
smooth
snack
snake
snap
sniff
snow
soap
soccer
social
sock
soda
soft
solar
soldier
solid
solution
solve
someone
song
soon
sorry
sort
soul
sound
soup
source
south
space
spare
spatial
spawn
speak
special
speed
spell
spend
sphere
spice
spider
spike
spin
spirit
split
spoil
sponsor
spoon
sport
spot
spray
spread
spring
spy
square
squeeze
squirrel
stable
stadium
staff
stage
stairs
stamp
stand
start
state
stay
steak
steel
stem
step
stereo
stick
still
sting
stock
stomach
stone
stool
story
stove
strategy
street
strike
strong
struggle
student
stuff
stumble
style
subject
submit
subway
success
such
sudden
suffer
sugar
suggest
suit
summer
sun
sunny
sunset
super
supply
supreme
sure
surface
surge
surprise
surround
survey
suspect
sustain
swallow
swamp
swap
swarm
swear
sweet
swift
swim
swing
switch
sword
symbol
symptom
syrup
system
table
tackle
tag
tail
talent
talk
tank
tape
target
task
taste
tattoo
taxi
teach
team
tell
ten
tenant
tennis
tent
term
test
text
thank
that
theme
then
theory
there
they
thing
this
thought
three
thrive
throw
thumb
thunder
ticket
tide
tiger
tilt
timber
time
tiny
tip
tired
tissue
title
toast
tobacco
today
toddler
toe
together
toilet
token
tomato
tomorrow
tone
tongue
tonight
tool
tooth
top
topic
topple
torch
tornado
tortoise
toss
total
tourist
toward
tower
town
toy
track
trade
traffic
tragic
train
transfer
trap
trash
travel
tray
treat
tree
trend
trial
tribe
trick
trigger
trim
trip
trophy
trouble
truck
true
truly
trumpet
trust
truth
try
tube
tuition
tumble
tuna
tunnel
turkey
turn
turtle
twelve
twenty
twice
twin
twist
two
type
typical
ugly
umbrella
unable
unaware
uncle
uncover
under
undo
unfair
unfold
unhappy
uniform
unique
unit
universe
unknown
unlock
until
unusual
unveil
update
upgrade
uphold
upon
upper
upset
urban
urge
usage
use
used
useful
useless
usual
utility
vacant
vacuum
vague
valid
valley
valve
van
vanish
vapor
various
vast
vault
vehicle
velvet
vendor
venture
venue
verb
verify
version
very
vessel
veteran
viable
vibrant
vicious
victory
video
view
village
vintage
violin
virtual
virus
visa
visit
visual
vital
vivid
vocal
voice
void
volcano
volume
vote
voyage
wage
wagon
wait
walk
wall
walnut
want
warfare
warm
warrior
wash
wasp
waste
water
wave
way
wealth
weapon
wear
weasel
weather
web
wedding
weekend
weird
welcome
west
wet
whale
what
wheat
wheel
when
where
whip
whisper
wide
width
wife
wild
will
win
window
wine
wing
wink
winner
winter
wire
wisdom
wise
wish
witness
wolf
woman
wonder
wood
wool
word
work
world
worry
worth
wrap
wreck
wrestle
wrist
write
wrong
yard
year
yellow
you
young
youth
zebra
zero
zone
zoo`.split(`
`);
    ise = (t)=>t.split(" ");
    ose = (t = 256)=>ise(ese(sse, t));
    gM = (t)=>t.join(" ");
    ase = (t)=>t != null;
    cse = (t)=>t.filter(ase);
    function lse(t) {
        return (...e)=>{
            for (const n of t)n && n(...e);
        };
    }
    let X7;
    Ae = (t)=>typeof t == "function" && !t.length ? t() : t;
    X7 = (t)=>Array.isArray(t) ? t : t ? [
            t
        ] : [];
    function use(t, ...e) {
        return typeof t == "function" ? t(...e) : t;
    }
    const dse = It;
    function fse(t, e, n, r) {
        const s = t.length, i = e.length;
        let o = 0;
        if (!i) {
            for(; o < s; o++)n(t[o]);
            return;
        }
        if (!s) {
            for(; o < i; o++)r(e[o]);
            return;
        }
        for(; o < i && e[o] === t[o]; o++);
        let a, c;
        e = e.slice(o), t = t.slice(o);
        for (a of e)t.includes(a) || r(a);
        for (c of t)e.includes(c) || n(c);
    }
    function pse(t, e, n, r) {
        return t.addEventListener(e, n, r), dse(t.removeEventListener.bind(t, e, n, r));
    }
    function hse(t, e, n, r) {
        const s = ()=>{
            X7(Ae(t)).forEach((i)=>{
                i && X7(Ae(e)).forEach((o)=>pse(i, o, n, r));
            });
        };
        typeof t == "function" ? lt(s) : pt(s);
    }
    const h5 = Symbol("fallback");
    function bM(t) {
        for (const e of t)e.dispose();
    }
    function gse(t, e, n, r = {}) {
        const s = new Map;
        return It(()=>bM(s.values())), ()=>{
            const o = t() || [];
            return o[qte], ST(()=>{
                if (!o.length) return bM(s.values()), s.clear(), r.fallback ? [
                    zO((d)=>(s.set(h5, {
                            dispose: d
                        }), r.fallback()))
                ] : [];
                const a = new Array(o.length), c = s.get(h5);
                if (!s.size || c) {
                    c?.dispose(), s.delete(h5);
                    for(let u = 0; u < o.length; u++){
                        const d = o[u], f = e(d, u);
                        i(a, d, u, f);
                    }
                    return a;
                }
                const l = new Set(s.keys());
                for(let u = 0; u < o.length; u++){
                    const d = o[u], f = e(d, u);
                    l.delete(f);
                    const p = s.get(f);
                    p ? (a[u] = p.mapped, p.setIndex?.(u), p.setItem(()=>d)) : i(a, d, u, f);
                }
                for (const u of l)s.get(u)?.dispose(), s.delete(u);
                return a;
            });
        };
        function i(o, a, c, l) {
            zO((u)=>{
                const [d, f] = pe(a), p = {
                    setItem: f,
                    dispose: u
                };
                if (n.length > 1) {
                    const [h, m] = pe(c);
                    p.setIndex = m, p.mapped = n(d, h);
                } else p.mapped = n(d);
                s.set(l, p), o[c] = p.mapped;
            });
        }
    }
    function bse(t) {
        const { by: e } = t;
        return Ct(gse(()=>t.each, typeof e == "function" ? e : (n)=>n[e], t.children, "fallback" in t ? {
            fallback: ()=>t.fallback
        } : void 0));
    }
    const mse = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
    function mM(t) {
        const e = {};
        let n;
        for(; n = mse.exec(t);)e[n[1]] = n[2];
        return e;
    }
    hg = function(t, e) {
        if (typeof t == "string") {
            if (typeof e == "string") return `${t};${e}`;
            t = mM(t);
        } else typeof e == "string" && (e = mM(e));
        return {
            ...t,
            ...e
        };
    };
    yr = function(...t) {
        return lse(t);
    };
    function yse(t, e, n = -1) {
        return n in t ? [
            ...t.slice(0, n),
            e,
            ...t.slice(n)
        ] : [
            ...t,
            e
        ];
    }
    function G7(t, e) {
        const n = [
            ...t
        ], r = n.indexOf(e);
        return r !== -1 && n.splice(r, 1), n;
    }
    function wse(t) {
        return typeof t == "number";
    }
    function Ph(t) {
        return Object.prototype.toString.call(t) === "[object String]";
    }
    function UT(t) {
        return typeof t == "function";
    }
    gu = function(t) {
        return (e)=>`${t()}-${e}`;
    };
    function bo(t, e) {
        return t ? t === e || t.contains(e) : !1;
    }
    function Xb(t, e = !1) {
        const { activeElement: n } = Bc(t);
        if (!n?.nodeName) return null;
        if (ZU(n) && n.contentDocument) return Xb(n.contentDocument.body, e);
        if (e) {
            const r = n.getAttribute("aria-activedescendant");
            if (r) {
                const s = Bc(n).getElementById(r);
                if (s) return s;
            }
        }
        return n;
    }
    function _se(t) {
        return Bc(t).defaultView || window;
    }
    function Bc(t) {
        return t ? t.ownerDocument || t : document;
    }
    function ZU(t) {
        return t.tagName === "IFRAME";
    }
    JU = ((t)=>(t.Escape = "Escape", t.Enter = "Enter", t.Tab = "Tab", t.Space = " ", t.ArrowDown = "ArrowDown", t.ArrowLeft = "ArrowLeft", t.ArrowRight = "ArrowRight", t.ArrowUp = "ArrowUp", t.End = "End", t.Home = "Home", t.PageDown = "PageDown", t.PageUp = "PageUp", t))(JU || {});
    function YU(t) {
        return typeof window > "u" || window.navigator == null ? !1 : window.navigator.userAgentData?.brands.some((e)=>t.test(e.brand)) || t.test(window.navigator.userAgent);
    }
    function HT(t) {
        return typeof window < "u" && window.navigator != null ? t.test(window.navigator.userAgentData?.platform || window.navigator.platform) : !1;
    }
    function Uy() {
        return HT(/^Mac/i);
    }
    function xse() {
        return HT(/^iPhone/i);
    }
    function vse() {
        return HT(/^iPad/i) || Uy() && navigator.maxTouchPoints > 1;
    }
    function Sse() {
        return xse() || vse();
    }
    function kse() {
        return Uy() || Sse();
    }
    function QU() {
        return YU(/AppleWebKit/i) && !Tse();
    }
    function Tse() {
        return YU(/Chrome/i);
    }
    $n = function(t, e) {
        return e && (UT(e) ? e(t) : e[0](e[1], t)), t?.defaultPrevented;
    };
    function Yt(t) {
        return (e)=>{
            for (const n of t)$n(e, n);
        };
    }
    function Cse(t) {
        return Uy() ? t.metaKey && !t.ctrlKey : t.ctrlKey && !t.metaKey;
    }
    function jr(t) {
        if (t) if (Ese()) t.focus({
            preventScroll: !0
        });
        else {
            const e = Ise(t);
            t.focus(), Ase(e);
        }
    }
    var Rw = null;
    function Ese() {
        if (Rw == null) {
            Rw = !1;
            try {
                document.createElement("div").focus({
                    get preventScroll () {
                        return Rw = !0, !0;
                    }
                });
            } catch  {}
        }
        return Rw;
    }
    function Ise(t) {
        let e = t.parentNode;
        const n = [], r = document.scrollingElement || document.documentElement;
        for(; e instanceof HTMLElement && e !== r;)(e.offsetHeight < e.scrollHeight || e.offsetWidth < e.scrollWidth) && n.push({
            element: e,
            scrollTop: e.scrollTop,
            scrollLeft: e.scrollLeft
        }), e = e.parentNode;
        return r instanceof HTMLElement && n.push({
            element: r,
            scrollTop: r.scrollTop,
            scrollLeft: r.scrollLeft
        }), n;
    }
    function Ase(t) {
        for (const { element: e, scrollTop: n, scrollLeft: r } of t)e.scrollTop = n, e.scrollLeft = r;
    }
    var eH = [
        "input:not([type='hidden']):not([disabled])",
        "select:not([disabled])",
        "textarea:not([disabled])",
        "button:not([disabled])",
        "a[href]",
        "area[href]",
        "[tabindex]",
        "iframe",
        "object",
        "embed",
        "audio[controls]",
        "video[controls]",
        "[contenteditable]:not([contenteditable='false'])"
    ], Pse = [
        ...eH,
        '[tabindex]:not([tabindex="-1"]):not([disabled])'
    ], jT = `${eH.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`, Ose = Pse.join(':not([hidden]):not([tabindex="-1"]),');
    function tH(t, e) {
        const r = Array.from(t.querySelectorAll(jT)).filter(yM);
        return e && yM(t) && r.unshift(t), r.forEach((s, i)=>{
            if (ZU(s) && s.contentDocument) {
                const o = s.contentDocument.body, a = tH(o, !1);
                r.splice(i, 1, ...a);
            }
        }), r;
    }
    function yM(t) {
        return nH(t) && !Mse(t);
    }
    function nH(t) {
        return t.matches(jT) && qT(t);
    }
    function Mse(t) {
        return Number.parseInt(t.getAttribute("tabindex") || "0", 10) < 0;
    }
    function qT(t, e) {
        return t.nodeName !== "#comment" && Rse(t) && Nse(t, e) && (!t.parentElement || qT(t.parentElement, t));
    }
    function Rse(t) {
        if (!(t instanceof HTMLElement) && !(t instanceof SVGElement)) return !1;
        const { display: e, visibility: n } = t.style;
        let r = e !== "none" && n !== "hidden" && n !== "collapse";
        if (r) {
            if (!t.ownerDocument.defaultView) return r;
            const { getComputedStyle: s } = t.ownerDocument.defaultView, { display: i, visibility: o } = s(t);
            r = i !== "none" && o !== "hidden" && o !== "collapse";
        }
        return r;
    }
    function Nse(t, e) {
        return !t.hasAttribute("hidden") && (t.nodeName === "DETAILS" && e && e.nodeName !== "SUMMARY" ? t.hasAttribute("open") : !0);
    }
    function rH(t, e, n) {
        const r = e?.tabbable ? Ose : jT, s = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
            acceptNode (i) {
                return e?.from?.contains(i) ? NodeFilter.FILTER_REJECT : i.matches(r) && qT(i) && (!e?.accept || e.accept(i)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
            }
        });
        return e?.from && (s.currentNode = e.from), s;
    }
    function wM(t) {
        let e = t;
        for(; e && !Vse(e);)e = e.parentElement;
        return e || document.scrollingElement || document.documentElement;
    }
    function Vse(t) {
        const e = window.getComputedStyle(t);
        return /(auto|scroll)/.test(e.overflow + e.overflowX + e.overflowY);
    }
    function Dse() {}
    function Bse(t, e) {
        const [n, r] = t;
        let s = !1;
        const i = e.length;
        for(let o = i, a = 0, c = o - 1; a < o; c = a++){
            const [l, u] = e[a], [d, f] = e[c], [, p] = e[c === 0 ? o - 1 : c - 1] || [
                0,
                0
            ], h = (u - f) * (n - l) - (l - d) * (r - u);
            if (f < u) {
                if (r >= f && r < u) {
                    if (h === 0) return !0;
                    h > 0 && (r === f ? r > p && (s = !s) : s = !s);
                }
            } else if (u < f) {
                if (r > u && r <= f) {
                    if (h === 0) return !0;
                    h < 0 && (r === f ? r < p && (s = !s) : s = !s);
                }
            } else if (r === u && (n >= d && n <= l || n >= l && n <= d)) return !0;
        }
        return s;
    }
    qt = function(t, e) {
        return qe(t, e);
    };
    var yb = new Map, _M = new Set;
    function xM() {
        if (typeof window > "u") return;
        const t = (n)=>{
            if (!n.target) return;
            let r = yb.get(n.target);
            r || (r = new Set, yb.set(n.target, r), n.target.addEventListener("transitioncancel", e)), r.add(n.propertyName);
        }, e = (n)=>{
            if (!n.target) return;
            const r = yb.get(n.target);
            if (r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", e), yb.delete(n.target)), yb.size === 0)) {
                for (const s of _M)s();
                _M.clear();
            }
        };
        document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", e);
    }
    typeof document < "u" && (document.readyState !== "loading" ? xM() : document.addEventListener("DOMContentLoaded", xM));
    function Z7(t, e) {
        const n = vM(t, e, "left"), r = vM(t, e, "top"), s = e.offsetWidth, i = e.offsetHeight;
        let o = t.scrollLeft, a = t.scrollTop;
        const c = o + t.offsetWidth, l = a + t.offsetHeight;
        n <= o ? o = n : n + s > c && (o += n + s - c), r <= a ? a = r : r + i > l && (a += r + i - l), t.scrollLeft = o, t.scrollTop = a;
    }
    function vM(t, e, n) {
        const r = n === "left" ? "offsetLeft" : "offsetTop";
        let s = 0;
        for(; e.offsetParent && (s += e[r], e.offsetParent !== t);){
            if (e.offsetParent.contains(t)) {
                s -= t[r];
                break;
            }
            e = e.offsetParent;
        }
        return s;
    }
    function Fse(t, e) {
        if (document.contains(t)) {
            const n = document.scrollingElement || document.documentElement;
            if (window.getComputedStyle(n).overflow === "hidden") {
                let s = wM(t);
                for(; t && s && t !== n && s !== n;)Z7(s, t), t = s, s = wM(t);
            } else {
                const { left: s, top: i } = t.getBoundingClientRect();
                t?.scrollIntoView?.({
                    block: "nearest"
                });
                const { left: o, top: a } = t.getBoundingClientRect();
                (Math.abs(s - o) > 1 || Math.abs(i - a) > 1) && t.scrollIntoView?.({
                    block: "nearest"
                });
            }
        }
    }
    sH = {
        border: "0",
        clip: "rect(0 0 0 0)",
        "clip-path": "inset(50%)",
        height: "1px",
        margin: "0 -1px -1px 0",
        overflow: "hidden",
        padding: "0",
        position: "absolute",
        width: "1px",
        "white-space": "nowrap"
    };
    function Zx(t, e) {
        const [n, r] = pe(SM(e?.()));
        return lt(()=>{
            r(t()?.tagName.toLowerCase() || SM(e?.()));
        }), n;
    }
    function SM(t) {
        return Ph(t) ? t : void 0;
    }
    yn = function(t) {
        const [e, n] = rt(t, [
            "as"
        ]);
        if (!e.as) throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");
        return I(Wte, qe(n, {
            get component () {
                return e.as;
            }
        }));
    };
    let Lse, zse;
    Lse = Object.defineProperty;
    bu = (t, e)=>{
        for(var n in e)Lse(t, n, {
            get: e[n],
            enumerable: !0
        });
    };
    zse = {};
    bu(zse, {
        Button: ()=>jse,
        Root: ()=>jc
    });
    var Use = [
        "button",
        "color",
        "file",
        "image",
        "reset",
        "submit"
    ];
    function Hse(t) {
        const e = t.tagName.toLowerCase();
        return e === "button" ? !0 : e === "input" && t.type ? Use.indexOf(t.type) !== -1 : !1;
    }
    function jc(t) {
        let e;
        const n = qt({
            type: "button"
        }, t), [r, s] = rt(n, [
            "ref",
            "type",
            "disabled"
        ]), i = Zx(()=>e, ()=>"button"), o = Ct(()=>{
            const l = i();
            return l == null ? !1 : Hse({
                tagName: l,
                type: r.type
            });
        }), a = Ct(()=>i() === "input"), c = Ct(()=>i() === "a" && e?.getAttribute("href") != null);
        return I(yn, qe({
            as: "button",
            ref (l) {
                var u = yr((d)=>e = d, r.ref);
                typeof u == "function" && u(l);
            },
            get type () {
                return Ze(()=>!!(o() || a()))() ? r.type : void 0;
            },
            get role () {
                return !o() && !c() ? "button" : void 0;
            },
            get tabIndex () {
                return !o() && !c() && !r.disabled ? 0 : void 0;
            },
            get disabled () {
                return Ze(()=>!!(o() || a()))() ? r.disabled : void 0;
            },
            get "aria-disabled" () {
                return !o() && !a() && r.disabled ? !0 : void 0;
            },
            get "data-disabled" () {
                return r.disabled ? "" : void 0;
            }
        }, s));
    }
    var jse = jc;
    function iH(t) {
        var e, n, r = "";
        if (typeof t == "string" || typeof t == "number") r += t;
        else if (typeof t == "object") if (Array.isArray(t)) {
            var s = t.length;
            for(e = 0; e < s; e++)t[e] && (n = iH(t[e])) && (r && (r += " "), r += n);
        } else for(n in t)t[n] && (r && (r += " "), r += n);
        return r;
    }
    function oH() {
        for(var t, e, n = 0, r = "", s = arguments.length; n < s; n++)(t = arguments[n]) && (e = iH(t)) && (r && (r += " "), r += e);
        return r;
    }
    const kM = (t)=>typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, TM = oH, aH = (t, e)=>(n)=>{
            var r;
            if (e?.variants == null) return TM(t, n?.class, n?.className);
            const { variants: s, defaultVariants: i } = e, o = Object.keys(s).map((l)=>{
                const u = n?.[l], d = i?.[l];
                if (u === null) return null;
                const f = kM(u) || kM(d);
                return s[l][f];
            }), a = n && Object.entries(n).reduce((l, u)=>{
                let [d, f] = u;
                return f === void 0 || (l[d] = f), l;
            }, {}), c = e == null || (r = e.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((l, u)=>{
                let { class: d, className: f, ...p } = u;
                return Object.entries(p).every((h)=>{
                    let [m, w] = h;
                    return Array.isArray(w) ? w.includes({
                        ...i,
                        ...a
                    }[m]) : {
                        ...i,
                        ...a
                    }[m] === w;
                }) ? [
                    ...l,
                    d,
                    f
                ] : l;
            }, []);
            return TM(t, o, c, n?.class, n?.className);
        }, qse = (t, e)=>{
        const n = new Array(t.length + e.length);
        for(let r = 0; r < t.length; r++)n[r] = t[r];
        for(let r = 0; r < e.length; r++)n[t.length + r] = e[r];
        return n;
    }, Wse = (t, e)=>({
            classGroupId: t,
            validator: e
        }), cH = (t = new Map, e = null, n)=>({
            nextPart: t,
            validators: e,
            classGroupId: n
        }), d2 = "-", CM = [], Kse = "arbitrary..", $se = (t)=>{
        const e = Gse(t), { conflictingClassGroups: n, conflictingClassGroupModifiers: r } = t;
        return {
            getClassGroupId: (o)=>{
                if (o.startsWith("[") && o.endsWith("]")) return Xse(o);
                const a = o.split(d2), c = a[0] === "" && a.length > 1 ? 1 : 0;
                return lH(a, c, e);
            },
            getConflictingClassGroupIds: (o, a)=>{
                if (a) {
                    const c = r[o], l = n[o];
                    return c ? l ? qse(l, c) : c : l || CM;
                }
                return n[o] || CM;
            }
        };
    }, lH = (t, e, n)=>{
        if (t.length - e === 0) return n.classGroupId;
        const s = t[e], i = n.nextPart.get(s);
        if (i) {
            const l = lH(t, e + 1, i);
            if (l) return l;
        }
        const o = n.validators;
        if (o === null) return;
        const a = e === 0 ? t.join(d2) : t.slice(e).join(d2), c = o.length;
        for(let l = 0; l < c; l++){
            const u = o[l];
            if (u.validator(a)) return u.classGroupId;
        }
    }, Xse = (t)=>t.slice(1, -1).indexOf(":") === -1 ? void 0 : (()=>{
            const e = t.slice(1, -1), n = e.indexOf(":"), r = e.slice(0, n);
            return r ? Kse + r : void 0;
        })(), Gse = (t)=>{
        const { theme: e, classGroups: n } = t;
        return Zse(n, e);
    }, Zse = (t, e)=>{
        const n = cH();
        for(const r in t){
            const s = t[r];
            WT(s, n, r, e);
        }
        return n;
    }, WT = (t, e, n, r)=>{
        const s = t.length;
        for(let i = 0; i < s; i++){
            const o = t[i];
            Jse(o, e, n, r);
        }
    }, Jse = (t, e, n, r)=>{
        if (typeof t == "string") {
            Yse(t, e, n);
            return;
        }
        if (typeof t == "function") {
            Qse(t, e, n, r);
            return;
        }
        eie(t, e, n, r);
    }, Yse = (t, e, n)=>{
        const r = t === "" ? e : uH(e, t);
        r.classGroupId = n;
    }, Qse = (t, e, n, r)=>{
        if (tie(t)) {
            WT(t(r), e, n, r);
            return;
        }
        e.validators === null && (e.validators = []), e.validators.push(Wse(n, t));
    }, eie = (t, e, n, r)=>{
        const s = Object.entries(t), i = s.length;
        for(let o = 0; o < i; o++){
            const [a, c] = s[o];
            WT(c, uH(e, a), n, r);
        }
    }, uH = (t, e)=>{
        let n = t;
        const r = e.split(d2), s = r.length;
        for(let i = 0; i < s; i++){
            const o = r[i];
            let a = n.nextPart.get(o);
            a || (a = cH(), n.nextPart.set(o, a)), n = a;
        }
        return n;
    }, tie = (t)=>"isThemeGetter" in t && t.isThemeGetter === !0, nie = (t)=>{
        if (t < 1) return {
            get: ()=>{},
            set: ()=>{}
        };
        let e = 0, n = Object.create(null), r = Object.create(null);
        const s = (i, o)=>{
            n[i] = o, e++, e > t && (e = 0, r = n, n = Object.create(null));
        };
        return {
            get (i) {
                let o = n[i];
                if (o !== void 0) return o;
                if ((o = r[i]) !== void 0) return s(i, o), o;
            },
            set (i, o) {
                i in n ? n[i] = o : s(i, o);
            }
        };
    }, J7 = "!", EM = ":", rie = [], IM = (t, e, n, r, s)=>({
            modifiers: t,
            hasImportantModifier: e,
            baseClassName: n,
            maybePostfixModifierPosition: r,
            isExternal: s
        }), sie = (t)=>{
        const { prefix: e, experimentalParseClassName: n } = t;
        let r = (s)=>{
            const i = [];
            let o = 0, a = 0, c = 0, l;
            const u = s.length;
            for(let m = 0; m < u; m++){
                const w = s[m];
                if (o === 0 && a === 0) {
                    if (w === EM) {
                        i.push(s.slice(c, m)), c = m + 1;
                        continue;
                    }
                    if (w === "/") {
                        l = m;
                        continue;
                    }
                }
                w === "[" ? o++ : w === "]" ? o-- : w === "(" ? a++ : w === ")" && a--;
            }
            const d = i.length === 0 ? s : s.slice(c);
            let f = d, p = !1;
            d.endsWith(J7) ? (f = d.slice(0, -1), p = !0) : d.startsWith(J7) && (f = d.slice(1), p = !0);
            const h = l && l > c ? l - c : void 0;
            return IM(i, p, f, h);
        };
        if (e) {
            const s = e + EM, i = r;
            r = (o)=>o.startsWith(s) ? i(o.slice(s.length)) : IM(rie, !1, o, void 0, !0);
        }
        if (n) {
            const s = r;
            r = (i)=>n({
                    className: i,
                    parseClassName: s
                });
        }
        return r;
    }, iie = (t)=>{
        const e = new Map;
        return t.orderSensitiveModifiers.forEach((n, r)=>{
            e.set(n, 1e6 + r);
        }), (n)=>{
            const r = [];
            let s = [];
            for(let i = 0; i < n.length; i++){
                const o = n[i], a = o[0] === "[", c = e.has(o);
                a || c ? (s.length > 0 && (s.sort(), r.push(...s), s = []), r.push(o)) : s.push(o);
            }
            return s.length > 0 && (s.sort(), r.push(...s)), r;
        };
    }, oie = (t)=>({
            cache: nie(t.cacheSize),
            parseClassName: sie(t),
            sortModifiers: iie(t),
            ...$se(t)
        }), aie = /\s+/, cie = (t, e)=>{
        const { parseClassName: n, getClassGroupId: r, getConflictingClassGroupIds: s, sortModifiers: i } = e, o = [], a = t.trim().split(aie);
        let c = "";
        for(let l = a.length - 1; l >= 0; l -= 1){
            const u = a[l], { isExternal: d, modifiers: f, hasImportantModifier: p, baseClassName: h, maybePostfixModifierPosition: m } = n(u);
            if (d) {
                c = u + (c.length > 0 ? " " + c : c);
                continue;
            }
            let w = !!m, v = r(w ? h.substring(0, m) : h);
            if (!v) {
                if (!w) {
                    c = u + (c.length > 0 ? " " + c : c);
                    continue;
                }
                if (v = r(h), !v) {
                    c = u + (c.length > 0 ? " " + c : c);
                    continue;
                }
                w = !1;
            }
            const k = f.length === 0 ? "" : f.length === 1 ? f[0] : i(f).join(":"), _ = p ? k + J7 : k, A = _ + v;
            if (o.indexOf(A) > -1) continue;
            o.push(A);
            const P = s(v, w);
            for(let U = 0; U < P.length; ++U){
                const K = P[U];
                o.push(_ + K);
            }
            c = u + (c.length > 0 ? " " + c : c);
        }
        return c;
    }, lie = (...t)=>{
        let e = 0, n, r, s = "";
        for(; e < t.length;)(n = t[e++]) && (r = dH(n)) && (s && (s += " "), s += r);
        return s;
    }, dH = (t)=>{
        if (typeof t == "string") return t;
        let e, n = "";
        for(let r = 0; r < t.length; r++)t[r] && (e = dH(t[r])) && (n && (n += " "), n += e);
        return n;
    }, uie = (t, ...e)=>{
        let n, r, s, i;
        const o = (c)=>{
            const l = e.reduce((u, d)=>d(u), t());
            return n = oie(l), r = n.cache.get, s = n.cache.set, i = a, a(c);
        }, a = (c)=>{
            const l = r(c);
            if (l) return l;
            const u = cie(c, n);
            return s(c, u), u;
        };
        return i = o, (...c)=>i(lie(...c));
    }, die = [], bs = (t)=>{
        const e = (n)=>n[t] || die;
        return e.isThemeGetter = !0, e;
    }, fH = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, pH = /^\((?:(\w[\w-]*):)?(.+)\)$/i, fie = /^\d+\/\d+$/, pie = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, hie = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, gie = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, bie = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, mie = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, hh = (t)=>fie.test(t), cn = (t)=>!!t && !Number.isNaN(Number(t)), Hu = (t)=>!!t && Number.isInteger(Number(t)), g5 = (t)=>t.endsWith("%") && cn(t.slice(0, -1)), cl = (t)=>pie.test(t), yie = ()=>!0, wie = (t)=>hie.test(t) && !gie.test(t), hH = ()=>!1, _ie = (t)=>bie.test(t), xie = (t)=>mie.test(t), vie = (t)=>!xt(t) && !vt(t), Sie = (t)=>gg(t, mH, hH), xt = (t)=>fH.test(t), rf = (t)=>gg(t, yH, wie), b5 = (t)=>gg(t, Iie, cn), AM = (t)=>gg(t, gH, hH), kie = (t)=>gg(t, bH, xie), Nw = (t)=>gg(t, wH, _ie), vt = (t)=>pH.test(t), wb = (t)=>bg(t, yH), Tie = (t)=>bg(t, Aie), PM = (t)=>bg(t, gH), Cie = (t)=>bg(t, mH), Eie = (t)=>bg(t, bH), Vw = (t)=>bg(t, wH, !0), gg = (t, e, n)=>{
        const r = fH.exec(t);
        return r ? r[1] ? e(r[1]) : n(r[2]) : !1;
    }, bg = (t, e, n = !1)=>{
        const r = pH.exec(t);
        return r ? r[1] ? e(r[1]) : n : !1;
    }, gH = (t)=>t === "position" || t === "percentage", bH = (t)=>t === "image" || t === "url", mH = (t)=>t === "length" || t === "size" || t === "bg-size", yH = (t)=>t === "length", Iie = (t)=>t === "number", Aie = (t)=>t === "family-name", wH = (t)=>t === "shadow", Pie = ()=>{
        const t = bs("color"), e = bs("font"), n = bs("text"), r = bs("font-weight"), s = bs("tracking"), i = bs("leading"), o = bs("breakpoint"), a = bs("container"), c = bs("spacing"), l = bs("radius"), u = bs("shadow"), d = bs("inset-shadow"), f = bs("text-shadow"), p = bs("drop-shadow"), h = bs("blur"), m = bs("perspective"), w = bs("aspect"), v = bs("ease"), k = bs("animate"), _ = ()=>[
                "auto",
                "avoid",
                "all",
                "avoid-page",
                "page",
                "left",
                "right",
                "column"
            ], A = ()=>[
                "center",
                "top",
                "bottom",
                "left",
                "right",
                "top-left",
                "left-top",
                "top-right",
                "right-top",
                "bottom-right",
                "right-bottom",
                "bottom-left",
                "left-bottom"
            ], P = ()=>[
                ...A(),
                vt,
                xt
            ], U = ()=>[
                "auto",
                "hidden",
                "clip",
                "visible",
                "scroll"
            ], K = ()=>[
                "auto",
                "contain",
                "none"
            ], X = ()=>[
                vt,
                xt,
                c
            ], G = ()=>[
                hh,
                "full",
                "auto",
                ...X()
            ], ce = ()=>[
                Hu,
                "none",
                "subgrid",
                vt,
                xt
            ], ie = ()=>[
                "auto",
                {
                    span: [
                        "full",
                        Hu,
                        vt,
                        xt
                    ]
                },
                Hu,
                vt,
                xt
            ], Y = ()=>[
                Hu,
                "auto",
                vt,
                xt
            ], M = ()=>[
                "auto",
                "min",
                "max",
                "fr",
                vt,
                xt
            ], g = ()=>[
                "start",
                "end",
                "center",
                "between",
                "around",
                "evenly",
                "stretch",
                "baseline",
                "center-safe",
                "end-safe"
            ], y = ()=>[
                "start",
                "end",
                "center",
                "stretch",
                "center-safe",
                "end-safe"
            ], C = ()=>[
                "auto",
                ...X()
            ], R = ()=>[
                hh,
                "auto",
                "full",
                "dvw",
                "dvh",
                "lvw",
                "lvh",
                "svw",
                "svh",
                "min",
                "max",
                "fit",
                ...X()
            ], N = ()=>[
                t,
                vt,
                xt
            ], L = ()=>[
                ...A(),
                PM,
                AM,
                {
                    position: [
                        vt,
                        xt
                    ]
                }
            ], z = ()=>[
                "no-repeat",
                {
                    repeat: [
                        "",
                        "x",
                        "y",
                        "space",
                        "round"
                    ]
                }
            ], B = ()=>[
                "auto",
                "cover",
                "contain",
                Cie,
                Sie,
                {
                    size: [
                        vt,
                        xt
                    ]
                }
            ], x = ()=>[
                g5,
                wb,
                rf
            ], O = ()=>[
                "",
                "none",
                "full",
                l,
                vt,
                xt
            ], q = ()=>[
                "",
                cn,
                wb,
                rf
            ], H = ()=>[
                "solid",
                "dashed",
                "dotted",
                "double"
            ], Z = ()=>[
                "normal",
                "multiply",
                "screen",
                "overlay",
                "darken",
                "lighten",
                "color-dodge",
                "color-burn",
                "hard-light",
                "soft-light",
                "difference",
                "exclusion",
                "hue",
                "saturation",
                "color",
                "luminosity"
            ], te = ()=>[
                cn,
                g5,
                PM,
                AM
            ], J = ()=>[
                "",
                "none",
                h,
                vt,
                xt
            ], se = ()=>[
                "none",
                cn,
                vt,
                xt
            ], fe = ()=>[
                "none",
                cn,
                vt,
                xt
            ], ge = ()=>[
                cn,
                vt,
                xt
            ], Ce = ()=>[
                hh,
                "full",
                ...X()
            ];
        return {
            cacheSize: 500,
            theme: {
                animate: [
                    "spin",
                    "ping",
                    "pulse",
                    "bounce"
                ],
                aspect: [
                    "video"
                ],
                blur: [
                    cl
                ],
                breakpoint: [
                    cl
                ],
                color: [
                    yie
                ],
                container: [
                    cl
                ],
                "drop-shadow": [
                    cl
                ],
                ease: [
                    "in",
                    "out",
                    "in-out"
                ],
                font: [
                    vie
                ],
                "font-weight": [
                    "thin",
                    "extralight",
                    "light",
                    "normal",
                    "medium",
                    "semibold",
                    "bold",
                    "extrabold",
                    "black"
                ],
                "inset-shadow": [
                    cl
                ],
                leading: [
                    "none",
                    "tight",
                    "snug",
                    "normal",
                    "relaxed",
                    "loose"
                ],
                perspective: [
                    "dramatic",
                    "near",
                    "normal",
                    "midrange",
                    "distant",
                    "none"
                ],
                radius: [
                    cl
                ],
                shadow: [
                    cl
                ],
                spacing: [
                    "px",
                    cn
                ],
                text: [
                    cl
                ],
                "text-shadow": [
                    cl
                ],
                tracking: [
                    "tighter",
                    "tight",
                    "normal",
                    "wide",
                    "wider",
                    "widest"
                ]
            },
            classGroups: {
                aspect: [
                    {
                        aspect: [
                            "auto",
                            "square",
                            hh,
                            xt,
                            vt,
                            w
                        ]
                    }
                ],
                container: [
                    "container"
                ],
                columns: [
                    {
                        columns: [
                            cn,
                            xt,
                            vt,
                            a
                        ]
                    }
                ],
                "break-after": [
                    {
                        "break-after": _()
                    }
                ],
                "break-before": [
                    {
                        "break-before": _()
                    }
                ],
                "break-inside": [
                    {
                        "break-inside": [
                            "auto",
                            "avoid",
                            "avoid-page",
                            "avoid-column"
                        ]
                    }
                ],
                "box-decoration": [
                    {
                        "box-decoration": [
                            "slice",
                            "clone"
                        ]
                    }
                ],
                box: [
                    {
                        box: [
                            "border",
                            "content"
                        ]
                    }
                ],
                display: [
                    "block",
                    "inline-block",
                    "inline",
                    "flex",
                    "inline-flex",
                    "table",
                    "inline-table",
                    "table-caption",
                    "table-cell",
                    "table-column",
                    "table-column-group",
                    "table-footer-group",
                    "table-header-group",
                    "table-row-group",
                    "table-row",
                    "flow-root",
                    "grid",
                    "inline-grid",
                    "contents",
                    "list-item",
                    "hidden"
                ],
                sr: [
                    "sr-only",
                    "not-sr-only"
                ],
                float: [
                    {
                        float: [
                            "right",
                            "left",
                            "none",
                            "start",
                            "end"
                        ]
                    }
                ],
                clear: [
                    {
                        clear: [
                            "left",
                            "right",
                            "both",
                            "none",
                            "start",
                            "end"
                        ]
                    }
                ],
                isolation: [
                    "isolate",
                    "isolation-auto"
                ],
                "object-fit": [
                    {
                        object: [
                            "contain",
                            "cover",
                            "fill",
                            "none",
                            "scale-down"
                        ]
                    }
                ],
                "object-position": [
                    {
                        object: P()
                    }
                ],
                overflow: [
                    {
                        overflow: U()
                    }
                ],
                "overflow-x": [
                    {
                        "overflow-x": U()
                    }
                ],
                "overflow-y": [
                    {
                        "overflow-y": U()
                    }
                ],
                overscroll: [
                    {
                        overscroll: K()
                    }
                ],
                "overscroll-x": [
                    {
                        "overscroll-x": K()
                    }
                ],
                "overscroll-y": [
                    {
                        "overscroll-y": K()
                    }
                ],
                position: [
                    "static",
                    "fixed",
                    "absolute",
                    "relative",
                    "sticky"
                ],
                inset: [
                    {
                        inset: G()
                    }
                ],
                "inset-x": [
                    {
                        "inset-x": G()
                    }
                ],
                "inset-y": [
                    {
                        "inset-y": G()
                    }
                ],
                start: [
                    {
                        start: G()
                    }
                ],
                end: [
                    {
                        end: G()
                    }
                ],
                top: [
                    {
                        top: G()
                    }
                ],
                right: [
                    {
                        right: G()
                    }
                ],
                bottom: [
                    {
                        bottom: G()
                    }
                ],
                left: [
                    {
                        left: G()
                    }
                ],
                visibility: [
                    "visible",
                    "invisible",
                    "collapse"
                ],
                z: [
                    {
                        z: [
                            Hu,
                            "auto",
                            vt,
                            xt
                        ]
                    }
                ],
                basis: [
                    {
                        basis: [
                            hh,
                            "full",
                            "auto",
                            a,
                            ...X()
                        ]
                    }
                ],
                "flex-direction": [
                    {
                        flex: [
                            "row",
                            "row-reverse",
                            "col",
                            "col-reverse"
                        ]
                    }
                ],
                "flex-wrap": [
                    {
                        flex: [
                            "nowrap",
                            "wrap",
                            "wrap-reverse"
                        ]
                    }
                ],
                flex: [
                    {
                        flex: [
                            cn,
                            hh,
                            "auto",
                            "initial",
                            "none",
                            xt
                        ]
                    }
                ],
                grow: [
                    {
                        grow: [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                shrink: [
                    {
                        shrink: [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                order: [
                    {
                        order: [
                            Hu,
                            "first",
                            "last",
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "grid-cols": [
                    {
                        "grid-cols": ce()
                    }
                ],
                "col-start-end": [
                    {
                        col: ie()
                    }
                ],
                "col-start": [
                    {
                        "col-start": Y()
                    }
                ],
                "col-end": [
                    {
                        "col-end": Y()
                    }
                ],
                "grid-rows": [
                    {
                        "grid-rows": ce()
                    }
                ],
                "row-start-end": [
                    {
                        row: ie()
                    }
                ],
                "row-start": [
                    {
                        "row-start": Y()
                    }
                ],
                "row-end": [
                    {
                        "row-end": Y()
                    }
                ],
                "grid-flow": [
                    {
                        "grid-flow": [
                            "row",
                            "col",
                            "dense",
                            "row-dense",
                            "col-dense"
                        ]
                    }
                ],
                "auto-cols": [
                    {
                        "auto-cols": M()
                    }
                ],
                "auto-rows": [
                    {
                        "auto-rows": M()
                    }
                ],
                gap: [
                    {
                        gap: X()
                    }
                ],
                "gap-x": [
                    {
                        "gap-x": X()
                    }
                ],
                "gap-y": [
                    {
                        "gap-y": X()
                    }
                ],
                "justify-content": [
                    {
                        justify: [
                            ...g(),
                            "normal"
                        ]
                    }
                ],
                "justify-items": [
                    {
                        "justify-items": [
                            ...y(),
                            "normal"
                        ]
                    }
                ],
                "justify-self": [
                    {
                        "justify-self": [
                            "auto",
                            ...y()
                        ]
                    }
                ],
                "align-content": [
                    {
                        content: [
                            "normal",
                            ...g()
                        ]
                    }
                ],
                "align-items": [
                    {
                        items: [
                            ...y(),
                            {
                                baseline: [
                                    "",
                                    "last"
                                ]
                            }
                        ]
                    }
                ],
                "align-self": [
                    {
                        self: [
                            "auto",
                            ...y(),
                            {
                                baseline: [
                                    "",
                                    "last"
                                ]
                            }
                        ]
                    }
                ],
                "place-content": [
                    {
                        "place-content": g()
                    }
                ],
                "place-items": [
                    {
                        "place-items": [
                            ...y(),
                            "baseline"
                        ]
                    }
                ],
                "place-self": [
                    {
                        "place-self": [
                            "auto",
                            ...y()
                        ]
                    }
                ],
                p: [
                    {
                        p: X()
                    }
                ],
                px: [
                    {
                        px: X()
                    }
                ],
                py: [
                    {
                        py: X()
                    }
                ],
                ps: [
                    {
                        ps: X()
                    }
                ],
                pe: [
                    {
                        pe: X()
                    }
                ],
                pt: [
                    {
                        pt: X()
                    }
                ],
                pr: [
                    {
                        pr: X()
                    }
                ],
                pb: [
                    {
                        pb: X()
                    }
                ],
                pl: [
                    {
                        pl: X()
                    }
                ],
                m: [
                    {
                        m: C()
                    }
                ],
                mx: [
                    {
                        mx: C()
                    }
                ],
                my: [
                    {
                        my: C()
                    }
                ],
                ms: [
                    {
                        ms: C()
                    }
                ],
                me: [
                    {
                        me: C()
                    }
                ],
                mt: [
                    {
                        mt: C()
                    }
                ],
                mr: [
                    {
                        mr: C()
                    }
                ],
                mb: [
                    {
                        mb: C()
                    }
                ],
                ml: [
                    {
                        ml: C()
                    }
                ],
                "space-x": [
                    {
                        "space-x": X()
                    }
                ],
                "space-x-reverse": [
                    "space-x-reverse"
                ],
                "space-y": [
                    {
                        "space-y": X()
                    }
                ],
                "space-y-reverse": [
                    "space-y-reverse"
                ],
                size: [
                    {
                        size: R()
                    }
                ],
                w: [
                    {
                        w: [
                            a,
                            "screen",
                            ...R()
                        ]
                    }
                ],
                "min-w": [
                    {
                        "min-w": [
                            a,
                            "screen",
                            "none",
                            ...R()
                        ]
                    }
                ],
                "max-w": [
                    {
                        "max-w": [
                            a,
                            "screen",
                            "none",
                            "prose",
                            {
                                screen: [
                                    o
                                ]
                            },
                            ...R()
                        ]
                    }
                ],
                h: [
                    {
                        h: [
                            "screen",
                            "lh",
                            ...R()
                        ]
                    }
                ],
                "min-h": [
                    {
                        "min-h": [
                            "screen",
                            "lh",
                            "none",
                            ...R()
                        ]
                    }
                ],
                "max-h": [
                    {
                        "max-h": [
                            "screen",
                            "lh",
                            ...R()
                        ]
                    }
                ],
                "font-size": [
                    {
                        text: [
                            "base",
                            n,
                            wb,
                            rf
                        ]
                    }
                ],
                "font-smoothing": [
                    "antialiased",
                    "subpixel-antialiased"
                ],
                "font-style": [
                    "italic",
                    "not-italic"
                ],
                "font-weight": [
                    {
                        font: [
                            r,
                            vt,
                            b5
                        ]
                    }
                ],
                "font-stretch": [
                    {
                        "font-stretch": [
                            "ultra-condensed",
                            "extra-condensed",
                            "condensed",
                            "semi-condensed",
                            "normal",
                            "semi-expanded",
                            "expanded",
                            "extra-expanded",
                            "ultra-expanded",
                            g5,
                            xt
                        ]
                    }
                ],
                "font-family": [
                    {
                        font: [
                            Tie,
                            xt,
                            e
                        ]
                    }
                ],
                "fvn-normal": [
                    "normal-nums"
                ],
                "fvn-ordinal": [
                    "ordinal"
                ],
                "fvn-slashed-zero": [
                    "slashed-zero"
                ],
                "fvn-figure": [
                    "lining-nums",
                    "oldstyle-nums"
                ],
                "fvn-spacing": [
                    "proportional-nums",
                    "tabular-nums"
                ],
                "fvn-fraction": [
                    "diagonal-fractions",
                    "stacked-fractions"
                ],
                tracking: [
                    {
                        tracking: [
                            s,
                            vt,
                            xt
                        ]
                    }
                ],
                "line-clamp": [
                    {
                        "line-clamp": [
                            cn,
                            "none",
                            vt,
                            b5
                        ]
                    }
                ],
                leading: [
                    {
                        leading: [
                            i,
                            ...X()
                        ]
                    }
                ],
                "list-image": [
                    {
                        "list-image": [
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "list-style-position": [
                    {
                        list: [
                            "inside",
                            "outside"
                        ]
                    }
                ],
                "list-style-type": [
                    {
                        list: [
                            "disc",
                            "decimal",
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "text-alignment": [
                    {
                        text: [
                            "left",
                            "center",
                            "right",
                            "justify",
                            "start",
                            "end"
                        ]
                    }
                ],
                "placeholder-color": [
                    {
                        placeholder: N()
                    }
                ],
                "text-color": [
                    {
                        text: N()
                    }
                ],
                "text-decoration": [
                    "underline",
                    "overline",
                    "line-through",
                    "no-underline"
                ],
                "text-decoration-style": [
                    {
                        decoration: [
                            ...H(),
                            "wavy"
                        ]
                    }
                ],
                "text-decoration-thickness": [
                    {
                        decoration: [
                            cn,
                            "from-font",
                            "auto",
                            vt,
                            rf
                        ]
                    }
                ],
                "text-decoration-color": [
                    {
                        decoration: N()
                    }
                ],
                "underline-offset": [
                    {
                        "underline-offset": [
                            cn,
                            "auto",
                            vt,
                            xt
                        ]
                    }
                ],
                "text-transform": [
                    "uppercase",
                    "lowercase",
                    "capitalize",
                    "normal-case"
                ],
                "text-overflow": [
                    "truncate",
                    "text-ellipsis",
                    "text-clip"
                ],
                "text-wrap": [
                    {
                        text: [
                            "wrap",
                            "nowrap",
                            "balance",
                            "pretty"
                        ]
                    }
                ],
                indent: [
                    {
                        indent: X()
                    }
                ],
                "vertical-align": [
                    {
                        align: [
                            "baseline",
                            "top",
                            "middle",
                            "bottom",
                            "text-top",
                            "text-bottom",
                            "sub",
                            "super",
                            vt,
                            xt
                        ]
                    }
                ],
                whitespace: [
                    {
                        whitespace: [
                            "normal",
                            "nowrap",
                            "pre",
                            "pre-line",
                            "pre-wrap",
                            "break-spaces"
                        ]
                    }
                ],
                break: [
                    {
                        break: [
                            "normal",
                            "words",
                            "all",
                            "keep"
                        ]
                    }
                ],
                wrap: [
                    {
                        wrap: [
                            "break-word",
                            "anywhere",
                            "normal"
                        ]
                    }
                ],
                hyphens: [
                    {
                        hyphens: [
                            "none",
                            "manual",
                            "auto"
                        ]
                    }
                ],
                content: [
                    {
                        content: [
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "bg-attachment": [
                    {
                        bg: [
                            "fixed",
                            "local",
                            "scroll"
                        ]
                    }
                ],
                "bg-clip": [
                    {
                        "bg-clip": [
                            "border",
                            "padding",
                            "content",
                            "text"
                        ]
                    }
                ],
                "bg-origin": [
                    {
                        "bg-origin": [
                            "border",
                            "padding",
                            "content"
                        ]
                    }
                ],
                "bg-position": [
                    {
                        bg: L()
                    }
                ],
                "bg-repeat": [
                    {
                        bg: z()
                    }
                ],
                "bg-size": [
                    {
                        bg: B()
                    }
                ],
                "bg-image": [
                    {
                        bg: [
                            "none",
                            {
                                linear: [
                                    {
                                        to: [
                                            "t",
                                            "tr",
                                            "r",
                                            "br",
                                            "b",
                                            "bl",
                                            "l",
                                            "tl"
                                        ]
                                    },
                                    Hu,
                                    vt,
                                    xt
                                ],
                                radial: [
                                    "",
                                    vt,
                                    xt
                                ],
                                conic: [
                                    Hu,
                                    vt,
                                    xt
                                ]
                            },
                            Eie,
                            kie
                        ]
                    }
                ],
                "bg-color": [
                    {
                        bg: N()
                    }
                ],
                "gradient-from-pos": [
                    {
                        from: x()
                    }
                ],
                "gradient-via-pos": [
                    {
                        via: x()
                    }
                ],
                "gradient-to-pos": [
                    {
                        to: x()
                    }
                ],
                "gradient-from": [
                    {
                        from: N()
                    }
                ],
                "gradient-via": [
                    {
                        via: N()
                    }
                ],
                "gradient-to": [
                    {
                        to: N()
                    }
                ],
                rounded: [
                    {
                        rounded: O()
                    }
                ],
                "rounded-s": [
                    {
                        "rounded-s": O()
                    }
                ],
                "rounded-e": [
                    {
                        "rounded-e": O()
                    }
                ],
                "rounded-t": [
                    {
                        "rounded-t": O()
                    }
                ],
                "rounded-r": [
                    {
                        "rounded-r": O()
                    }
                ],
                "rounded-b": [
                    {
                        "rounded-b": O()
                    }
                ],
                "rounded-l": [
                    {
                        "rounded-l": O()
                    }
                ],
                "rounded-ss": [
                    {
                        "rounded-ss": O()
                    }
                ],
                "rounded-se": [
                    {
                        "rounded-se": O()
                    }
                ],
                "rounded-ee": [
                    {
                        "rounded-ee": O()
                    }
                ],
                "rounded-es": [
                    {
                        "rounded-es": O()
                    }
                ],
                "rounded-tl": [
                    {
                        "rounded-tl": O()
                    }
                ],
                "rounded-tr": [
                    {
                        "rounded-tr": O()
                    }
                ],
                "rounded-br": [
                    {
                        "rounded-br": O()
                    }
                ],
                "rounded-bl": [
                    {
                        "rounded-bl": O()
                    }
                ],
                "border-w": [
                    {
                        border: q()
                    }
                ],
                "border-w-x": [
                    {
                        "border-x": q()
                    }
                ],
                "border-w-y": [
                    {
                        "border-y": q()
                    }
                ],
                "border-w-s": [
                    {
                        "border-s": q()
                    }
                ],
                "border-w-e": [
                    {
                        "border-e": q()
                    }
                ],
                "border-w-t": [
                    {
                        "border-t": q()
                    }
                ],
                "border-w-r": [
                    {
                        "border-r": q()
                    }
                ],
                "border-w-b": [
                    {
                        "border-b": q()
                    }
                ],
                "border-w-l": [
                    {
                        "border-l": q()
                    }
                ],
                "divide-x": [
                    {
                        "divide-x": q()
                    }
                ],
                "divide-x-reverse": [
                    "divide-x-reverse"
                ],
                "divide-y": [
                    {
                        "divide-y": q()
                    }
                ],
                "divide-y-reverse": [
                    "divide-y-reverse"
                ],
                "border-style": [
                    {
                        border: [
                            ...H(),
                            "hidden",
                            "none"
                        ]
                    }
                ],
                "divide-style": [
                    {
                        divide: [
                            ...H(),
                            "hidden",
                            "none"
                        ]
                    }
                ],
                "border-color": [
                    {
                        border: N()
                    }
                ],
                "border-color-x": [
                    {
                        "border-x": N()
                    }
                ],
                "border-color-y": [
                    {
                        "border-y": N()
                    }
                ],
                "border-color-s": [
                    {
                        "border-s": N()
                    }
                ],
                "border-color-e": [
                    {
                        "border-e": N()
                    }
                ],
                "border-color-t": [
                    {
                        "border-t": N()
                    }
                ],
                "border-color-r": [
                    {
                        "border-r": N()
                    }
                ],
                "border-color-b": [
                    {
                        "border-b": N()
                    }
                ],
                "border-color-l": [
                    {
                        "border-l": N()
                    }
                ],
                "divide-color": [
                    {
                        divide: N()
                    }
                ],
                "outline-style": [
                    {
                        outline: [
                            ...H(),
                            "none",
                            "hidden"
                        ]
                    }
                ],
                "outline-offset": [
                    {
                        "outline-offset": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "outline-w": [
                    {
                        outline: [
                            "",
                            cn,
                            wb,
                            rf
                        ]
                    }
                ],
                "outline-color": [
                    {
                        outline: N()
                    }
                ],
                shadow: [
                    {
                        shadow: [
                            "",
                            "none",
                            u,
                            Vw,
                            Nw
                        ]
                    }
                ],
                "shadow-color": [
                    {
                        shadow: N()
                    }
                ],
                "inset-shadow": [
                    {
                        "inset-shadow": [
                            "none",
                            d,
                            Vw,
                            Nw
                        ]
                    }
                ],
                "inset-shadow-color": [
                    {
                        "inset-shadow": N()
                    }
                ],
                "ring-w": [
                    {
                        ring: q()
                    }
                ],
                "ring-w-inset": [
                    "ring-inset"
                ],
                "ring-color": [
                    {
                        ring: N()
                    }
                ],
                "ring-offset-w": [
                    {
                        "ring-offset": [
                            cn,
                            rf
                        ]
                    }
                ],
                "ring-offset-color": [
                    {
                        "ring-offset": N()
                    }
                ],
                "inset-ring-w": [
                    {
                        "inset-ring": q()
                    }
                ],
                "inset-ring-color": [
                    {
                        "inset-ring": N()
                    }
                ],
                "text-shadow": [
                    {
                        "text-shadow": [
                            "none",
                            f,
                            Vw,
                            Nw
                        ]
                    }
                ],
                "text-shadow-color": [
                    {
                        "text-shadow": N()
                    }
                ],
                opacity: [
                    {
                        opacity: [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "mix-blend": [
                    {
                        "mix-blend": [
                            ...Z(),
                            "plus-darker",
                            "plus-lighter"
                        ]
                    }
                ],
                "bg-blend": [
                    {
                        "bg-blend": Z()
                    }
                ],
                "mask-clip": [
                    {
                        "mask-clip": [
                            "border",
                            "padding",
                            "content",
                            "fill",
                            "stroke",
                            "view"
                        ]
                    },
                    "mask-no-clip"
                ],
                "mask-composite": [
                    {
                        mask: [
                            "add",
                            "subtract",
                            "intersect",
                            "exclude"
                        ]
                    }
                ],
                "mask-image-linear-pos": [
                    {
                        "mask-linear": [
                            cn
                        ]
                    }
                ],
                "mask-image-linear-from-pos": [
                    {
                        "mask-linear-from": te()
                    }
                ],
                "mask-image-linear-to-pos": [
                    {
                        "mask-linear-to": te()
                    }
                ],
                "mask-image-linear-from-color": [
                    {
                        "mask-linear-from": N()
                    }
                ],
                "mask-image-linear-to-color": [
                    {
                        "mask-linear-to": N()
                    }
                ],
                "mask-image-t-from-pos": [
                    {
                        "mask-t-from": te()
                    }
                ],
                "mask-image-t-to-pos": [
                    {
                        "mask-t-to": te()
                    }
                ],
                "mask-image-t-from-color": [
                    {
                        "mask-t-from": N()
                    }
                ],
                "mask-image-t-to-color": [
                    {
                        "mask-t-to": N()
                    }
                ],
                "mask-image-r-from-pos": [
                    {
                        "mask-r-from": te()
                    }
                ],
                "mask-image-r-to-pos": [
                    {
                        "mask-r-to": te()
                    }
                ],
                "mask-image-r-from-color": [
                    {
                        "mask-r-from": N()
                    }
                ],
                "mask-image-r-to-color": [
                    {
                        "mask-r-to": N()
                    }
                ],
                "mask-image-b-from-pos": [
                    {
                        "mask-b-from": te()
                    }
                ],
                "mask-image-b-to-pos": [
                    {
                        "mask-b-to": te()
                    }
                ],
                "mask-image-b-from-color": [
                    {
                        "mask-b-from": N()
                    }
                ],
                "mask-image-b-to-color": [
                    {
                        "mask-b-to": N()
                    }
                ],
                "mask-image-l-from-pos": [
                    {
                        "mask-l-from": te()
                    }
                ],
                "mask-image-l-to-pos": [
                    {
                        "mask-l-to": te()
                    }
                ],
                "mask-image-l-from-color": [
                    {
                        "mask-l-from": N()
                    }
                ],
                "mask-image-l-to-color": [
                    {
                        "mask-l-to": N()
                    }
                ],
                "mask-image-x-from-pos": [
                    {
                        "mask-x-from": te()
                    }
                ],
                "mask-image-x-to-pos": [
                    {
                        "mask-x-to": te()
                    }
                ],
                "mask-image-x-from-color": [
                    {
                        "mask-x-from": N()
                    }
                ],
                "mask-image-x-to-color": [
                    {
                        "mask-x-to": N()
                    }
                ],
                "mask-image-y-from-pos": [
                    {
                        "mask-y-from": te()
                    }
                ],
                "mask-image-y-to-pos": [
                    {
                        "mask-y-to": te()
                    }
                ],
                "mask-image-y-from-color": [
                    {
                        "mask-y-from": N()
                    }
                ],
                "mask-image-y-to-color": [
                    {
                        "mask-y-to": N()
                    }
                ],
                "mask-image-radial": [
                    {
                        "mask-radial": [
                            vt,
                            xt
                        ]
                    }
                ],
                "mask-image-radial-from-pos": [
                    {
                        "mask-radial-from": te()
                    }
                ],
                "mask-image-radial-to-pos": [
                    {
                        "mask-radial-to": te()
                    }
                ],
                "mask-image-radial-from-color": [
                    {
                        "mask-radial-from": N()
                    }
                ],
                "mask-image-radial-to-color": [
                    {
                        "mask-radial-to": N()
                    }
                ],
                "mask-image-radial-shape": [
                    {
                        "mask-radial": [
                            "circle",
                            "ellipse"
                        ]
                    }
                ],
                "mask-image-radial-size": [
                    {
                        "mask-radial": [
                            {
                                closest: [
                                    "side",
                                    "corner"
                                ],
                                farthest: [
                                    "side",
                                    "corner"
                                ]
                            }
                        ]
                    }
                ],
                "mask-image-radial-pos": [
                    {
                        "mask-radial-at": A()
                    }
                ],
                "mask-image-conic-pos": [
                    {
                        "mask-conic": [
                            cn
                        ]
                    }
                ],
                "mask-image-conic-from-pos": [
                    {
                        "mask-conic-from": te()
                    }
                ],
                "mask-image-conic-to-pos": [
                    {
                        "mask-conic-to": te()
                    }
                ],
                "mask-image-conic-from-color": [
                    {
                        "mask-conic-from": N()
                    }
                ],
                "mask-image-conic-to-color": [
                    {
                        "mask-conic-to": N()
                    }
                ],
                "mask-mode": [
                    {
                        mask: [
                            "alpha",
                            "luminance",
                            "match"
                        ]
                    }
                ],
                "mask-origin": [
                    {
                        "mask-origin": [
                            "border",
                            "padding",
                            "content",
                            "fill",
                            "stroke",
                            "view"
                        ]
                    }
                ],
                "mask-position": [
                    {
                        mask: L()
                    }
                ],
                "mask-repeat": [
                    {
                        mask: z()
                    }
                ],
                "mask-size": [
                    {
                        mask: B()
                    }
                ],
                "mask-type": [
                    {
                        "mask-type": [
                            "alpha",
                            "luminance"
                        ]
                    }
                ],
                "mask-image": [
                    {
                        mask: [
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                filter: [
                    {
                        filter: [
                            "",
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                blur: [
                    {
                        blur: J()
                    }
                ],
                brightness: [
                    {
                        brightness: [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                contrast: [
                    {
                        contrast: [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "drop-shadow": [
                    {
                        "drop-shadow": [
                            "",
                            "none",
                            p,
                            Vw,
                            Nw
                        ]
                    }
                ],
                "drop-shadow-color": [
                    {
                        "drop-shadow": N()
                    }
                ],
                grayscale: [
                    {
                        grayscale: [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "hue-rotate": [
                    {
                        "hue-rotate": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                invert: [
                    {
                        invert: [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                saturate: [
                    {
                        saturate: [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                sepia: [
                    {
                        sepia: [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-filter": [
                    {
                        "backdrop-filter": [
                            "",
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-blur": [
                    {
                        "backdrop-blur": J()
                    }
                ],
                "backdrop-brightness": [
                    {
                        "backdrop-brightness": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-contrast": [
                    {
                        "backdrop-contrast": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-grayscale": [
                    {
                        "backdrop-grayscale": [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-hue-rotate": [
                    {
                        "backdrop-hue-rotate": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-invert": [
                    {
                        "backdrop-invert": [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-opacity": [
                    {
                        "backdrop-opacity": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-saturate": [
                    {
                        "backdrop-saturate": [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "backdrop-sepia": [
                    {
                        "backdrop-sepia": [
                            "",
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                "border-collapse": [
                    {
                        border: [
                            "collapse",
                            "separate"
                        ]
                    }
                ],
                "border-spacing": [
                    {
                        "border-spacing": X()
                    }
                ],
                "border-spacing-x": [
                    {
                        "border-spacing-x": X()
                    }
                ],
                "border-spacing-y": [
                    {
                        "border-spacing-y": X()
                    }
                ],
                "table-layout": [
                    {
                        table: [
                            "auto",
                            "fixed"
                        ]
                    }
                ],
                caption: [
                    {
                        caption: [
                            "top",
                            "bottom"
                        ]
                    }
                ],
                transition: [
                    {
                        transition: [
                            "",
                            "all",
                            "colors",
                            "opacity",
                            "shadow",
                            "transform",
                            "none",
                            vt,
                            xt
                        ]
                    }
                ],
                "transition-behavior": [
                    {
                        transition: [
                            "normal",
                            "discrete"
                        ]
                    }
                ],
                duration: [
                    {
                        duration: [
                            cn,
                            "initial",
                            vt,
                            xt
                        ]
                    }
                ],
                ease: [
                    {
                        ease: [
                            "linear",
                            "initial",
                            v,
                            vt,
                            xt
                        ]
                    }
                ],
                delay: [
                    {
                        delay: [
                            cn,
                            vt,
                            xt
                        ]
                    }
                ],
                animate: [
                    {
                        animate: [
                            "none",
                            k,
                            vt,
                            xt
                        ]
                    }
                ],
                backface: [
                    {
                        backface: [
                            "hidden",
                            "visible"
                        ]
                    }
                ],
                perspective: [
                    {
                        perspective: [
                            m,
                            vt,
                            xt
                        ]
                    }
                ],
                "perspective-origin": [
                    {
                        "perspective-origin": P()
                    }
                ],
                rotate: [
                    {
                        rotate: se()
                    }
                ],
                "rotate-x": [
                    {
                        "rotate-x": se()
                    }
                ],
                "rotate-y": [
                    {
                        "rotate-y": se()
                    }
                ],
                "rotate-z": [
                    {
                        "rotate-z": se()
                    }
                ],
                scale: [
                    {
                        scale: fe()
                    }
                ],
                "scale-x": [
                    {
                        "scale-x": fe()
                    }
                ],
                "scale-y": [
                    {
                        "scale-y": fe()
                    }
                ],
                "scale-z": [
                    {
                        "scale-z": fe()
                    }
                ],
                "scale-3d": [
                    "scale-3d"
                ],
                skew: [
                    {
                        skew: ge()
                    }
                ],
                "skew-x": [
                    {
                        "skew-x": ge()
                    }
                ],
                "skew-y": [
                    {
                        "skew-y": ge()
                    }
                ],
                transform: [
                    {
                        transform: [
                            vt,
                            xt,
                            "",
                            "none",
                            "gpu",
                            "cpu"
                        ]
                    }
                ],
                "transform-origin": [
                    {
                        origin: P()
                    }
                ],
                "transform-style": [
                    {
                        transform: [
                            "3d",
                            "flat"
                        ]
                    }
                ],
                translate: [
                    {
                        translate: Ce()
                    }
                ],
                "translate-x": [
                    {
                        "translate-x": Ce()
                    }
                ],
                "translate-y": [
                    {
                        "translate-y": Ce()
                    }
                ],
                "translate-z": [
                    {
                        "translate-z": Ce()
                    }
                ],
                "translate-none": [
                    "translate-none"
                ],
                accent: [
                    {
                        accent: N()
                    }
                ],
                appearance: [
                    {
                        appearance: [
                            "none",
                            "auto"
                        ]
                    }
                ],
                "caret-color": [
                    {
                        caret: N()
                    }
                ],
                "color-scheme": [
                    {
                        scheme: [
                            "normal",
                            "dark",
                            "light",
                            "light-dark",
                            "only-dark",
                            "only-light"
                        ]
                    }
                ],
                cursor: [
                    {
                        cursor: [
                            "auto",
                            "default",
                            "pointer",
                            "wait",
                            "text",
                            "move",
                            "help",
                            "not-allowed",
                            "none",
                            "context-menu",
                            "progress",
                            "cell",
                            "crosshair",
                            "vertical-text",
                            "alias",
                            "copy",
                            "no-drop",
                            "grab",
                            "grabbing",
                            "all-scroll",
                            "col-resize",
                            "row-resize",
                            "n-resize",
                            "e-resize",
                            "s-resize",
                            "w-resize",
                            "ne-resize",
                            "nw-resize",
                            "se-resize",
                            "sw-resize",
                            "ew-resize",
                            "ns-resize",
                            "nesw-resize",
                            "nwse-resize",
                            "zoom-in",
                            "zoom-out",
                            vt,
                            xt
                        ]
                    }
                ],
                "field-sizing": [
                    {
                        "field-sizing": [
                            "fixed",
                            "content"
                        ]
                    }
                ],
                "pointer-events": [
                    {
                        "pointer-events": [
                            "auto",
                            "none"
                        ]
                    }
                ],
                resize: [
                    {
                        resize: [
                            "none",
                            "",
                            "y",
                            "x"
                        ]
                    }
                ],
                "scroll-behavior": [
                    {
                        scroll: [
                            "auto",
                            "smooth"
                        ]
                    }
                ],
                "scroll-m": [
                    {
                        "scroll-m": X()
                    }
                ],
                "scroll-mx": [
                    {
                        "scroll-mx": X()
                    }
                ],
                "scroll-my": [
                    {
                        "scroll-my": X()
                    }
                ],
                "scroll-ms": [
                    {
                        "scroll-ms": X()
                    }
                ],
                "scroll-me": [
                    {
                        "scroll-me": X()
                    }
                ],
                "scroll-mt": [
                    {
                        "scroll-mt": X()
                    }
                ],
                "scroll-mr": [
                    {
                        "scroll-mr": X()
                    }
                ],
                "scroll-mb": [
                    {
                        "scroll-mb": X()
                    }
                ],
                "scroll-ml": [
                    {
                        "scroll-ml": X()
                    }
                ],
                "scroll-p": [
                    {
                        "scroll-p": X()
                    }
                ],
                "scroll-px": [
                    {
                        "scroll-px": X()
                    }
                ],
                "scroll-py": [
                    {
                        "scroll-py": X()
                    }
                ],
                "scroll-ps": [
                    {
                        "scroll-ps": X()
                    }
                ],
                "scroll-pe": [
                    {
                        "scroll-pe": X()
                    }
                ],
                "scroll-pt": [
                    {
                        "scroll-pt": X()
                    }
                ],
                "scroll-pr": [
                    {
                        "scroll-pr": X()
                    }
                ],
                "scroll-pb": [
                    {
                        "scroll-pb": X()
                    }
                ],
                "scroll-pl": [
                    {
                        "scroll-pl": X()
                    }
                ],
                "snap-align": [
                    {
                        snap: [
                            "start",
                            "end",
                            "center",
                            "align-none"
                        ]
                    }
                ],
                "snap-stop": [
                    {
                        snap: [
                            "normal",
                            "always"
                        ]
                    }
                ],
                "snap-type": [
                    {
                        snap: [
                            "none",
                            "x",
                            "y",
                            "both"
                        ]
                    }
                ],
                "snap-strictness": [
                    {
                        snap: [
                            "mandatory",
                            "proximity"
                        ]
                    }
                ],
                touch: [
                    {
                        touch: [
                            "auto",
                            "none",
                            "manipulation"
                        ]
                    }
                ],
                "touch-x": [
                    {
                        "touch-pan": [
                            "x",
                            "left",
                            "right"
                        ]
                    }
                ],
                "touch-y": [
                    {
                        "touch-pan": [
                            "y",
                            "up",
                            "down"
                        ]
                    }
                ],
                "touch-pz": [
                    "touch-pinch-zoom"
                ],
                select: [
                    {
                        select: [
                            "none",
                            "text",
                            "all",
                            "auto"
                        ]
                    }
                ],
                "will-change": [
                    {
                        "will-change": [
                            "auto",
                            "scroll",
                            "contents",
                            "transform",
                            vt,
                            xt
                        ]
                    }
                ],
                fill: [
                    {
                        fill: [
                            "none",
                            ...N()
                        ]
                    }
                ],
                "stroke-w": [
                    {
                        stroke: [
                            cn,
                            wb,
                            rf,
                            b5
                        ]
                    }
                ],
                stroke: [
                    {
                        stroke: [
                            "none",
                            ...N()
                        ]
                    }
                ],
                "forced-color-adjust": [
                    {
                        "forced-color-adjust": [
                            "auto",
                            "none"
                        ]
                    }
                ]
            },
            conflictingClassGroups: {
                overflow: [
                    "overflow-x",
                    "overflow-y"
                ],
                overscroll: [
                    "overscroll-x",
                    "overscroll-y"
                ],
                inset: [
                    "inset-x",
                    "inset-y",
                    "start",
                    "end",
                    "top",
                    "right",
                    "bottom",
                    "left"
                ],
                "inset-x": [
                    "right",
                    "left"
                ],
                "inset-y": [
                    "top",
                    "bottom"
                ],
                flex: [
                    "basis",
                    "grow",
                    "shrink"
                ],
                gap: [
                    "gap-x",
                    "gap-y"
                ],
                p: [
                    "px",
                    "py",
                    "ps",
                    "pe",
                    "pt",
                    "pr",
                    "pb",
                    "pl"
                ],
                px: [
                    "pr",
                    "pl"
                ],
                py: [
                    "pt",
                    "pb"
                ],
                m: [
                    "mx",
                    "my",
                    "ms",
                    "me",
                    "mt",
                    "mr",
                    "mb",
                    "ml"
                ],
                mx: [
                    "mr",
                    "ml"
                ],
                my: [
                    "mt",
                    "mb"
                ],
                size: [
                    "w",
                    "h"
                ],
                "font-size": [
                    "leading"
                ],
                "fvn-normal": [
                    "fvn-ordinal",
                    "fvn-slashed-zero",
                    "fvn-figure",
                    "fvn-spacing",
                    "fvn-fraction"
                ],
                "fvn-ordinal": [
                    "fvn-normal"
                ],
                "fvn-slashed-zero": [
                    "fvn-normal"
                ],
                "fvn-figure": [
                    "fvn-normal"
                ],
                "fvn-spacing": [
                    "fvn-normal"
                ],
                "fvn-fraction": [
                    "fvn-normal"
                ],
                "line-clamp": [
                    "display",
                    "overflow"
                ],
                rounded: [
                    "rounded-s",
                    "rounded-e",
                    "rounded-t",
                    "rounded-r",
                    "rounded-b",
                    "rounded-l",
                    "rounded-ss",
                    "rounded-se",
                    "rounded-ee",
                    "rounded-es",
                    "rounded-tl",
                    "rounded-tr",
                    "rounded-br",
                    "rounded-bl"
                ],
                "rounded-s": [
                    "rounded-ss",
                    "rounded-es"
                ],
                "rounded-e": [
                    "rounded-se",
                    "rounded-ee"
                ],
                "rounded-t": [
                    "rounded-tl",
                    "rounded-tr"
                ],
                "rounded-r": [
                    "rounded-tr",
                    "rounded-br"
                ],
                "rounded-b": [
                    "rounded-br",
                    "rounded-bl"
                ],
                "rounded-l": [
                    "rounded-tl",
                    "rounded-bl"
                ],
                "border-spacing": [
                    "border-spacing-x",
                    "border-spacing-y"
                ],
                "border-w": [
                    "border-w-x",
                    "border-w-y",
                    "border-w-s",
                    "border-w-e",
                    "border-w-t",
                    "border-w-r",
                    "border-w-b",
                    "border-w-l"
                ],
                "border-w-x": [
                    "border-w-r",
                    "border-w-l"
                ],
                "border-w-y": [
                    "border-w-t",
                    "border-w-b"
                ],
                "border-color": [
                    "border-color-x",
                    "border-color-y",
                    "border-color-s",
                    "border-color-e",
                    "border-color-t",
                    "border-color-r",
                    "border-color-b",
                    "border-color-l"
                ],
                "border-color-x": [
                    "border-color-r",
                    "border-color-l"
                ],
                "border-color-y": [
                    "border-color-t",
                    "border-color-b"
                ],
                translate: [
                    "translate-x",
                    "translate-y",
                    "translate-none"
                ],
                "translate-none": [
                    "translate",
                    "translate-x",
                    "translate-y",
                    "translate-z"
                ],
                "scroll-m": [
                    "scroll-mx",
                    "scroll-my",
                    "scroll-ms",
                    "scroll-me",
                    "scroll-mt",
                    "scroll-mr",
                    "scroll-mb",
                    "scroll-ml"
                ],
                "scroll-mx": [
                    "scroll-mr",
                    "scroll-ml"
                ],
                "scroll-my": [
                    "scroll-mt",
                    "scroll-mb"
                ],
                "scroll-p": [
                    "scroll-px",
                    "scroll-py",
                    "scroll-ps",
                    "scroll-pe",
                    "scroll-pt",
                    "scroll-pr",
                    "scroll-pb",
                    "scroll-pl"
                ],
                "scroll-px": [
                    "scroll-pr",
                    "scroll-pl"
                ],
                "scroll-py": [
                    "scroll-pt",
                    "scroll-pb"
                ],
                touch: [
                    "touch-x",
                    "touch-y",
                    "touch-pz"
                ],
                "touch-x": [
                    "touch"
                ],
                "touch-y": [
                    "touch"
                ],
                "touch-pz": [
                    "touch"
                ]
            },
            conflictingClassGroupModifiers: {
                "font-size": [
                    "leading"
                ]
            },
            orderSensitiveModifiers: [
                "*",
                "**",
                "after",
                "backdrop",
                "before",
                "details-content",
                "file",
                "first-letter",
                "first-line",
                "marker",
                "placeholder",
                "selection"
            ]
        };
    }, Oie = uie(Pie), Mie = "/assets/midnight_ledger_wasm_bg-fHO7eNd8.wasm";
    function Rie() {
        return f2;
    }
    function Nie() {
        return mo;
    }
    let b;
    function Vie(t) {
        b = t;
    }
    function Cr(t) {
        const e = b.__externref_table_alloc();
        return b.__wbindgen_export_2.set(e, t), e;
    }
    function oi(t, e) {
        try {
            return t.apply(this, e);
        } catch (n) {
            const r = Cr(n);
            b.__wbindgen_exn_store(r);
        }
    }
    let Dw = null;
    function hm() {
        return (Dw === null || Dw.byteLength === 0) && (Dw = new Uint8Array(b.memory.buffer)), Dw;
    }
    let w_ = new TextDecoder("utf-8", {
        ignoreBOM: !0,
        fatal: !0
    });
    w_.decode();
    const Die = 2146435072;
    let m5 = 0;
    function Bie(t, e) {
        return m5 += e, m5 >= Die && (w_ = new TextDecoder("utf-8", {
            ignoreBOM: !0,
            fatal: !0
        }), w_.decode(), m5 = e), w_.decode(hm().subarray(t, t + e));
    }
    function He(t, e) {
        return t = t >>> 0, Bie(t, e);
    }
    let Je = 0;
    const gm = new TextEncoder;
    "encodeInto" in gm || (gm.encodeInto = function(t, e) {
        const n = gm.encode(t);
        return e.set(n), {
            read: t.length,
            written: n.length
        };
    });
    function ft(t, e, n) {
        if (n === void 0) {
            const a = gm.encode(t), c = e(a.length, 1) >>> 0;
            return hm().subarray(c, c + a.length).set(a), Je = a.length, c;
        }
        let r = t.length, s = e(r, 1) >>> 0;
        const i = hm();
        let o = 0;
        for(; o < r; o++){
            const a = t.charCodeAt(o);
            if (a > 127) break;
            i[s + o] = a;
        }
        if (o !== r) {
            o !== 0 && (t = t.slice(o)), s = n(s, r, r = o + t.length * 3, 1) >>> 0;
            const a = hm().subarray(s + o, s + r), c = gm.encodeInto(t, a);
            o += c.written, s = n(s, r, o, 1) >>> 0;
        }
        return Je = o, s;
    }
    let gh = null;
    function aa() {
        return (gh === null || gh.buffer.detached === !0 || gh.buffer.detached === void 0 && gh.buffer !== b.memory.buffer) && (gh = new DataView(b.memory.buffer)), gh;
    }
    function Xe(t) {
        return t == null;
    }
    function Jx(t, e) {
        return t = t >>> 0, hm().subarray(t / 1, t / 1 + e);
    }
    function Y7(t) {
        const e = typeof t;
        if (e == "number" || e == "boolean" || t == null) return `${t}`;
        if (e == "string") return `"${t}"`;
        if (e == "symbol") {
            const s = t.description;
            return s == null ? "Symbol" : `Symbol(${s})`;
        }
        if (e == "function") {
            const s = t.name;
            return typeof s == "string" && s.length > 0 ? `Function(${s})` : "Function";
        }
        if (Array.isArray(t)) {
            const s = t.length;
            let i = "[";
            s > 0 && (i += Y7(t[0]));
            for(let o = 1; o < s; o++)i += ", " + Y7(t[o]);
            return i += "]", i;
        }
        const n = /\[object ([^\]]+)\]/.exec(toString.call(t));
        let r;
        if (n && n.length > 1) r = n[1];
        else return toString.call(t);
        if (r == "Object") try {
            return "Object(" + JSON.stringify(t) + ")";
        } catch  {
            return "Object";
        }
        return t instanceof Error ? `${t.name}: ${t.message}
${t.stack}` : r;
    }
    function as(t, e) {
        t = t >>> 0;
        const n = aa(), r = [];
        for(let s = t; s < t + 4 * e; s += 4)r.push(b.__wbindgen_export_2.get(n.getUint32(s, !0)));
        return b.__externref_drop_slice(t, e), r;
    }
    const OM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>{
        b.__wbindgen_export_7.get(t.dtor)(t.a, t.b);
    });
    function Fie(t, e, n, r) {
        const s = {
            a: t,
            b: e,
            cnt: 1,
            dtor: n
        }, i = (...o)=>{
            s.cnt++;
            const a = s.a;
            s.a = 0;
            try {
                return r(a, s.b, ...o);
            } finally{
                --s.cnt === 0 ? (b.__wbindgen_export_7.get(s.dtor)(a, s.b), OM.unregister(s)) : s.a = a;
            }
        };
        return i.original = s, OM.register(i, s, s), i;
    }
    function yt(t, e) {
        if (!(t instanceof e)) throw new Error(`expected instance of ${e.name}`);
    }
    function W(t) {
        const e = b.__wbindgen_export_2.get(t);
        return b.__externref_table_dealloc(t), e;
    }
    function Qo(t, e) {
        const n = e(t.length * 4, 4) >>> 0;
        for(let r = 0; r < t.length; r++){
            const s = Cr(t[r]);
            aa().setUint32(n + 4 * r, s, !0);
        }
        return Je = t.length, n;
    }
    function Lie(t, e) {
        let n, r;
        try {
            const o = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = b.coinCommitment(t, o, a);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, W(c[2]);
            return n = s, r = i, He(s, i);
        } finally{
            b.__wbindgen_free(n, r, 1);
        }
    }
    function y5(t, e) {
        const n = ft(t, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.createShieldedCoinInfo(n, r, e);
        if (s[2]) throw W(s[1]);
        return W(s[0]);
    }
    function zie(t, e) {
        let n, r;
        try {
            yt(e, o0);
            const o = b.coinNullifier(t, e.__wbg_ptr);
            var s = o[0], i = o[1];
            if (o[3]) throw s = 0, i = 0, W(o[2]);
            return n = s, r = i, He(s, i);
        } finally{
            b.__wbindgen_free(n, r, 1);
        }
    }
    function Yx() {
        const t = b.nativeToken();
        if (t[2]) throw W(t[1]);
        return W(t[0]);
    }
    function _H(t) {
        let e, n;
        try {
            const i = ft(t, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = b.addressFromKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, W(a[2]);
            return e = r, n = s, He(r, s);
        } finally{
            b.__wbindgen_free(e, n, 1);
        }
    }
    function KT(t, e) {
        const n = b.createCheckPayload(t, Xe(e) ? 0 : Cr(e));
        if (n[2]) throw W(n[1]);
        return W(n[0]);
    }
    function $T(t) {
        const e = b.parseCheckResult(t);
        if (e[2]) throw W(e[1]);
        return W(e[0]);
    }
    function XT(t, e, n) {
        const r = b.createProvingPayload(t, Xe(e) ? 0 : Cr(e), n);
        if (r[2]) throw W(r[1]);
        return W(r[0]);
    }
    function MM(t, e, n, r, s) {
        const i = b.updatedValue(t, e, n, r, s);
        if (i[2]) throw W(i[1]);
        return W(i[0]);
    }
    function xH(t) {
        let e, n;
        try {
            const i = ft(t, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = b.signatureVerifyingKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, W(a[2]);
            return e = r, n = s, He(r, s);
        } finally{
            b.__wbindgen_free(e, n, 1);
        }
    }
    function Uie() {
        let t, e;
        try {
            const s = b.sampleSigningKey();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, W(s[2]);
            return t = n, e = r, He(n, r);
        } finally{
            b.__wbindgen_free(t, e, 1);
        }
    }
    function vH(t, e) {
        let n, r;
        try {
            const o = ft(t, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = b.signData(o, a, e);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, W(c[2]);
            return n = s, r = i, He(s, i);
        } finally{
            b.__wbindgen_free(n, r, 1);
        }
    }
    function Hie(t, e, n) {
        b.closure3109_externref_shim(t, e, n);
    }
    function SH(t, e, n, r) {
        b.closure3155_externref_shim(t, e, n, r);
    }
    function jie(t, e, n, r, s) {
        b.closure3158_externref_shim(t, e, n, r, s);
    }
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>b.__wbg_authorizedclaim_free(t >>> 0, 1));
    const w5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_binding_free(t >>> 0, 1));
    class i0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(i0.prototype);
            return n.__wbg_ptr = e, w5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, w5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_binding_free(e, 0);
        }
        static deserialize(e) {
            const n = b.binding_deserialize(e);
            if (n[2]) throw W(n[1]);
            return i0.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.binding_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, w5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.binding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.binding_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.binding_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (i0.prototype[Symbol.dispose] = i0.prototype.free);
    const _5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_chargedstate_free(t >>> 0, 1));
    let tp = class kH {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(kH.prototype);
            return n.__wbg_ptr = e, _5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, _5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_chargedstate_free(e, 0);
        }
        constructor(e){
            yt(e, eu);
            const n = b.chargedstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, _5.register(this, this.__wbg_ptr, this), this;
        }
        get state() {
            const e = b.chargedstate_state(this.__wbg_ptr);
            return eu.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.chargedstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (tp.prototype[Symbol.dispose] = tp.prototype.free);
    const x5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_claimrewardstransaction_free(t >>> 0, 1));
    class Sc {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Sc.prototype);
            return n.__wbg_ptr = e, x5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, x5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_claimrewardstransaction_free(e, 0);
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.claimrewardstransaction_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return Sc.__wrap(i[0]);
        }
        get dataToSign() {
            return b.claimrewardstransaction_dataToSign(this.__wbg_ptr);
        }
        addSignature(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.claimrewardstransaction_addSignature(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return Sc.__wrap(s[0]);
        }
        eraseSignatures() {
            const e = b.claimrewardstransaction_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return Sc.__wrap(e[0]);
        }
        static new(e, n, r, s, i) {
            const o = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), l = Je, u = ft(s, b.__wbindgen_malloc, b.__wbindgen_realloc), d = Je, f = ft(i, b.__wbindgen_malloc, b.__wbindgen_realloc), p = Je, h = b.claimrewardstransaction_new(o, a, n, c, l, u, d, f, p);
            if (h[2]) throw W(h[1]);
            return Sc.__wrap(h[0]);
        }
        get kind() {
            let e, n;
            try {
                const r = b.claimrewardstransaction_kind(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get nonce() {
            let e, n;
            try {
                const i = b.claimrewardstransaction_nonce(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get owner() {
            let e, n;
            try {
                const i = b.claimrewardstransaction_owner(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get value() {
            return b.claimrewardstransaction_value(this.__wbg_ptr);
        }
        constructor(e, n, r, s, i, o, a){
            const c = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), l = Je, u = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), d = Je, f = ft(s, b.__wbindgen_malloc, b.__wbindgen_realloc), p = Je, h = ft(i, b.__wbindgen_malloc, b.__wbindgen_realloc), m = Je, w = b.claimrewardstransaction_construct(c, l, u, d, r, f, p, h, m, o, a);
            if (w[2]) throw W(w[1]);
            return this.__wbg_ptr = w[0] >>> 0, x5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.claimrewardstransaction_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get signature() {
            const e = b.claimrewardstransaction_signature(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.claimrewardstransaction_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Sc.prototype[Symbol.dispose] = Sc.prototype.free);
    const v5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_coinsecretkey_free(t >>> 0, 1));
    class o0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(o0.prototype);
            return n.__wbg_ptr = e, v5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, v5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_coinsecretkey_free(e, 0);
        }
        public_key() {
            let e, n;
            try {
                const i = b.coinsecretkey_public_key(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        constructor(){
            const e = b.coinsecretkey_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, v5.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            b.coinsecretkey_clear(this.__wbg_ptr);
        }
        yesIKnowTheSecurityImplicationsOfThis_serialize() {
            const e = b.coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
    }
    Symbol.dispose && (o0.prototype[Symbol.dispose] = o0.prototype.free);
    const S5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractcall_free(t >>> 0, 1));
    class np {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(np.prototype);
            return n.__wbg_ptr = e, S5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, S5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractcall_free(e, 0);
        }
        get entryPoint() {
            const e = b.contractcall_entryPoint(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get fallibleTranscript() {
            const e = b.contractcall_fallibleTranscript(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get guaranteedTranscript() {
            const e = b.contractcall_guaranteedTranscript(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get communicationCommitment() {
            const e = b.contractcall_communicationCommitment(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        constructor(){
            const e = b.contractcall_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, S5.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = b.contractcall_proof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get address() {
            let e, n;
            try {
                const i = b.contractcall_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractcall_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (np.prototype[Symbol.dispose] = np.prototype.free);
    const RM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractcallprototype_free(t >>> 0, 1));
    class Q7 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, RM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractcallprototype_free(e, 0);
        }
        constructor(e, n, r, s, i, o, a, c, l, u){
            const d = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), f = Je;
            yt(r, c0);
            const p = Qo(o, b.__wbindgen_malloc), h = Je, m = ft(l, b.__wbindgen_malloc, b.__wbindgen_realloc), w = Je, v = ft(u, b.__wbindgen_malloc, b.__wbindgen_realloc), k = Je, _ = b.contractcallprototype_new(d, f, n, r.__wbg_ptr, s, i, p, h, a, c, m, w, v, k);
            if (_[2]) throw W(_[1]);
            return this.__wbg_ptr = _[0] >>> 0, RM.register(this, this.__wbg_ptr, this), this;
        }
        intoCall(e) {
            const n = b.contractcallprototype_intoCall(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return np.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractcallprototype_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Q7.prototype[Symbol.dispose] = Q7.prototype.free);
    const k5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractdeploy_free(t >>> 0, 1));
    class rp {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(rp.prototype);
            return n.__wbg_ptr = e, k5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, k5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractdeploy_free(e, 0);
        }
        get initialState() {
            const e = b.contractdeploy_initialState(this.__wbg_ptr);
            return d0.__wrap(e);
        }
        constructor(e){
            yt(e, d0);
            const n = b.contractdeploy_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, k5.register(this, this.__wbg_ptr, this), this;
        }
        get address() {
            let e, n;
            try {
                const i = b.contractdeploy_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractdeploy_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (rp.prototype[Symbol.dispose] = rp.prototype.free);
    const T5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractmaintenanceauthority_free(t >>> 0, 1));
    let a0 = class e6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(e6.prototype);
            return n.__wbg_ptr = e, T5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, T5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractmaintenanceauthority_free(e, 0);
        }
        static deserialize(e) {
            const n = b.contractmaintenanceauthority_deserialize(e);
            if (n[2]) throw W(n[1]);
            return e6.__wrap(n[0]);
        }
        constructor(e, n, r){
            const s = b.contractmaintenanceauthority_new(e, n, Xe(r) ? 0 : Cr(r));
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, T5.register(this, this.__wbg_ptr, this), this;
        }
        get counter() {
            return b.contractmaintenanceauthority_counter(this.__wbg_ptr);
        }
        get committee() {
            const e = b.contractmaintenanceauthority_committee(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        serialize() {
            const e = b.contractmaintenanceauthority_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get threshold() {
            return b.contractmaintenanceauthority_threshold(this.__wbg_ptr) >>> 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractmaintenanceauthority_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (a0.prototype[Symbol.dispose] = a0.prototype.free);
    const C5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractoperation_free(t >>> 0, 1));
    let c0 = class t6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(t6.prototype);
            return n.__wbg_ptr = e, C5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, C5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractoperation_free(e, 0);
        }
        static deserialize(e) {
            const n = b.contractoperation_deserialize(e);
            if (n[2]) throw W(n[1]);
            return t6.__wrap(n[0]);
        }
        get verifierKey() {
            const e = b.contractoperation_verifier_key(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set verifierKey(e) {
            const n = b.contractoperation_set_verifier_key(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        constructor(){
            const e = b.contractoperation_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, C5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.contractoperation_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractoperation_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (c0.prototype[Symbol.dispose] = c0.prototype.free);
    const E5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractoperationversion_free(t >>> 0, 1));
    class l0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(l0.prototype);
            return n.__wbg_ptr = e, E5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, E5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractoperationversion_free(e, 0);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.contractoperationversion_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, E5.register(this, this.__wbg_ptr, this), this;
        }
        get version() {
            let e, n;
            try {
                const r = b.contractoperationversion_version(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractoperationversion_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (l0.prototype[Symbol.dispose] = l0.prototype.free);
    const I5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractoperationversionedverifierkey_free(t >>> 0, 1));
    class u0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(u0.prototype);
            return n.__wbg_ptr = e, I5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, I5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractoperationversionedverifierkey_free(e, 0);
        }
        constructor(e, n){
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.contractoperationversionedverifierkey_new(r, s, n);
            if (i[2]) throw W(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, I5.register(this, this.__wbg_ptr, this), this;
        }
        get rawVk() {
            const e = b.contractoperationversionedverifierkey_raw_vk(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get version() {
            let e, n;
            try {
                const r = b.contractoperationversionedverifierkey_version(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractoperationversionedverifierkey_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (u0.prototype[Symbol.dispose] = u0.prototype.free);
    const A5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_contractstate_free(t >>> 0, 1));
    let d0 = class n6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(n6.prototype);
            return n.__wbg_ptr = e, A5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, A5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_contractstate_free(e, 0);
        }
        operations() {
            const e = b.contractstate_operations(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e) {
            const n = b.contractstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return n6.__wrap(n[0]);
        }
        set balance(e) {
            const n = b.contractstate_set_balance(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        setOperation(e, n) {
            yt(n, c0);
            const r = b.contractstate_setOperation(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[1]) throw W(r[0]);
        }
        get maintenanceAuthority() {
            const e = b.contractstate_maintenance_authority(this.__wbg_ptr);
            return a0.__wrap(e);
        }
        set maintenanceAuthority(e) {
            yt(e, a0), b.contractstate_set_maintenance_authority(this.__wbg_ptr, e.__wbg_ptr);
        }
        constructor(){
            const e = b.contractstate_new();
            return this.__wbg_ptr = e >>> 0, A5.register(this, this.__wbg_ptr, this), this;
        }
        get data() {
            const e = b.contractstate_data(this.__wbg_ptr);
            return tp.__wrap(e);
        }
        query(e, n) {
            yt(n, bd);
            const r = b.contractstate_query(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        get balance() {
            const e = b.contractstate_balance(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set data(e) {
            yt(e, tp), b.contractstate_set_data(this.__wbg_ptr, e.__wbg_ptr);
        }
        operation(e) {
            const n = b.contractstate_operation(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return n[0] === 0 ? void 0 : c0.__wrap(n[0]);
        }
        serialize() {
            const e = b.contractstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.contractstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (d0.prototype[Symbol.dispose] = d0.prototype.free);
    const P5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_costmodel_free(t >>> 0, 1));
    let bd = class r6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(r6.prototype);
            return n.__wbg_ptr = e, P5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, P5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_costmodel_free(e, 0);
        }
        static initialCostModel() {
            const e = b.costmodel_initialCostModel();
            return r6.__wrap(e);
        }
        constructor(){
            const e = b.costmodel_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, P5.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.costmodel_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (bd.prototype[Symbol.dispose] = bd.prototype.free);
    const O5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustactions_free(t >>> 0, 1));
    class Oa {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Oa.prototype);
            return n.__wbg_ptr = e, O5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, O5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustactions_free(e, 0);
        }
        set spends(e) {
            const n = b.dustactions_set_spends(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        static deserialize(e, n, r) {
            const s = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je, o = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = b.dustactions_deserialize(s, i, o, a, r);
            if (c[2]) throw W(c[1]);
            return Oa.__wrap(c[0]);
        }
        get registrations() {
            const e = b.dustactions_registrations(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        set registrations(e) {
            const n = b.dustactions_set_registrations(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        constructor(e, n, r, s, i){
            const o = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), l = Je, u = b.dustactions_new(o, a, c, l, r, s, i);
            if (u[2]) throw W(u[1]);
            return this.__wbg_ptr = u[0] >>> 0, O5.register(this, this.__wbg_ptr, this), this;
        }
        get ctime() {
            return b.dustactions_ctime(this.__wbg_ptr);
        }
        get spends() {
            const e = b.dustactions_spends(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        serialize() {
            const e = b.dustactions_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set ctime(e) {
            const n = b.dustactions_set_ctime(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustactions_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Oa.prototype[Symbol.dispose] = Oa.prototype.free);
    const M5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustgenerationstate_free(t >>> 0, 1));
    class f0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(f0.prototype);
            return n.__wbg_ptr = e, M5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, M5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustgenerationstate_free(e, 0);
        }
        static deserialize(e) {
            const n = b.dustgenerationstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return f0.__wrap(n[0]);
        }
        constructor(){
            const e = b.dustgenerationstate_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, M5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.dustgenerationstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustgenerationstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (f0.prototype[Symbol.dispose] = f0.prototype.free);
    const R5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustlocalstate_free(t >>> 0, 1));
    class ea {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ea.prototype);
            return n.__wbg_ptr = e, R5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, R5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustlocalstate_free(e, 0);
        }
        static deserialize(e) {
            const n = b.dustlocalstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return ea.__wrap(n[0]);
        }
        processTtls(e) {
            const n = b.dustlocalstate_processTtls(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return ea.__wrap(n[0]);
        }
        replayEvents(e, n) {
            yt(e, Va);
            const r = Qo(n, b.__wbindgen_malloc), s = Je, i = b.dustlocalstate_replayEvents(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw W(i[1]);
            return ea.__wrap(i[0]);
        }
        walletBalance(e) {
            return b.dustlocalstate_walletBalance(this.__wbg_ptr, e);
        }
        generationInfo(e) {
            const n = b.dustlocalstate_generationInfo(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return W(n[0]);
        }
        replayEventsWithChanges(e, n) {
            yt(e, Va);
            const r = Qo(n, b.__wbindgen_malloc), s = Je, i = b.dustlocalstate_replayEventsWithChanges(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw W(i[1]);
            return Dm.__wrap(i[0]);
        }
        constructor(e){
            yt(e, md);
            const n = b.dustlocalstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, R5.register(this, this.__wbg_ptr, this), this;
        }
        spend(e, n, r, s) {
            yt(e, Va);
            const i = b.dustlocalstate_spend(this.__wbg_ptr, e.__wbg_ptr, n, r, s);
            if (i[2]) throw W(i[1]);
            return W(i[0]);
        }
        get utxos() {
            const e = b.dustlocalstate_utxos(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get params() {
            const e = b.dustlocalstate_params(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return md.__wrap(e[0]);
        }
        serialize() {
            const e = b.dustlocalstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get syncTime() {
            return b.dustlocalstate_syncTime(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustlocalstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (ea.prototype[Symbol.dispose] = ea.prototype.free);
    const NM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustlocalstatewithchanges_free(t >>> 0, 1));
    class Dm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Dm.prototype);
            return n.__wbg_ptr = e, NM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, NM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustlocalstatewithchanges_free(e, 0);
        }
        get state() {
            const e = b.dustlocalstatewithchanges_state(this.__wbg_ptr);
            return ea.__wrap(e);
        }
        get changes() {
            const e = b.dustlocalstatewithchanges_changes(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
    }
    Symbol.dispose && (Dm.prototype[Symbol.dispose] = Dm.prototype.free);
    const N5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustparameters_free(t >>> 0, 1));
    class md {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(md.prototype);
            return n.__wbg_ptr = e, N5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, N5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustparameters_free(e, 0);
        }
        static deserialize(e) {
            const n = b.dustparameters_deserialize(e);
            if (n[2]) throw W(n[1]);
            return md.__wrap(n[0]);
        }
        get nightDustRatio() {
            return b.dustparameters_nightDustRatio(this.__wbg_ptr);
        }
        get timeToCapSeconds() {
            return b.dustparameters_timeToCapSeconds(this.__wbg_ptr);
        }
        set nightDustRatio(e) {
            const n = b.dustparameters_set_nightDustRatio(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        get generationDecayRate() {
            return b.dustparameters_generationDecayRate(this.__wbg_ptr);
        }
        get dustGracePeriodSeconds() {
            return b.dustparameters_dustGracePeriodSeconds(this.__wbg_ptr);
        }
        set generationDecayRate(e) {
            const n = b.dustparameters_set_generationDecayRate(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        set dustGracePeriodSeconds(e) {
            const n = b.dustparameters_set_dustGracePeriodSeconds(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        constructor(e, n, r){
            const s = b.dustparameters_new(e, n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, N5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.dustparameters_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustparameters_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (md.prototype[Symbol.dispose] = md.prototype.free);
    const V5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustregistration_free(t >>> 0, 1));
    class Ql {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ql.prototype);
            return n.__wbg_ptr = e, V5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, V5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustregistration_free(e, 0);
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.dustregistration_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return Ql.__wrap(i[0]);
        }
        get dustAddress() {
            return b.dustregistration_dustAddress(this.__wbg_ptr);
        }
        set nightKey(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.dustregistration_set_nightKey(this.__wbg_ptr, n, r);
            if (s[1]) throw W(s[0]);
        }
        set signature(e) {
            const n = b.dustregistration_set_signature(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        set dustAddress(e) {
            const n = b.dustregistration_set_dustAddress(this.__wbg_ptr, Xe(e) ? 0 : Cr(e));
            if (n[1]) throw W(n[0]);
        }
        get allowFeePayment() {
            return b.dustregistration_allowFeePayment(this.__wbg_ptr);
        }
        set allowFeePayment(e) {
            const n = b.dustregistration_set_allowFeePayment(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        constructor(e, n, r, s, i){
            const o = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), a = Je, c = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), l = Je, u = b.dustregistration_new(o, a, c, l, Xe(r) ? 0 : Cr(r), s, i);
            if (u[2]) throw W(u[1]);
            return this.__wbg_ptr = u[0] >>> 0, V5.register(this, this.__wbg_ptr, this), this;
        }
        get nightKey() {
            let e, n;
            try {
                const i = b.dustregistration_nightKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.dustregistration_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get signature() {
            const e = b.dustregistration_signature(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustregistration_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Ql.prototype[Symbol.dispose] = Ql.prototype.free);
    const D5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustsecretkey_free(t >>> 0, 1));
    class Va {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Va.prototype);
            return n.__wbg_ptr = e, D5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, D5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustsecretkey_free(e, 0);
        }
        get publicKey() {
            const e = b.dustsecretkey_publicKey(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        static fromBigint(e) {
            const n = b.dustsecretkey_fromBigint(e);
            if (n[2]) throw W(n[1]);
            return Va.__wrap(n[0]);
        }
        constructor(){
            const e = b.dustsecretkey_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, D5.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            b.dustsecretkey_clear(this.__wbg_ptr);
        }
        static fromSeed(e) {
            const n = b.dustsecretkey_fromSeed(e);
            if (n[2]) throw W(n[1]);
            return Va.__wrap(n[0]);
        }
    }
    Symbol.dispose && (Va.prototype[Symbol.dispose] = Va.prototype.free);
    const B5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustspend_free(t >>> 0, 1));
    class p0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(p0.prototype);
            return n.__wbg_ptr = e, B5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, B5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustspend_free(e, 0);
        }
        get oldNullifier() {
            return b.dustspend_oldNullifier(this.__wbg_ptr);
        }
        get newCommitment() {
            return b.dustspend_newCommitment(this.__wbg_ptr);
        }
        constructor(){
            const e = b.dustspend_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, B5.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = b.dustspend_proof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get vFee() {
            return b.dustspend_vFee(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustspend_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (p0.prototype[Symbol.dispose] = p0.prototype.free);
    const F5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_duststate_free(t >>> 0, 1));
    class h0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(h0.prototype);
            return n.__wbg_ptr = e, F5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, F5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_duststate_free(e, 0);
        }
        get generation() {
            const e = b.duststate_generation(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return f0.__wrap(e[0]);
        }
        static deserialize(e) {
            const n = b.duststate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return h0.__wrap(n[0]);
        }
        constructor(){
            const e = b.duststate_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, F5.register(this, this.__wbg_ptr, this), this;
        }
        get utxo() {
            const e = b.duststate_utxo(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return g0.__wrap(e[0]);
        }
        serialize() {
            const e = b.duststate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.duststate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (h0.prototype[Symbol.dispose] = h0.prototype.free);
    const VM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_duststatechanges_free(t >>> 0, 1));
    class Bm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Bm.prototype);
            return n.__wbg_ptr = e, VM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, VM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_duststatechanges_free(e, 0);
        }
        get spentUtxos() {
            const e = b.duststatechanges_spentUtxos(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get receivedUtxos() {
            const e = b.duststatechanges_receivedUtxos(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get source() {
            let e, n;
            try {
                const i = b.duststatechanges_source(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
    }
    Symbol.dispose && (Bm.prototype[Symbol.dispose] = Bm.prototype.free);
    const L5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_dustutxostate_free(t >>> 0, 1));
    class g0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(g0.prototype);
            return n.__wbg_ptr = e, L5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, L5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_dustutxostate_free(e, 0);
        }
        static deserialize(e) {
            const n = b.dustutxostate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return g0.__wrap(n[0]);
        }
        constructor(){
            const e = b.dustutxostate_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, L5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.dustutxostate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.dustutxostate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (g0.prototype[Symbol.dispose] = g0.prototype.free);
    const z5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_encryptionsecretkey_free(t >>> 0, 1));
    class Df {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Df.prototype);
            return n.__wbg_ptr = e, z5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, z5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_encryptionsecretkey_free(e, 0);
        }
        public_key() {
            let e, n;
            try {
                const i = b.encryptionsecretkey_public_key(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e) {
            const n = b.encryptionsecretkey_deserialize(e);
            if (n[2]) throw W(n[1]);
            return Df.__wrap(n[0]);
        }
        yesIKnowTheSecurityImplicationsOfThis_taggedSerialize() {
            const e = b.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        static taggedDeserialize(e) {
            const n = b.encryptionsecretkey_taggedDeserialize(e);
            if (n[2]) throw W(n[1]);
            return Df.__wrap(n[0]);
        }
        constructor(){
            const e = b.encryptionsecretkey_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, z5.register(this, this.__wbg_ptr, this), this;
        }
        test(e) {
            yt(e, is);
            const n = b.encryptionsecretkey_test(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return n[0] !== 0;
        }
        clear() {
            b.encryptionsecretkey_clear(this.__wbg_ptr);
        }
        yesIKnowTheSecurityImplicationsOfThis_serialize() {
            const e = b.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
    }
    Symbol.dispose && (Df.prototype[Symbol.dispose] = Df.prototype.free);
    const U5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_event_free(t >>> 0, 1));
    let yd = class __ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(__.prototype);
            return n.__wbg_ptr = e, U5.register(n, n.__wbg_ptr, n), n;
        }
        static __unwrap(e) {
            return e instanceof __ ? e.__destroy_into_raw() : 0;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, U5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_event_free(e, 0);
        }
        static deserialize(e) {
            const n = b.event_deserialize(e);
            if (n[2]) throw W(n[1]);
            return __.__wrap(n[0]);
        }
        constructor(){
            const e = b.event_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, U5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.event_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.event_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (yd.prototype[Symbol.dispose] = yd.prototype.free);
    const H5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_intent_free(t >>> 0, 1));
    class Zr {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Zr.prototype);
            return n.__wbg_ptr = e, H5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, H5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_intent_free(e, 0);
        }
        addDeploy(e) {
            yt(e, rp);
            const n = b.intent_addDeploy(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return Zr.__wrap(n[0]);
        }
        static deserialize(e, n, r, s) {
            const i = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), c = Je, l = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), u = Je, d = b.intent_deserialize(i, o, a, c, l, u, s);
            if (d[2]) throw W(d[1]);
            return Zr.__wrap(d[0]);
        }
        intentHash(e) {
            let n, r;
            try {
                const o = b.intent_intentHash(this.__wbg_ptr, e);
                var s = o[0], i = o[1];
                if (o[3]) throw s = 0, i = 0, W(o[2]);
                return n = s, r = i, He(s, i);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
        set actions(e) {
            const n = Qo(e, b.__wbindgen_malloc), r = Je, s = b.intent_set_actions(this.__wbg_ptr, n, r);
            if (s[1]) throw W(s[0]);
        }
        get dustActions() {
            const e = b.intent_dustActions(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        eraseProofs() {
            const e = b.intent_eraseProofs(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return Zr.__wrap(e[0]);
        }
        signatureData(e) {
            return b.intent_signatureData(this.__wbg_ptr, e);
        }
        eraseSignatures() {
            const e = b.intent_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return Zr.__wrap(e[0]);
        }
        set dustActions(e) {
            const n = b.intent_set_dustActions(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        addMaintenanceUpdate(e) {
            yt(e, wd);
            const n = b.intent_addMaintenanceUpdate(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return Zr.__wrap(n[0]);
        }
        get fallibleUnshieldedOffer() {
            const e = b.intent_fallibleUnshieldedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : mo.__wrap(e);
        }
        get guaranteedUnshieldedOffer() {
            const e = b.intent_guaranteedUnshieldedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : mo.__wrap(e);
        }
        set fallibleUnshieldedOffer(e) {
            const n = b.intent_set_fallibleUnshieldedOffer(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        set guaranteedUnshieldedOffer(e) {
            const n = b.intent_set_guaranteedUnshieldedOffer(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        static new(e) {
            const n = b.intent_new(e);
            if (n[2]) throw W(n[1]);
            return Zr.__wrap(n[0]);
        }
        get ttl() {
            return b.intent_ttl(this.__wbg_ptr);
        }
        bind(e) {
            const n = b.intent_bind(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return Zr.__wrap(n[0]);
        }
        get actions() {
            const e = b.intent_actions(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get binding() {
            const e = b.intent_binding(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set ttl(e) {
            b.intent_set_ttl(this.__wbg_ptr, e);
        }
        addCall(e) {
            yt(e, Q7);
            const n = b.intent_addCall(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return Zr.__wrap(n[0]);
        }
        constructor(){
            const e = b.intent_construct();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, H5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.intent_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.intent_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Zr.prototype[Symbol.dispose] = Zr.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>b.__wbg_intounderlyingbytesource_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>b.__wbg_intounderlyingsink_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>b.__wbg_intounderlyingsource_free(t >>> 0, 1));
    const j5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_ledgerparameters_free(t >>> 0, 1));
    class wi {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(wi.prototype);
            return n.__wbg_ptr = e, j5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, j5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_ledgerparameters_free(e, 0);
        }
        get feePrices() {
            const e = b.ledgerparameters_feePrices(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        static deserialize(e) {
            const n = b.ledgerparameters_deserialize(e);
            if (n[2]) throw W(n[1]);
            return wi.__wrap(n[0]);
        }
        static initialParameters() {
            const e = b.ledgerparameters_initialParameters();
            return wi.__wrap(e);
        }
        normalizeFullness(e) {
            const n = b.ledgerparameters_normalizeFullness(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return W(n[0]);
        }
        maxPriceAdjustment() {
            return b.ledgerparameters_maxPriceAdjustment(this.__wbg_ptr);
        }
        get transactionCostModel() {
            const e = b.ledgerparameters_transactionCostModel(this.__wbg_ptr);
            return Bf.__wrap(e);
        }
        constructor(){
            const e = b.ledgerparameters_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, j5.register(this, this.__wbg_ptr, this), this;
        }
        get dust() {
            const e = b.ledgerparameters_dust(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return md.__wrap(e[0]);
        }
        serialize() {
            const e = b.ledgerparameters_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.ledgerparameters_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (wi.prototype[Symbol.dispose] = wi.prototype.free);
    const q5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_ledgerstate_free(t >>> 0, 1));
    class Wo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Wo.prototype);
            return n.__wbg_ptr = e, q5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, q5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_ledgerstate_free(e, 0);
        }
        get parameters() {
            const e = b.ledgerstate_parameters(this.__wbg_ptr);
            return wi.__wrap(e);
        }
        static deserialize(e) {
            const n = b.ledgerstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return Wo.__wrap(n[0]);
        }
        get lockedPool() {
            return b.ledgerstate_locked_pool(this.__wbg_ptr);
        }
        get reservePool() {
            return b.ledgerstate_reserve_pool(this.__wbg_ptr);
        }
        updateIndex(e, n, r) {
            const s = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je;
            yt(n, tp);
            const o = b.ledgerstate_updateIndex(this.__wbg_ptr, s, i, n.__wbg_ptr, r);
            if (o[2]) throw W(o[1]);
            return Wo.__wrap(o[0]);
        }
        set parameters(e) {
            yt(e, wi), b.ledgerstate_set_parameters(this.__wbg_ptr, e.__wbg_ptr);
        }
        applySystemTx(e, n) {
            yt(e, S0);
            const r = b.ledgerstate_applySystemTx(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        bridgeReceiving(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.ledgerstate_bridgeReceiving(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return W(s[0]);
        }
        testingDistributeNight(e, n, r) {
            const s = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je, o = b.ledgerstate_testingDistributeNight(this.__wbg_ptr, s, i, n, r);
            if (o[2]) throw W(o[1]);
            return Wo.__wrap(o[0]);
        }
        treasuryBalance(e) {
            const n = b.ledgerstate_treasuryBalance(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return W(n[0]);
        }
        get blockRewardPool() {
            return b.ledgerstate_block_reward_pool(this.__wbg_ptr);
        }
        postBlockUpdate(e, n, r) {
            const s = b.ledgerstate_postBlockUpdate(this.__wbg_ptr, e, n, r);
            if (s[2]) throw W(s[1]);
            return Wo.__wrap(s[0]);
        }
        unclaimedBlockRewards(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.ledgerstate_unclaimedBlockRewards(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return W(s[0]);
        }
        constructor(e, n){
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je;
            yt(n, fo);
            const i = b.ledgerstate_new(r, s, n.__wbg_ptr);
            return this.__wbg_ptr = i >>> 0, q5.register(this, this.__wbg_ptr, this), this;
        }
        get dust() {
            const e = b.ledgerstate_dust(this.__wbg_ptr);
            return h0.__wrap(e);
        }
        get utxo() {
            const e = b.ledgerstate_utxo(this.__wbg_ptr);
            return Ff.__wrap(e);
        }
        apply(e, n) {
            return yt(e, k0), yt(n, o6), b.ledgerstate_apply(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr);
        }
        static blank(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.ledgerstate_blank(n, r);
            return Wo.__wrap(s);
        }
        index(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.ledgerstate_index(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return s[0] === 0 ? void 0 : d0.__wrap(s[0]);
        }
        get zswap() {
            const e = b.ledgerstate_zswap(this.__wbg_ptr);
            return fo.__wrap(e);
        }
        serialize() {
            const e = b.ledgerstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.ledgerstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Wo.prototype[Symbol.dispose] = Wo.prototype.free);
    const W5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_maintenanceupdate_free(t >>> 0, 1));
    class wd {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(wd.prototype);
            return n.__wbg_ptr = e, W5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, W5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_maintenanceupdate_free(e, 0);
        }
        get signatures() {
            const e = b.maintenanceupdate_signatures(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get dataToSign() {
            return b.maintenanceupdate_data_to_sign(this.__wbg_ptr);
        }
        addSignature(e, n) {
            const r = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.maintenanceupdate_addSignature(this.__wbg_ptr, e, r, s);
            if (i[2]) throw W(i[1]);
            return wd.__wrap(i[0]);
        }
        constructor(e, n, r){
            const s = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je, o = Qo(n, b.__wbindgen_malloc), a = Je, c = b.maintenanceupdate_new(s, i, o, a, r);
            if (c[2]) throw W(c[1]);
            return this.__wbg_ptr = c[0] >>> 0, W5.register(this, this.__wbg_ptr, this), this;
        }
        get address() {
            let e, n;
            try {
                const i = b.maintenanceupdate_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get counter() {
            const e = b.maintenanceupdate_counter(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        get updates() {
            const e = b.maintenanceupdate_updates(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.maintenanceupdate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (wd.prototype[Symbol.dispose] = wd.prototype.free);
    const K5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_merkletreecollapsedupdate_free(t >>> 0, 1));
    class b0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(b0.prototype);
            return n.__wbg_ptr = e, K5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, K5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_merkletreecollapsedupdate_free(e, 0);
        }
        static deserialize(e) {
            const n = b.merkletreecollapsedupdate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return b0.__wrap(n[0]);
        }
        constructor(e, n, r){
            yt(e, fo);
            const s = b.merkletreecollapsedupdate_new(e.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, K5.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.merkletreecollapsedupdate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.merkletreecollapsedupdate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (b0.prototype[Symbol.dispose] = b0.prototype.free);
    const $5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_nobinding_free(t >>> 0, 1));
    class m0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(m0.prototype);
            return n.__wbg_ptr = e, $5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, $5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_nobinding_free(e, 0);
        }
        static deserialize(e) {
            const n = b.nobinding_deserialize(e);
            if (n[2]) throw W(n[1]);
            return m0.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.nobinding_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, $5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.nobinding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.nobinding_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.nobinding_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (m0.prototype[Symbol.dispose] = m0.prototype.free);
    const X5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_noproof_free(t >>> 0, 1));
    class Fm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Fm.prototype);
            return n.__wbg_ptr = e, X5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, X5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_noproof_free(e, 0);
        }
        constructor(){
            const e = b.noproof_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, X5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.noproof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.noproof_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Fm.prototype[Symbol.dispose] = Fm.prototype.free);
    const G5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_prebinding_free(t >>> 0, 1));
    class y0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(y0.prototype);
            return n.__wbg_ptr = e, G5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, G5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_prebinding_free(e, 0);
        }
        static deserialize(e) {
            const n = b.prebinding_deserialize(e);
            if (n[2]) throw W(n[1]);
            return y0.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.prebinding_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, G5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.prebinding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.prebinding_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.prebinding_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (y0.prototype[Symbol.dispose] = y0.prototype.free);
    const DM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_prepartitioncontractcall_free(t >>> 0, 1));
    class s6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, DM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_prepartitioncontractcall_free(e, 0);
        }
        constructor(e, n, r, s, i, o, a, c, l){
            const u = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), d = Je;
            yt(r, c0), yt(s, f2);
            const f = Qo(i, b.__wbindgen_malloc), p = Je, h = ft(c, b.__wbindgen_malloc, b.__wbindgen_realloc), m = Je, w = ft(l, b.__wbindgen_malloc, b.__wbindgen_realloc), v = Je, k = b.prepartitioncontractcall_new(u, d, n, r.__wbg_ptr, s.__wbg_ptr, f, p, o, a, h, m, w, v);
            if (k[2]) throw W(k[1]);
            return this.__wbg_ptr = k[0] >>> 0, DM.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.prepartitioncontractcall_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (s6.prototype[Symbol.dispose] = s6.prototype.free);
    const Z5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_preproof_free(t >>> 0, 1));
    class w0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(w0.prototype);
            return n.__wbg_ptr = e, Z5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Z5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_preproof_free(e, 0);
        }
        static deserialize(e) {
            const n = b.preproof_deserialize(e);
            if (n[2]) throw W(n[1]);
            return w0.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.preproof_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, Z5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.preproof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.preproof_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.preproof_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (w0.prototype[Symbol.dispose] = w0.prototype.free);
    const BM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_pretranscript_free(t >>> 0, 1));
    class f2 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, BM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_pretranscript_free(e, 0);
        }
        constructor(e, n, r){
            yt(e, p2);
            const s = b.pretranscript_new(e.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, BM.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.pretranscript_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (f2.prototype[Symbol.dispose] = f2.prototype.free);
    const J5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_proof_free(t >>> 0, 1));
    class _0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(_0.prototype);
            return n.__wbg_ptr = e, J5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, J5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_proof_free(e, 0);
        }
        static deserialize(e) {
            const n = b.proof_deserialize(e);
            if (n[2]) throw W(n[1]);
            return _0.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.proof_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, J5.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.proof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.proof_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.proof_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (_0.prototype[Symbol.dispose] = _0.prototype.free);
    const Y5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_querycontext_free(t >>> 0, 1));
    let p2 = class x_ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(x_.prototype);
            return n.__wbg_ptr = e, Y5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Y5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_querycontext_free(e, 0);
        }
        get comIndices() {
            const e = b.querycontext_com_indices(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set effects(e) {
            const n = b.querycontext_set_effects(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        toVmStack() {
            const e = b.querycontext_toVmStack(this.__wbg_ptr);
            return a6.__wrap(e);
        }
        runTranscript(e, n) {
            yt(n, bd);
            const r = b.querycontext_runTranscript(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return x_.__wrap(r[0]);
        }
        insertCommitment(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.querycontext_insertCommitment(this.__wbg_ptr, r, s, n);
            if (i[2]) throw W(i[1]);
            return x_.__wrap(i[0]);
        }
        constructor(e, n){
            yt(e, tp);
            const r = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.querycontext_new(e.__wbg_ptr, r, s);
            if (i[2]) throw W(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, Y5.register(this, this.__wbg_ptr, this), this;
        }
        get block() {
            const e = b.querycontext_block(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        query(e, n, r) {
            yt(n, bd);
            const s = b.querycontext_query(this.__wbg_ptr, e, n.__wbg_ptr, r);
            if (s[2]) throw W(s[1]);
            return i6.__wrap(s[0]);
        }
        get state() {
            const e = b.querycontext_state(this.__wbg_ptr);
            return tp.__wrap(e);
        }
        get address() {
            let e, n;
            try {
                const i = b.querycontext_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get effects() {
            const e = b.querycontext_effects(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        qualify(e) {
            const n = b.querycontext_qualify(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return W(n[0]);
        }
        set block(e) {
            const n = b.querycontext_set_block(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.querycontext_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (p2.prototype[Symbol.dispose] = p2.prototype.free);
    const Q5 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_queryresults_free(t >>> 0, 1));
    let i6 = class TH {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(TH.prototype);
            return n.__wbg_ptr = e, Q5.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Q5.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_queryresults_free(e, 0);
        }
        constructor(){
            const e = b.queryresults_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, Q5.register(this, this.__wbg_ptr, this), this;
        }
        get events() {
            const e = b.queryresults_events(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get context() {
            const e = b.queryresults_context(this.__wbg_ptr);
            return p2.__wrap(e);
        }
        get gasCost() {
            const e = b.queryresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.queryresults_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (i6.prototype[Symbol.dispose] = i6.prototype.free);
    const e8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_replaceauthority_free(t >>> 0, 1));
    class x0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(x0.prototype);
            return n.__wbg_ptr = e, e8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, e8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_replaceauthority_free(e, 0);
        }
        constructor(e){
            yt(e, a0);
            const n = b.replaceauthority_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, e8.register(this, this.__wbg_ptr, this), this;
        }
        get authority() {
            const e = b.replaceauthority_authority(this.__wbg_ptr);
            return a0.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.replaceauthority_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (x0.prototype[Symbol.dispose] = x0.prototype.free);
    const t8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_signatureenabled_free(t >>> 0, 1));
    class _d {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(_d.prototype);
            return n.__wbg_ptr = e, t8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, t8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_signatureenabled_free(e, 0);
        }
        static deserialize(e) {
            const n = b.signatureenabled_deserialize(e);
            if (n[2]) throw W(n[1]);
            return _d.__wrap(n[0]);
        }
        constructor(e){
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.signatureenabled_new(n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, t8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.signatureenabled_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.signatureenabled_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.signatureenabled_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (_d.prototype[Symbol.dispose] = _d.prototype.free);
    const n8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_signatureerased_free(t >>> 0, 1));
    class v0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(v0.prototype);
            return n.__wbg_ptr = e, n8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, n8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_signatureerased_free(e, 0);
        }
        constructor(){
            const e = b.signatureerased_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, n8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = b.signatureerased_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = b.signatureerased_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (v0.prototype[Symbol.dispose] = v0.prototype.free);
    const r8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_stateboundedmerkletree_free(t >>> 0, 1));
    let h2 = class Gb {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Gb.prototype);
            return n.__wbg_ptr = e, r8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, r8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_stateboundedmerkletree_free(e, 0);
        }
        pathForLeaf(e, n) {
            const r = b.stateboundedmerkletree_pathForLeaf(this.__wbg_ptr, e, n);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        findPathForLeaf(e) {
            const n = b.stateboundedmerkletree_findPathForLeaf(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return W(n[0]);
        }
        root() {
            const e = b.stateboundedmerkletree_root(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        constructor(e){
            const n = b.stateboundedmerkletree_blank(e);
            return this.__wbg_ptr = n >>> 0, r8.register(this, this.__wbg_ptr, this), this;
        }
        get height() {
            return b.stateboundedmerkletree_height(this.__wbg_ptr);
        }
        rehash() {
            const e = b.stateboundedmerkletree_rehash(this.__wbg_ptr);
            return Gb.__wrap(e);
        }
        update(e, n) {
            const r = b.stateboundedmerkletree_update(this.__wbg_ptr, e, n);
            if (r[2]) throw W(r[1]);
            return Gb.__wrap(r[0]);
        }
        collapse(e, n) {
            const r = b.stateboundedmerkletree_collapse(this.__wbg_ptr, e, n);
            return Gb.__wrap(r);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.stateboundedmerkletree_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (h2.prototype[Symbol.dispose] = h2.prototype.free);
    const s8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_statemap_free(t >>> 0, 1));
    let g2 = class v_ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(v_.prototype);
            return n.__wbg_ptr = e, s8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, s8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_statemap_free(e, 0);
        }
        get(e) {
            const n = b.statemap_get(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return n[0] === 0 ? void 0 : eu.__wrap(n[0]);
        }
        constructor(){
            const e = b.statemap_new();
            return this.__wbg_ptr = e >>> 0, s8.register(this, this.__wbg_ptr, this), this;
        }
        keys() {
            const e = b.statemap_keys(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        insert(e, n) {
            yt(n, eu);
            const r = b.statemap_insert(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return v_.__wrap(r[0]);
        }
        remove(e) {
            const n = b.statemap_remove(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return v_.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.statemap_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (g2.prototype[Symbol.dispose] = g2.prototype.free);
    const i8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_statevalue_free(t >>> 0, 1));
    let eu = class gc {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(gc.prototype);
            return n.__wbg_ptr = e, i8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, i8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_statevalue_free(e, 0);
        }
        arrayPush(e) {
            yt(e, gc);
            const n = b.statevalue_arrayPush(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return gc.__wrap(n[0]);
        }
        asBoundedMerkleTree() {
            const e = b.statevalue_asBoundedMerkleTree(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return e[0] === 0 ? void 0 : h2.__wrap(e[0]);
        }
        static newBoundedMerkleTree(e) {
            yt(e, h2);
            const n = b.statevalue_newBoundedMerkleTree(e.__wbg_ptr);
            return gc.__wrap(n);
        }
        constructor(){
            const e = b.statevalue_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, i8.register(this, this.__wbg_ptr, this), this;
        }
        type() {
            let e, n;
            try {
                const r = b.statevalue_type(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        asMap() {
            const e = b.statevalue_asMap(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return e[0] === 0 ? void 0 : g2.__wrap(e[0]);
        }
        static decode(e) {
            const n = b.statevalue_decode(e);
            if (n[2]) throw W(n[1]);
            return gc.__wrap(n[0]);
        }
        encode() {
            const e = b.statevalue_encode(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        asCell() {
            const e = b.statevalue_asCell(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        static newMap(e) {
            yt(e, g2);
            const n = b.statevalue_newMap(e.__wbg_ptr);
            return gc.__wrap(n);
        }
        asArray() {
            const e = b.statevalue_asArray(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            let n;
            return e[0] !== 0 && (n = as(e[0], e[1]).slice(), b.__wbindgen_free(e[0], e[1] * 4, 4)), n;
        }
        logSize() {
            return b.statevalue_logSize(this.__wbg_ptr) >>> 0;
        }
        static newCell(e) {
            const n = b.statevalue_newCell(e);
            if (n[2]) throw W(n[1]);
            return gc.__wrap(n[0]);
        }
        static newNull() {
            const e = b.statevalue_newNull();
            return gc.__wrap(e);
        }
        static newArray() {
            const e = b.statevalue_newArray();
            return gc.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.statevalue_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (eu.prototype[Symbol.dispose] = eu.prototype.free);
    const o8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_systemtransaction_free(t >>> 0, 1));
    class S0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(S0.prototype);
            return n.__wbg_ptr = e, o8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, o8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_systemtransaction_free(e, 0);
        }
        static deserialize(e) {
            const n = b.systemtransaction_deserialize(e);
            if (n[2]) throw W(n[1]);
            return S0.__wrap(n[0]);
        }
        constructor(){
            const e = b.systemtransaction_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, o8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.systemtransaction_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.systemtransaction_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (S0.prototype[Symbol.dispose] = S0.prototype.free);
    const a8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_transaction_free(t >>> 0, 1));
    _n = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(_n.prototype);
            return n.__wbg_ptr = e, a8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, a8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_transaction_free(e, 0);
        }
        static fromParts(e, n, r, s) {
            const i = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = b.transaction_fromParts(i, o, n, r, s);
            if (a[2]) throw W(a[1]);
            return _n.__wrap(a[0]);
        }
        imbalances(e, n) {
            const r = b.transaction_imbalances(this.__wbg_ptr, e, Xe(n) ? 0 : Cr(n));
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        mockProve() {
            const e = b.transaction_mockProve(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return _n.__wrap(e[0]);
        }
        static deserialize(e, n, r, s) {
            const i = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), c = Je, l = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), u = Je, d = b.transaction_deserialize(i, o, a, c, l, u, s);
            if (d[2]) throw W(d[1]);
            return _n.__wrap(d[0]);
        }
        identifiers() {
            const e = b.transaction_identifiers(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        set intents(e) {
            const n = b.transaction_set_intents(this.__wbg_ptr, Xe(e) ? 0 : Cr(e));
            if (n[1]) throw W(n[0]);
        }
        wellFormed(e, n, r) {
            yt(e, Wo), yt(n, c6);
            const s = b.transaction_wellFormed(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr, r);
            if (s[2]) throw W(s[1]);
            return k0.__wrap(s[0]);
        }
        eraseProofs() {
            const e = b.transaction_eraseProofs(this.__wbg_ptr);
            return _n.__wrap(e);
        }
        static fromRewards(e) {
            yt(e, Sc);
            const n = b.transaction_fromRewards(e.__wbg_ptr);
            return _n.__wrap(n);
        }
        get fallibleOffer() {
            return b.transaction_fallibleOffer(this.__wbg_ptr);
        }
        eraseSignatures() {
            const e = b.transaction_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return _n.__wrap(e[0]);
        }
        feesWithMargin(e, n) {
            yt(e, wi);
            const r = b.transaction_feesWithMargin(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        get guaranteedOffer() {
            const e = b.transaction_guaranteedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : is.__wrap(e);
        }
        transactionHash() {
            let e, n;
            try {
                const i = b.transaction_transactionHash(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get bindingRandomness() {
            const e = b.transaction_bindingRandomness(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        set fallibleOffer(e) {
            const n = b.transaction_set_fallibleOffer(this.__wbg_ptr, Xe(e) ? 0 : Cr(e));
            if (n[1]) throw W(n[0]);
        }
        set guaranteedOffer(e) {
            const n = b.transaction_set_guaranteedOffer(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
        static fromPartsRandomized(e, n, r, s) {
            const i = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = b.transaction_fromPartsRandomized(i, o, n, r, s);
            if (a[2]) throw W(a[1]);
            return _n.__wrap(a[0]);
        }
        constructor(){
            const e = b.transaction_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, a8.register(this, this.__wbg_ptr, this), this;
        }
        bind() {
            const e = b.transaction_bind(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return _n.__wrap(e[0]);
        }
        cost(e, n) {
            yt(e, wi);
            const r = b.transaction_cost(this.__wbg_ptr, e.__wbg_ptr, Xe(n) ? 16777215 : n ? 1 : 0);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        fees(e, n) {
            yt(e, wi);
            const r = b.transaction_fees(this.__wbg_ptr, e.__wbg_ptr, Xe(n) ? 16777215 : n ? 1 : 0);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        merge(e) {
            yt(e, _n);
            const n = b.transaction_merge(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return _n.__wrap(n[0]);
        }
        prove(e, n) {
            return yt(n, bd), b.transaction_prove(this.__wbg_ptr, e, n.__wbg_ptr);
        }
        get intents() {
            return b.transaction_intents(this.__wbg_ptr);
        }
        get rewards() {
            const e = b.transaction_rewards(this.__wbg_ptr);
            return e === 0 ? void 0 : Sc.__wrap(e);
        }
        addCalls(e, n, r, s, i, o, a) {
            yt(r, wi);
            const c = b.transaction_addCalls(this.__wbg_ptr, e, n, r.__wbg_ptr, s, Xe(i) ? 0 : Cr(i), Xe(o) ? 0 : Cr(o), Xe(a) ? 0 : Cr(a));
            if (c[2]) throw W(c[1]);
            return _n.__wrap(c[0]);
        }
        serialize() {
            const e = b.transaction_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.transaction_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (_n.prototype[Symbol.dispose] = _n.prototype.free);
    const FM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_transactioncontext_free(t >>> 0, 1));
    class o6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, FM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_transactioncontext_free(e, 0);
        }
        constructor(e, n, r){
            yt(e, Wo);
            const s = b.transactioncontext_new(e.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, FM.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.transactioncontext_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (o6.prototype[Symbol.dispose] = o6.prototype.free);
    const c8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_transactioncostmodel_free(t >>> 0, 1));
    class Bf {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Bf.prototype);
            return n.__wbg_ptr = e, c8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, c8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_transactioncostmodel_free(e, 0);
        }
        static deserialize(e) {
            const n = b.transactioncostmodel_deserialize(e);
            if (n[2]) throw W(n[1]);
            return Bf.__wrap(n[0]);
        }
        get baselineCost() {
            const e = b.transactioncostmodel_baselineCost(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get runtimeCostModel() {
            const e = b.transactioncostmodel_runtimeCostModel(this.__wbg_ptr);
            return bd.__wrap(e);
        }
        static initialTransactionCostModel() {
            const e = b.transactioncostmodel_initialTransactionCostModel();
            return Bf.__wrap(e);
        }
        constructor(){
            const e = b.transactioncostmodel_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, c8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.transactioncostmodel_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.transactioncostmodel_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Bf.prototype[Symbol.dispose] = Bf.prototype.free);
    const l8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_transactionresult_free(t >>> 0, 1));
    class Lm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Lm.prototype);
            return n.__wbg_ptr = e, l8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, l8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_transactionresult_free(e, 0);
        }
        get successfulSegments() {
            return b.transactionresult_successfulSegments(this.__wbg_ptr);
        }
        constructor(){
            const e = b.transactionresult_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, l8.register(this, this.__wbg_ptr, this), this;
        }
        get error() {
            const e = b.transactionresult_error(this.__wbg_ptr);
            let n;
            return e[0] !== 0 && (n = He(e[0], e[1]).slice(), b.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        get type() {
            let e, n;
            try {
                const r = b.transactionresult_type_(this.__wbg_ptr);
                return e = r[0], n = r[1], He(r[0], r[1]);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get events() {
            const e = b.transactionresult_events(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.transactionresult_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Lm.prototype[Symbol.dispose] = Lm.prototype.free);
    const u8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_unshieldedoffer_free(t >>> 0, 1));
    class mo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(mo.prototype);
            return n.__wbg_ptr = e, u8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, u8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_unshieldedoffer_free(e, 0);
        }
        get signatures() {
            const e = b.unshieldedoffer_signatures(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        addSignatures(e) {
            const n = Qo(e, b.__wbindgen_malloc), r = Je, s = b.unshieldedoffer_addSignatures(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return mo.__wrap(s[0]);
        }
        eraseSignatures() {
            const e = b.unshieldedoffer_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return mo.__wrap(e[0]);
        }
        static new(e, n, r) {
            const s = Qo(e, b.__wbindgen_malloc), i = Je, o = Qo(n, b.__wbindgen_malloc), a = Je, c = Qo(r, b.__wbindgen_malloc), l = Je, u = b.unshieldedoffer_new(s, i, o, a, c, l);
            if (u[2]) throw W(u[1]);
            return mo.__wrap(u[0]);
        }
        get inputs() {
            const e = b.unshieldedoffer_inputs(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get outputs() {
            const e = b.unshieldedoffer_outputs(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        constructor(){
            const e = b.unshieldedoffer_construct();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, u8.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.unshieldedoffer_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (mo.prototype[Symbol.dispose] = mo.prototype.free);
    const d8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_utxometa_free(t >>> 0, 1));
    class zm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(zm.prototype);
            return n.__wbg_ptr = e, d8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, d8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_utxometa_free(e, 0);
        }
        constructor(e){
            const n = b.utxometa_new(e);
            return this.__wbg_ptr = n >>> 0, d8.register(this, this.__wbg_ptr, this), this;
        }
        get ctime() {
            return b.utxometa_ctime(this.__wbg_ptr);
        }
        set ctime(e) {
            const n = b.utxometa_set_ctime(this.__wbg_ptr, e);
            if (n[1]) throw W(n[0]);
        }
    }
    Symbol.dispose && (zm.prototype[Symbol.dispose] = zm.prototype.free);
    const LM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_utxostate_free(t >>> 0, 1));
    class Ff {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ff.prototype);
            return n.__wbg_ptr = e, LM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, LM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_utxostate_free(e, 0);
        }
        lookupMeta(e) {
            const n = b.utxostate_lookupMeta(this.__wbg_ptr, e);
            if (n[2]) throw W(n[1]);
            return n[0] === 0 ? void 0 : zm.__wrap(n[0]);
        }
        static new(e) {
            const n = b.utxostate_new(e);
            if (n[2]) throw W(n[1]);
            return Ff.__wrap(n[0]);
        }
        delta(e, n) {
            yt(e, Ff);
            const r = b.utxostate_delta(this.__wbg_ptr, e.__wbg_ptr, Xe(n) ? 0 : Cr(n));
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
        get utxos() {
            const e = b.utxostate_utxos(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        filter(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.utxostate_filter(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return W(s[0]);
        }
    }
    Symbol.dispose && (Ff.prototype[Symbol.dispose] = Ff.prototype.free);
    const zM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_verifiedtransaction_free(t >>> 0, 1));
    class k0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(k0.prototype);
            return n.__wbg_ptr = e, zM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, zM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_verifiedtransaction_free(e, 0);
        }
        get transaction() {
            const e = b.verifiedtransaction_transaction(this.__wbg_ptr);
            return _n.__wrap(e);
        }
    }
    Symbol.dispose && (k0.prototype[Symbol.dispose] = k0.prototype.free);
    const f8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_verifierkeyinsert_free(t >>> 0, 1));
    class T0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(T0.prototype);
            return n.__wbg_ptr = e, f8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, f8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_verifierkeyinsert_free(e, 0);
        }
        get vk() {
            const e = b.verifierkeyinsert_vk(this.__wbg_ptr);
            return u0.__wrap(e);
        }
        constructor(e, n){
            yt(n, u0);
            const r = b.verifierkeyinsert_new(e, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return this.__wbg_ptr = r[0] >>> 0, f8.register(this, this.__wbg_ptr, this), this;
        }
        get operation() {
            return b.verifierkeyinsert_operation(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.verifierkeyinsert_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (T0.prototype[Symbol.dispose] = T0.prototype.free);
    const p8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_verifierkeyremove_free(t >>> 0, 1));
    class C0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(C0.prototype);
            return n.__wbg_ptr = e, p8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, p8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_verifierkeyremove_free(e, 0);
        }
        constructor(e, n){
            yt(n, l0);
            const r = b.verifierkeyremove_new(e, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return this.__wbg_ptr = r[0] >>> 0, p8.register(this, this.__wbg_ptr, this), this;
        }
        get version() {
            const e = b.verifierkeyremove_version(this.__wbg_ptr);
            return l0.__wrap(e);
        }
        get operation() {
            return b.verifierkeyremove_operation(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.verifierkeyremove_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (C0.prototype[Symbol.dispose] = C0.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>b.__wbg_vmresults_free(t >>> 0, 1));
    const h8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_vmstack_free(t >>> 0, 1));
    let a6 = class CH {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(CH.prototype);
            return n.__wbg_ptr = e, h8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, h8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_vmstack_free(e, 0);
        }
        removeLast() {
            b.vmstack_removeLast(this.__wbg_ptr);
        }
        get(e) {
            const n = b.vmstack_get(this.__wbg_ptr, e);
            return n === 0 ? void 0 : eu.__wrap(n);
        }
        constructor(){
            const e = b.vmstack_new();
            return this.__wbg_ptr = e >>> 0, h8.register(this, this.__wbg_ptr, this), this;
        }
        push(e, n) {
            yt(e, eu), b.vmstack_push(this.__wbg_ptr, e.__wbg_ptr, n);
        }
        length() {
            return b.vmstack_length(this.__wbg_ptr) >>> 0;
        }
        isStrong(e) {
            const n = b.vmstack_isStrong(this.__wbg_ptr, e);
            return n === 16777215 ? void 0 : n !== 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = b.vmstack_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (a6.prototype[Symbol.dispose] = a6.prototype.free);
    const UM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_wellformedstrictness_free(t >>> 0, 1));
    class c6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, UM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_wellformedstrictness_free(e, 0);
        }
        get enforceLimits() {
            return b.wellformedstrictness_enforce_limits(this.__wbg_ptr) !== 0;
        }
        get enforceBalancing() {
            return b.wellformedstrictness_enforce_balancing(this.__wbg_ptr) !== 0;
        }
        get verifySignatures() {
            return b.wellformedstrictness_verify_signatures(this.__wbg_ptr) !== 0;
        }
        set enforceLimits(e) {
            b.wellformedstrictness_set_enforce_limits(this.__wbg_ptr, e);
        }
        get verifyNativeProofs() {
            return b.wellformedstrictness_verify_native_proofs(this.__wbg_ptr) !== 0;
        }
        set enforceBalancing(e) {
            b.wellformedstrictness_set_enforce_balancing(this.__wbg_ptr, e);
        }
        set verifySignatures(e) {
            b.wellformedstrictness_set_verify_signatures(this.__wbg_ptr, e);
        }
        get verifyContractProofs() {
            return b.wellformedstrictness_verify_contract_proofs(this.__wbg_ptr) !== 0;
        }
        set verifyNativeProofs(e) {
            b.wellformedstrictness_set_verify_native_proofs(this.__wbg_ptr, e);
        }
        set verifyContractProofs(e) {
            b.wellformedstrictness_set_verify_contract_proofs(this.__wbg_ptr, e);
        }
        constructor(){
            const e = b.wellformedstrictness_new();
            return this.__wbg_ptr = e >>> 0, UM.register(this, this.__wbg_ptr, this), this;
        }
    }
    Symbol.dispose && (c6.prototype[Symbol.dispose] = c6.prototype.free);
    const g8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapchainstate_free(t >>> 0, 1));
    class fo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(fo.prototype);
            return n.__wbg_ptr = e, g8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, g8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapchainstate_free(e, 0);
        }
        get firstFree() {
            const e = b.zswapchainstate_firstFree(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        static deserialize(e) {
            const n = b.zswapchainstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return fo.__wrap(n[0]);
        }
        postBlockUpdate(e) {
            const n = b.zswapchainstate_postBlockUpdate(this.__wbg_ptr, e);
            return fo.__wrap(n);
        }
        static deserializeFromLedgerState(e) {
            const n = b.zswapchainstate_deserializeFromLedgerState(e);
            if (n[2]) throw W(n[1]);
            return fo.__wrap(n[0]);
        }
        constructor(){
            const e = b.zswapchainstate_new();
            return this.__wbg_ptr = e >>> 0, g8.register(this, this.__wbg_ptr, this), this;
        }
        filter(e) {
            const n = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), r = Je, s = b.zswapchainstate_filter(this.__wbg_ptr, n, r);
            if (s[2]) throw W(s[1]);
            return fo.__wrap(s[0]);
        }
        serialize() {
            const e = b.zswapchainstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswapchainstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
        tryApply(e, n) {
            yt(e, is);
            const r = b.zswapchainstate_tryApply(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw W(r[1]);
            return W(r[0]);
        }
    }
    Symbol.dispose && (fo.prototype[Symbol.dispose] = fo.prototype.free);
    const b8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapinput_free(t >>> 0, 1));
    class Hl {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Hl.prototype);
            return n.__wbg_ptr = e, b8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, b8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapinput_free(e, 0);
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.zswapinput_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return Hl.__wrap(i[0]);
        }
        get contractAddress() {
            const e = b.zswapinput_contractAddress(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            let n;
            return e[0] !== 0 && (n = He(e[0], e[1]).slice(), b.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newContractOwned(e, n, r, s) {
            const i = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je;
            yt(s, fo);
            const a = b.zswapinput_newContractOwned(e, Xe(n) ? 16777215 : n, i, o, s.__wbg_ptr);
            if (a[2]) throw W(a[1]);
            return Hl.__wrap(a[0]);
        }
        constructor(){
            const e = b.zswapinput_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, b8.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = b.zswapinput_proof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get nullifier() {
            let e, n;
            try {
                const i = b.zswapinput_nullifier(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.zswapinput_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswapinput_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Hl.prototype[Symbol.dispose] = Hl.prototype.free);
    const m8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswaplocalstate_free(t >>> 0, 1));
    class Hs {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Hs.prototype);
            return n.__wbg_ptr = e, m8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, m8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswaplocalstate_free(e, 0);
        }
        get firstFree() {
            const e = b.zswaplocalstate_firstFree(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        static deserialize(e) {
            const n = b.zswaplocalstate_deserialize(e);
            if (n[2]) throw W(n[1]);
            return Hs.__wrap(n[0]);
        }
        applyFailed(e) {
            yt(e, is);
            const n = b.zswaplocalstate_applyFailed(this.__wbg_ptr, e.__wbg_ptr);
            return Hs.__wrap(n);
        }
        clearPending(e) {
            const n = b.zswaplocalstate_clearPending(this.__wbg_ptr, e);
            return Hs.__wrap(n);
        }
        replayEvents(e, n) {
            yt(e, qi);
            const r = Qo(n, b.__wbindgen_malloc), s = Je, i = b.zswaplocalstate_replayEvents(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw W(i[1]);
            return Hs.__wrap(i[0]);
        }
        get pendingSpends() {
            const e = b.zswaplocalstate_pendingSpends(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get pendingOutputs() {
            const e = b.zswaplocalstate_pendingOutputs(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        spendFromOutput(e, n, r, s, i) {
            yt(e, qi), yt(s, $i);
            const o = b.zswaplocalstate_spendFromOutput(this.__wbg_ptr, e.__wbg_ptr, n, Xe(r) ? 16777215 : r, s.__wbg_ptr, Xe(i) ? 0 : Cr(i));
            if (o[2]) throw W(o[1]);
            return W(o[0]);
        }
        revertTransaction(e) {
            yt(e, _n);
            const n = b.zswaplocalstate_revertTransaction(this.__wbg_ptr, e.__wbg_ptr);
            return Hs.__wrap(n);
        }
        applyCollapsedUpdate(e) {
            yt(e, b0);
            const n = b.zswaplocalstate_applyCollapsedUpdate(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return Hs.__wrap(n[0]);
        }
        replayEventsWithChanges(e, n) {
            yt(e, qi);
            const r = Qo(n, b.__wbindgen_malloc), s = Je, i = b.zswaplocalstate_replayEventsWithChanges(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw W(i[1]);
            return Um.__wrap(i[0]);
        }
        constructor(){
            const e = b.zswaplocalstate_new();
            return this.__wbg_ptr = e >>> 0, m8.register(this, this.__wbg_ptr, this), this;
        }
        apply(e, n) {
            yt(e, qi), yt(n, is);
            const r = b.zswaplocalstate_apply(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr);
            if (r[2]) throw W(r[1]);
            return Hs.__wrap(r[0]);
        }
        get coins() {
            const e = b.zswaplocalstate_coins(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        spend(e, n, r, s) {
            yt(e, qi);
            const i = b.zswaplocalstate_spend(this.__wbg_ptr, e.__wbg_ptr, n, Xe(r) ? 16777215 : r, Xe(s) ? 0 : Cr(s));
            if (i[2]) throw W(i[1]);
            return W(i[0]);
        }
        serialize() {
            const e = b.zswaplocalstate_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswaplocalstate_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
        watchFor(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.zswaplocalstate_watchFor(this.__wbg_ptr, r, s, n);
            if (i[2]) throw W(i[1]);
            return Hs.__wrap(i[0]);
        }
    }
    Symbol.dispose && (Hs.prototype[Symbol.dispose] = Hs.prototype.free);
    const HM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswaplocalstatewithchanges_free(t >>> 0, 1));
    class Um {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Um.prototype);
            return n.__wbg_ptr = e, HM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, HM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswaplocalstatewithchanges_free(e, 0);
        }
        get state() {
            const e = b.zswaplocalstatewithchanges_state(this.__wbg_ptr);
            return Hs.__wrap(e);
        }
        get changes() {
            const e = b.zswaplocalstatewithchanges_changes(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
    }
    Symbol.dispose && (Um.prototype[Symbol.dispose] = Um.prototype.free);
    const y8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapoffer_free(t >>> 0, 1));
    class is {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(is.prototype);
            return n.__wbg_ptr = e, y8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, y8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapoffer_free(e, 0);
        }
        static fromInput(e, n, r) {
            yt(e, Hl);
            var s = Xe(n) ? 0 : ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je;
            const o = b.zswapoffer_fromInput(e.__wbg_ptr, s, i, Xe(r) ? 0 : Cr(r));
            if (o[2]) throw W(o[1]);
            return is.__wrap(o[0]);
        }
        get transients() {
            const e = b.zswapoffer_transients(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.zswapoffer_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return is.__wrap(i[0]);
        }
        static fromOutput(e, n, r) {
            yt(e, $i);
            var s = Xe(n) ? 0 : ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je;
            const o = b.zswapoffer_fromOutput(e.__wbg_ptr, s, i, Xe(r) ? 0 : Cr(r));
            if (o[2]) throw W(o[1]);
            return is.__wrap(o[0]);
        }
        static fromTransient(e) {
            yt(e, jl);
            const n = b.zswapoffer_fromTransient(e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return is.__wrap(n[0]);
        }
        constructor(){
            const e = b.zswapoffer_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, y8.register(this, this.__wbg_ptr, this), this;
        }
        merge(e) {
            yt(e, is);
            const n = b.zswapoffer_merge(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw W(n[1]);
            return is.__wrap(n[0]);
        }
        get deltas() {
            const e = b.zswapoffer_deltas(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get inputs() {
            const e = b.zswapoffer_inputs(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get outputs() {
            const e = b.zswapoffer_outputs(this.__wbg_ptr);
            var n = as(e[0], e[1]).slice();
            return b.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        serialize() {
            const e = b.zswapoffer_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswapoffer_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (is.prototype[Symbol.dispose] = is.prototype.free);
    const w8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapoutput_free(t >>> 0, 1));
    class $i {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create($i.prototype);
            return n.__wbg_ptr = e, w8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, w8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapoutput_free(e, 0);
        }
        get commitment() {
            let e, n;
            try {
                const i = b.zswapoutput_commitment(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.zswapoutput_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return $i.__wrap(i[0]);
        }
        get contractAddress() {
            const e = b.zswapoutput_contractAddress(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            let n;
            return e[0] !== 0 && (n = He(e[0], e[1]).slice(), b.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newContractOwned(e, n, r) {
            const s = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je, o = b.zswapoutput_newContractOwned(e, Xe(n) ? 16777215 : n, s, i);
            if (o[2]) throw W(o[1]);
            return $i.__wrap(o[0]);
        }
        static new(e, n, r, s) {
            const i = ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), o = Je, a = ft(s, b.__wbindgen_malloc, b.__wbindgen_realloc), c = Je, l = b.zswapoutput_new(e, Xe(n) ? 16777215 : n, i, o, a, c);
            if (l[2]) throw W(l[1]);
            return $i.__wrap(l[0]);
        }
        get proof() {
            const e = b.zswapoutput_proof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        constructor(){
            const e = b.zswapoutput_construct();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, w8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = b.zswapoutput_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswapoutput_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && ($i.prototype[Symbol.dispose] = $i.prototype.free);
    const _8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapsecretkeys_free(t >>> 0, 1));
    class qi {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(qi.prototype);
            return n.__wbg_ptr = e, _8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, _8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapsecretkeys_free(e, 0);
        }
        static fromSeedRng(e) {
            const n = b.zswapsecretkeys_fromSeedRng(e);
            if (n[2]) throw W(n[1]);
            return qi.__wrap(n[0]);
        }
        get coinPublicKey() {
            let e, n;
            try {
                const i = b.zswapsecretkeys_coinPublicKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get coinSecretKey() {
            const e = b.zswapsecretkeys_coinSecretKey(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return o0.__wrap(e[0]);
        }
        get encryptionPublicKey() {
            let e, n;
            try {
                const i = b.zswapsecretkeys_encryptionPublicKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        get encryptionSecretKey() {
            const e = b.zswapsecretkeys_encryptionSecretKey(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return Df.__wrap(e[0]);
        }
        constructor(){
            const e = b.zswapsecretkeys_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, _8.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            b.zswapsecretkeys_clear(this.__wbg_ptr);
        }
        static fromSeed(e) {
            const n = b.zswapsecretkeys_fromSeed(e);
            if (n[2]) throw W(n[1]);
            return qi.__wrap(n[0]);
        }
    }
    Symbol.dispose && (qi.prototype[Symbol.dispose] = qi.prototype.free);
    const jM = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswapstatechanges_free(t >>> 0, 1));
    class Hm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Hm.prototype);
            return n.__wbg_ptr = e, jM.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, jM.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswapstatechanges_free(e, 0);
        }
        get spentCoins() {
            const e = b.zswapstatechanges_spentCoins(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get receivedCoins() {
            const e = b.zswapstatechanges_receivedCoins(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get source() {
            let e, n;
            try {
                const i = b.zswapstatechanges_source(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
    }
    Symbol.dispose && (Hm.prototype[Symbol.dispose] = Hm.prototype.free);
    const x8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>b.__wbg_zswaptransient_free(t >>> 0, 1));
    class jl {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(jl.prototype);
            return n.__wbg_ptr = e, x8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, x8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            b.__wbg_zswaptransient_free(e, 0);
        }
        get commitment() {
            let e, n;
            try {
                const i = b.zswaptransient_commitment(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e, n) {
            const r = ft(e, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je, i = b.zswaptransient_deserialize(r, s, n);
            if (i[2]) throw W(i[1]);
            return jl.__wrap(i[0]);
        }
        get inputProof() {
            const e = b.zswaptransient_inputProof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get outputProof() {
            const e = b.zswaptransient_outputProof(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        get contractAddress() {
            const e = b.zswaptransient_contractAddress(this.__wbg_ptr);
            if (e[3]) throw W(e[2]);
            let n;
            return e[0] !== 0 && (n = He(e[0], e[1]).slice(), b.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newFromContractOwnedOutput(e, n, r) {
            yt(r, $i);
            const s = b.zswaptransient_newFromContractOwnedOutput(e, Xe(n) ? 16777215 : n, r.__wbg_ptr);
            if (s[2]) throw W(s[1]);
            return jl.__wrap(s[0]);
        }
        constructor(){
            const e = b.zswaptransient_new();
            if (e[2]) throw W(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, x8.register(this, this.__wbg_ptr, this), this;
        }
        get nullifier() {
            let e, n;
            try {
                const i = b.zswaptransient_nullifier(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, W(i[2]);
                return e = r, n = s, He(r, s);
            } finally{
                b.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = b.zswaptransient_serialize(this.__wbg_ptr);
            if (e[2]) throw W(e[1]);
            return W(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = b.zswaptransient_toString(this.__wbg_ptr, Xe(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], He(s[0], s[1]);
            } finally{
                b.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (jl.prototype[Symbol.dispose] = jl.prototype.free);
    function qie() {
        return oi(function(t) {
            return BigInt(t);
        }, arguments);
    }
    function Wie(t) {
        return BigInt(t);
    }
    function Kie(t, e) {
        return Error(He(t, e));
    }
    function $ie(t) {
        return Number(t);
    }
    function Xie(t, e) {
        const n = String(e), r = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je;
        aa().setInt32(t + 4, s, !0), aa().setInt32(t + 0, r, !0);
    }
    function Gie(t, e) {
        return t.add(e);
    }
    function Zie(t) {
        return i0.__wrap(t);
    }
    function Jie(t) {
        return t.buffer;
    }
    function Yie(t) {
        const e = t.byobRequest;
        return Xe(e) ? 0 : Cr(e);
    }
    function Qie(t) {
        return t.byteLength;
    }
    function eoe(t) {
        return t.byteOffset;
    }
    function toe() {
        return oi(function(t, e) {
            return t.call(e);
        }, arguments);
    }
    function noe() {
        return oi(function(t, e, n, r) {
            return t.call(e, n, r);
        }, arguments);
    }
    function roe() {
        return oi(function(t, e, n) {
            return t.call(e, n);
        }, arguments);
    }
    function soe() {
        return oi(function(t, e, n, r, s) {
            return t.call(e, n, r, s);
        }, arguments);
    }
    function ioe() {
        return oi(function(t) {
            t.close();
        }, arguments);
    }
    function ooe() {
        return oi(function(t) {
            t.close();
        }, arguments);
    }
    function aoe(t) {
        return np.__wrap(t);
    }
    function coe(t) {
        return rp.__wrap(t);
    }
    function loe(t) {
        return d0.__wrap(t);
    }
    function uoe(t) {
        return t.crypto;
    }
    function doe(t) {
        return t.done;
    }
    function foe(t) {
        return Oa.__wrap(t);
    }
    function poe(t) {
        return ea.__wrap(t);
    }
    function hoe(t) {
        return Ql.__wrap(t);
    }
    function goe(t) {
        return p0.__wrap(t);
    }
    function boe(t) {
        return Bm.__wrap(t);
    }
    function moe() {
        return oi(function(t, e) {
            t.enqueue(e);
        }, arguments);
    }
    function yoe(t) {
        return Object.entries(t);
    }
    function woe(t) {
        return yd.__wrap(t);
    }
    function _oe(t) {
        return yd.__unwrap(t);
    }
    function xoe(t, e, n) {
        try {
            var r = {
                a: e,
                b: n
            }, s = (i, o, a)=>{
                const c = r.a;
                r.a = 0;
                try {
                    return jie(c, r.b, i, o, a);
                } finally{
                    r.a = c;
                }
            };
            t.forEach(s);
        } finally{
            r.a = r.b = 0;
        }
    }
    function voe(t, e, n) {
        try {
            var r = {
                a: e,
                b: n
            }, s = (i, o)=>{
                const a = r.a;
                r.a = 0;
                try {
                    return SH(a, r.b, i, o);
                } finally{
                    r.a = a;
                }
            };
            t.forEach(s);
        } finally{
            r.a = r.b = 0;
        }
    }
    function Soe(t) {
        return Array.from(t);
    }
    function koe() {
        return oi(function(t) {
            return Reflect.getPrototypeOf(t);
        }, arguments);
    }
    function Toe() {
        return oi(function(t, e) {
            t.getRandomValues(e);
        }, arguments);
    }
    function Coe(t) {
        return t.getTime();
    }
    function Eoe(t, e) {
        return t[e >>> 0];
    }
    function Ioe() {
        return oi(function(t, e) {
            return Reflect.get(t, e);
        }, arguments);
    }
    function Aoe(t, e) {
        return t.get(e);
    }
    function Poe(t, e) {
        return t[e];
    }
    function Ooe(t) {
        let e;
        try {
            e = t instanceof ArrayBuffer;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Moe(t) {
        let e;
        try {
            e = t instanceof Date;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Roe(t) {
        let e;
        try {
            e = t instanceof Map;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Noe(t) {
        let e;
        try {
            e = t instanceof Promise;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Voe(t) {
        let e;
        try {
            e = t instanceof Set;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Doe(t) {
        let e;
        try {
            e = t instanceof Uint8Array;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Boe(t) {
        return Zr.__wrap(t);
    }
    function Foe(t) {
        return Array.isArray(t);
    }
    function Loe(t) {
        return Number.isSafeInteger(t);
    }
    function zoe() {
        return Symbol.iterator;
    }
    function Uoe(t) {
        return t.keys();
    }
    function Hoe(t) {
        return Wo.__wrap(t);
    }
    function joe(t) {
        return t.length;
    }
    function qoe(t) {
        return t.length;
    }
    function Woe(t) {
        return wd.__wrap(t);
    }
    function Koe(t) {
        return t.msCrypto;
    }
    function $oe() {
        return new Date;
    }
    function Xoe(t) {
        return new Set(t);
    }
    function Goe() {
        return new Object;
    }
    function Zoe() {
        return new Array;
    }
    function Joe(t, e) {
        try {
            var n = {
                a: t,
                b: e
            }, r = (i, o)=>{
                const a = n.a;
                n.a = 0;
                try {
                    return SH(a, n.b, i, o);
                } finally{
                    n.a = a;
                }
            };
            return new Promise(r);
        } finally{
            n.a = n.b = 0;
        }
    }
    function Yoe() {
        return new Map;
    }
    function Qoe(t) {
        return new Uint8Array(t);
    }
    function eae(t, e) {
        return new Error(He(t, e));
    }
    function tae(t, e) {
        return new Uint8Array(Jx(t, e));
    }
    function nae(t, e) {
        return new Function(He(t, e));
    }
    function rae(t, e, n) {
        return new Uint8Array(t, e >>> 0, n >>> 0);
    }
    function sae(t) {
        return new Uint8Array(t >>> 0);
    }
    function iae(t) {
        return t.next;
    }
    function oae() {
        return oi(function(t) {
            return t.next();
        }, arguments);
    }
    function aae(t) {
        return m0.__wrap(t);
    }
    function cae(t) {
        return t.node;
    }
    function lae(t) {
        return Fm.__wrap(t);
    }
    function uae(t) {
        return y0.__wrap(t);
    }
    function dae(t) {
        return w0.__wrap(t);
    }
    function fae(t) {
        return t.process;
    }
    function pae(t) {
        return _0.__wrap(t);
    }
    function hae(t, e, n) {
        Uint8Array.prototype.set.call(Jx(t, e), n);
    }
    function gae(t, e) {
        return t.push(e);
    }
    function bae(t) {
        queueMicrotask(t);
    }
    function mae(t) {
        return t.queueMicrotask;
    }
    function yae() {
        return oi(function(t, e) {
            t.randomFillSync(e);
        }, arguments);
    }
    function wae(t) {
        return x0.__wrap(t);
    }
    function _ae() {
        return oi(function() {
            return module.require;
        }, arguments);
    }
    function xae(t) {
        return Promise.resolve(t);
    }
    function vae() {
        return oi(function(t, e) {
            t.respond(e >>> 0);
        }, arguments);
    }
    function Sae(t, e) {
        return t.setTime(e);
    }
    function kae(t, e, n) {
        t.set(Jx(e, n));
    }
    function Tae(t, e, n) {
        t[e] = n;
    }
    function Cae(t, e, n) {
        t[e >>> 0] = n;
    }
    function Eae(t, e, n) {
        return t.set(e, n);
    }
    function Iae(t) {
        return _d.__wrap(t);
    }
    function Aae(t) {
        return v0.__wrap(t);
    }
    function Pae(t) {
        return t.size;
    }
    function Oae(t) {
        return eu.__wrap(t);
    }
    function Mae() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return Xe(t) ? 0 : Cr(t);
    }
    function Rae() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return Xe(t) ? 0 : Cr(t);
    }
    function Nae() {
        const t = typeof self > "u" ? null : self;
        return Xe(t) ? 0 : Cr(t);
    }
    function Vae() {
        const t = typeof window > "u" ? null : window;
        return Xe(t) ? 0 : Cr(t);
    }
    function Dae(t, e, n) {
        return t.subarray(e >>> 0, n >>> 0);
    }
    function Bae(t, e, n) {
        return t.then(e, n);
    }
    function Fae(t, e) {
        return t.then(e);
    }
    function Lae() {
        return oi(function(t, e) {
            return t.toString(e);
        }, arguments);
    }
    function zae(t) {
        return t.toString();
    }
    function Uae(t) {
        return _n.__wrap(t);
    }
    function Hae(t) {
        return Lm.__wrap(t);
    }
    function jae(t) {
        return t.value;
    }
    function qae(t) {
        return T0.__wrap(t);
    }
    function Wae(t) {
        return C0.__wrap(t);
    }
    function Kae(t) {
        return t.versions;
    }
    function $ae(t) {
        const e = t.view;
        return Xe(e) ? 0 : Cr(e);
    }
    function Xae(t, e) {
        const n = e, r = typeof n == "bigint" ? n : void 0;
        aa().setBigInt64(t + 8, Xe(r) ? BigInt(0) : r, !0), aa().setInt32(t + 0, !Xe(r), !0);
    }
    function Gae(t) {
        const e = t, n = typeof e == "boolean" ? e : void 0;
        return Xe(n) ? 16777215 : n ? 1 : 0;
    }
    function Zae(t) {
        const e = t.original;
        return e.cnt-- == 1 ? (e.a = 0, !0) : !1;
    }
    function Jae(t, e) {
        const n = Y7(e), r = ft(n, b.__wbindgen_malloc, b.__wbindgen_realloc), s = Je;
        aa().setInt32(t + 4, s, !0), aa().setInt32(t + 0, r, !0);
    }
    function Yae(t, e) {
        return t in e;
    }
    function Qae(t) {
        return typeof t == "bigint";
    }
    function ece(t) {
        return typeof t == "function";
    }
    function tce(t) {
        return t === null;
    }
    function nce(t) {
        const e = t;
        return typeof e == "object" && e !== null;
    }
    function rce(t) {
        return typeof t == "string";
    }
    function sce(t) {
        return t === void 0;
    }
    function ice(t, e) {
        return t === e;
    }
    function oce(t, e) {
        return t == e;
    }
    function ace(t, e) {
        const n = e, r = typeof n == "number" ? n : void 0;
        aa().setFloat64(t + 8, Xe(r) ? 0 : r, !0), aa().setInt32(t + 0, !Xe(r), !0);
    }
    function cce(t, e) {
        return t >> e;
    }
    function lce(t, e) {
        const n = e, r = typeof n == "string" ? n : void 0;
        var s = Xe(r) ? 0 : ft(r, b.__wbindgen_malloc, b.__wbindgen_realloc), i = Je;
        aa().setInt32(t + 4, i, !0), aa().setInt32(t + 0, s, !0);
    }
    function uce(t, e) {
        throw new Error(He(t, e));
    }
    function dce(t) {
        return fo.__wrap(t);
    }
    function fce(t) {
        return Hl.__wrap(t);
    }
    function pce(t) {
        return Hs.__wrap(t);
    }
    function hce(t) {
        return is.__wrap(t);
    }
    function gce(t) {
        return $i.__wrap(t);
    }
    function bce(t) {
        return Hm.__wrap(t);
    }
    function mce(t) {
        return jl.__wrap(t);
    }
    function yce(t, e) {
        var n = as(t, e).slice();
        return b.__wbindgen_free(t, e * 4, 4), n;
    }
    function wce(t, e) {
        return He(t, e);
    }
    function _ce(t, e) {
        return BigInt.asUintN(64, t) | e << BigInt(64);
    }
    function xce(t) {
        return BigInt.asUintN(64, t);
    }
    function vce(t) {
        return t;
    }
    function Sce(t, e) {
        return Jx(t, e);
    }
    function kce(t, e) {
        return Fie(t, e, 3108, Hie);
    }
    function Tce(t) {
        return t;
    }
    function Cce(t, e) {
        return BigInt.asUintN(64, t) | BigInt.asUintN(64, e) << BigInt(64);
    }
    function Ece() {
        const t = b.__wbindgen_export_2, e = t.grow(4);
        t.set(0, void 0), t.set(e + 0, void 0), t.set(e + 1, null), t.set(e + 2, !0), t.set(e + 3, !1);
    }
    function Ice() {
        return Hl;
    }
    function Ace() {
        return is;
    }
    function Pce() {
        return $i;
    }
    function Oce() {
        return jl;
    }
    function Mce() {
        return s6;
    }
    function Rce() {
        return p0;
    }
    function Nce() {
        return Oa;
    }
    function Vce() {
        return Ql;
    }
    function Dce() {
        return v0;
    }
    function Bce() {
        return _d;
    }
    function Fce() {
        return Zr;
    }
    function Lce() {
        return np;
    }
    function zce() {
        return rp;
    }
    function Uce() {
        return x0;
    }
    function Hce() {
        return wd;
    }
    function jce() {
        return T0;
    }
    function qce() {
        return C0;
    }
    URL = globalThis.URL;
    const T = await lU({
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline0.js": {
            PreTranscript_: Rie
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline1.js": {
            UnshieldedOffer_: Nie
        },
        "./midnight_ledger_wasm_bg.js": {
            __wbg_zswapinput_new: fce,
            __wbg_zswapoffer_new: hce,
            __wbg_zswapoutput_new: gce,
            __wbg_zswaptransient_new: mce,
            __wbg_zswapchainstate_new: dce,
            __wbg_zswaplocalstate_new: pce,
            __wbg_duststatechanges_new: boe,
            __wbg_zswapstatechanges_new: bce,
            __wbg_transaction_new: Uae,
            __wbg_transactionresult_new: Hae,
            __wbg_event_new: woe,
            __wbg_dustspend_new: goe,
            __wbg_dustactions_new: foe,
            __wbg_dustlocalstate_new: poe,
            __wbg_dustregistration_new: hoe,
            __wbg_ledgerstate_new: Hoe,
            __wbg_proof_new: pae,
            __wbg_binding_new: Zie,
            __wbg_noproof_new: lae,
            __wbg_preproof_new: dae,
            __wbg_nobinding_new: aae,
            __wbg_prebinding_new: uae,
            __wbg_signatureerased_new: Aae,
            __wbg_signatureenabled_new: Iae,
            __wbg_intent_new: Boe,
            __wbg_contractcall_new: aoe,
            __wbg_contractdeploy_new: coe,
            __wbg_replaceauthority_new: wae,
            __wbg_maintenanceupdate_new: Woe,
            __wbg_verifierkeyinsert_new: qae,
            __wbg_verifierkeyremove_new: Wae,
            __wbg_event_unwrap: _oe,
            __wbg_statevalue_new: Oae,
            __wbg_contractstate_new: loe,
            __wbg_getwithrefkey_1dc361bd10053bfe: Poe,
            __wbg_set_3f1d0b984ed272ed: Tae,
            __wbg_String_8f0eb39a4a4c2f66: Xie,
            __wbg_queueMicrotask_25d0739ac89e8c88: bae,
            __wbg_queueMicrotask_4488407636f5bf24: mae,
            __wbg_respond_6c2c4e20ef85138e: vae,
            __wbg_view_91cc97d57ab30530: $ae,
            __wbg_byobRequest_2c036bceca1e6037: Yie,
            __wbg_close_cccada6053ee3a65: ioe,
            __wbg_enqueue_452bc2343d1c2ff9: moe,
            __wbg_close_d71a78219dc23e91: ooe,
            __wbg_crypto_86f2631e91b51511: uoe,
            __wbg_process_3975fd6c72f520aa: fae,
            __wbg_versions_4e31226f5e8dc909: Kae,
            __wbg_node_e1f24f89a7336c2e: cae,
            __wbg_require_b74f47fc2d022fd6: _ae,
            __wbg_msCrypto_d562bbe83e0d4b91: Koe,
            __wbg_getRandomValues_b3f15fcbfabb0f8b: Toe,
            __wbg_randomFillSync_f8c153b79f285817: yae,
            __wbg_byteLength_331a6b5545834024: Qie,
            __wbg_byteOffset_49a5b5608000358b: eoe,
            __wbg_newfromslice_074c56947bd43469: tae,
            __wbg_newwithlength_a167dcc7aaa3ba77: sae,
            __wbg_newwithbyteoffsetandlength_e8f53910b4d42b45: rae,
            __wbg_new_638ebfaedbf32a5e: Qoe,
            __wbg_buffer_8d40b1d762fb3c66: Jie,
            __wbg_length_6bb7e81f9d7713e4: qoe,
            __wbg_prototypesetcall_3d4a26c1ed734349: hae,
            __wbg_subarray_70fd07feefe14294: Dae,
            __wbg_set_1353b2a5e96bc48c: kae,
            __wbg_BigInt_40a77d45cca49470: qie,
            __wbg_done_75ed0ee6dd243d9d: doe,
            __wbg_value_dd9372230531eade: jae,
            __wbg_instanceof_Map_ebb01a5b6b5ffd0b: Roe,
            __wbg_instanceof_Set_b0e0ca8a8b2062e8: Voe,
            __wbg_instanceof_Date_c0cdff0c3b978b0e: Moe,
            __wbg_instanceof_Promise_3ec9e849bf41bdb6: Noe,
            __wbg_instanceof_Uint8Array_9a8378d955933db7: Doe,
            __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd: Ooe,
            __wbg_BigInt_6adbfd8eb0f7ec07: Wie,
            __wbg_get_5ee3191755594360: Aoe,
            __wbg_new_2ff1f68f3676ea53: Yoe,
            __wbg_set_b7f1cf4fae26fe2a: Eae,
            __wbg_keys_822161a7faf55538: Uoe,
            __wbg_size_af8602b0b838d49e: Pae,
            __wbg_forEach_859dfd887a0f866c: voe,
            __wbg_add_bd7fa428f539a577: Gie,
            __wbg_new_0dc86f3faa8a3b53: Xoe,
            __wbg_forEach_48feffedd75c5b94: xoe,
            __wbg_new0_b0a0a38c201e6df5: $oe,
            __wbg_getTime_6bb3f64e0f18f817: Coe,
            __wbg_setTime_fb96d30252f92656: Sae,
            __wbg_get_0da715ceaecea5c8: Eoe,
            __wbg_new_1f3a344cf3123716: Zoe,
            __wbg_set_90f6c0f7bd8c0415: Cae,
            __wbg_from_88bc52ce20ba6318: Soe,
            __wbg_push_330b2eb93e4e1212: gae,
            __wbg_length_186546c51cd61acd: joe,
            __wbg_isArray_030cce220591fb41: Foe,
            __wbg_new_da9dc54c5db29dfa: eae,
            __wbg_toString_d8f537919ef401d6: zae,
            __wbg_toString_7268338f40012a03: Lae,
            __wbg_isSafeInteger_1c0d1af5542e102a: Loe,
            __wbg_new_19c25a3f2fa63a02: Goe,
            __wbg_entries_2be2f15bd5554996: yoe,
            __wbg_iterator_f370b34483c71a1c: zoe,
            __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184: Rae,
            __wbg_static_accessor_SELF_995b214ae681ff99: Nae,
            __wbg_static_accessor_GLOBAL_8921f820c2ce3f12: Mae,
            __wbg_static_accessor_WINDOW_cde3890479c675ea: Vae,
            __wbg_new_2e3c58a15f39f5f9: Joe,
            __wbg_then_e22500defe16819f: Fae,
            __wbg_then_b33a773d723afa3e: Bae,
            __wbg_resolve_4055c623acdd6a1b: xae,
            __wbg_getPrototypeOf_1b3ce3e146539859: koe,
            __wbg_get_458e874b43b18b25: Ioe,
            __wbg_newnoargs_254190557c45b4ec: nae,
            __wbg_call_13410aac570ffff7: toe,
            __wbg_call_a5400b25a865cfd8: roe,
            __wbg_call_641db1bb5db5a579: noe,
            __wbg_call_f1fd202ba222e0ec: soe,
            __wbg_next_5b3530e612fde77d: iae,
            __wbg_next_692e82279131b03c: oae,
            __wbg_wbindgenin_d7a1ee10933d2d55: Yae,
            __wbg_wbindgenshr_7d2aae6044c0dab1: cce,
            __wbg_wbindgenthrow_451ec1a8469d7eb6: uce,
            __wbg_wbindgencbdrop_eb10308566512b88: Zae,
            __wbg_wbindgenisnull_f3037694abe4d97a: tce,
            __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58: ice,
            __wbg_Number_998bea33bd87c3e0: $ie,
            __wbg_Error_e17e777aac105295: Kie,
            __wbg_wbindgenisbigint_ecb90cc08a5a9154: Qae,
            __wbg_wbindgenisobject_307a53c6bd97fbf8: nce,
            __wbg_wbindgenisstring_d4fa939789f003b0: rce,
            __wbg_wbindgennumberget_f74b4c7525ac05cb: ace,
            __wbg_wbindgenstringget_0f16a6ddddef376f: lce,
            __wbg_wbindgenbooleanget_3fe6f642c7d97746: Gae,
            __wbg_wbindgenisfunction_8cee7dce3725ae74: ece,
            __wbg_wbindgenisundefined_c4b71d073b92f3c5: sce,
            __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1: oce,
            __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1: Xae,
            __wbg_wbindgendebugstring_99ef257a3ddda34d: Jae,
            __wbindgen_init_externref_table: Ece,
            __wbindgen_cast_2241b6af4c4b2941: wce,
            __wbindgen_cast_cc2ffe7a88863288: kce,
            __wbindgen_cast_4625c577ab2ec9ee: xce,
            __wbindgen_cast_0be206197f6586af: yce,
            __wbindgen_cast_d6cd19b81560fd6e: Tce,
            __wbindgen_cast_2ddd8a25ff58642a: _ce,
            __wbindgen_cast_e7b45dd881f38ce3: Cce,
            __wbindgen_cast_9ae0607507abb057: vce,
            __wbindgen_cast_cb9088102bce6b30: Sce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline4.js": {
            ZswapInput_: Ice
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline3.js": {
            ZswapOffer_: Ace
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline2.js": {
            ZswapOutput_: Pce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline5.js": {
            ZswapTransient_: Oce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline6.js": {
            PrePartitionContractCall_: Mce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline7.js": {
            DustSpend_: Rce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline9.js": {
            DustActions_: Nce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline8.js": {
            DustRegistration_: Vce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline11.js": {
            SignatureErased_: Dce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline13.js": {
            SignatureEnabled_: Bce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline17.js": {
            Intent_: Fce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline20.js": {
            ContractCall_: Lce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline23.js": {
            ContractDeploy_: zce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline18.js": {
            ReplaceAuthority_: Uce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline21.js": {
            MaintenanceUpdate_: Hce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline19.js": {
            VerifierKeyInsert_: jce
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline22.js": {
            VerifierKeyRemove_: qce
        }
    }, Mie), Wce = T.memory, Kce = T.__wbg_authorizedclaim_free, $ce = T.__wbg_binding_free, Xce = T.__wbg_claimrewardstransaction_free, Gce = T.__wbg_coinsecretkey_free, Zce = T.__wbg_contractcall_free, Jce = T.__wbg_contractcallprototype_free, Yce = T.__wbg_contractdeploy_free, Qce = T.__wbg_contractoperationversion_free, ele = T.__wbg_contractoperationversionedverifierkey_free, tle = T.__wbg_dustactions_free, nle = T.__wbg_dustgenerationstate_free, rle = T.__wbg_dustlocalstate_free, sle = T.__wbg_dustlocalstatewithchanges_free, ile = T.__wbg_dustparameters_free, ole = T.__wbg_dustregistration_free, ale = T.__wbg_dustsecretkey_free, cle = T.__wbg_dustspend_free, lle = T.__wbg_duststate_free, ule = T.__wbg_duststatechanges_free, dle = T.__wbg_dustutxostate_free, fle = T.__wbg_encryptionsecretkey_free, ple = T.__wbg_event_free, hle = T.__wbg_intent_free, gle = T.__wbg_ledgerparameters_free, ble = T.__wbg_ledgerstate_free, mle = T.__wbg_maintenanceupdate_free, yle = T.__wbg_merkletreecollapsedupdate_free, wle = T.__wbg_nobinding_free, _le = T.__wbg_prebinding_free, xle = T.__wbg_prepartitioncontractcall_free, vle = T.__wbg_preproof_free, Sle = T.__wbg_pretranscript_free, kle = T.__wbg_proof_free, Tle = T.__wbg_replaceauthority_free, Cle = T.__wbg_signatureenabled_free, Ele = T.__wbg_systemtransaction_free, Ile = T.__wbg_transaction_free, Ale = T.__wbg_transactioncontext_free, Ple = T.__wbg_transactioncostmodel_free, Ole = T.__wbg_transactionresult_free, Mle = T.__wbg_unshieldedoffer_free, Rle = T.__wbg_utxometa_free, Nle = T.__wbg_utxostate_free, Vle = T.__wbg_verifiedtransaction_free, Dle = T.__wbg_verifierkeyinsert_free, Ble = T.__wbg_wellformedstrictness_free, Fle = T.__wbg_zswapchainstate_free, Lle = T.__wbg_zswapinput_free, zle = T.__wbg_zswaplocalstate_free, Ule = T.__wbg_zswaplocalstatewithchanges_free, Hle = T.__wbg_zswapoffer_free, jle = T.__wbg_zswapoutput_free, qle = T.__wbg_zswapsecretkeys_free, Wle = T.__wbg_zswapstatechanges_free, Kle = T.__wbg_zswaptransient_free, $le = T.addressFromKey, Xle = T.authorizedclaim_coin, Gle = T.authorizedclaim_deserialize, Zle = T.authorizedclaim_eraseProof, Jle = T.authorizedclaim_new, Yle = T.authorizedclaim_recipient, Qle = T.authorizedclaim_serialize, eue = T.authorizedclaim_toString, tue = T.binding_deserialize, nue = T.binding_instance, rue = T.binding_new, sue = T.binding_serialize, iue = T.binding_toString, oue = T.claimrewardstransaction_addSignature, aue = T.claimrewardstransaction_construct, cue = T.claimrewardstransaction_dataToSign, lue = T.claimrewardstransaction_deserialize, uue = T.claimrewardstransaction_eraseSignatures, due = T.claimrewardstransaction_kind, fue = T.claimrewardstransaction_new, pue = T.claimrewardstransaction_nonce, hue = T.claimrewardstransaction_owner, gue = T.claimrewardstransaction_serialize, bue = T.claimrewardstransaction_signature, mue = T.claimrewardstransaction_toString, yue = T.claimrewardstransaction_value, wue = T.coinCommitment, _ue = T.coinNullifier, xue = T.coinsecretkey_clear, vue = T.coinsecretkey_new, Sue = T.coinsecretkey_public_key, kue = T.coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize, Tue = T.contractcall_address, Cue = T.contractcall_communicationCommitment, Eue = T.contractcall_entryPoint, Iue = T.contractcall_fallibleTranscript, Aue = T.contractcall_guaranteedTranscript, Pue = T.contractcall_new, Oue = T.contractcall_proof, Mue = T.contractcall_toString, Rue = T.contractcallprototype_intoCall, Nue = T.contractcallprototype_new, Vue = T.contractcallprototype_toString, Due = T.contractdeploy_address, Bue = T.contractdeploy_initialState, Fue = T.contractdeploy_new, Lue = T.contractdeploy_toString, zue = T.contractoperationversion_new, Uue = T.contractoperationversion_toString, Hue = T.contractoperationversion_version, jue = T.contractoperationversionedverifierkey_new, que = T.contractoperationversionedverifierkey_raw_vk, Wue = T.contractoperationversionedverifierkey_toString, Kue = T.contractoperationversionedverifierkey_version, $ue = T.createCheckPayload, Xue = T.createCoinInfo, Gue = T.createProvingPayload, Zue = T.createProvingTransactionPayload, Jue = T.createShieldedCoinInfo, Yue = T.dustactions_ctime, Que = T.dustactions_deserialize, ede = T.dustactions_new, tde = T.dustactions_registrations, nde = T.dustactions_serialize, rde = T.dustactions_set_ctime, sde = T.dustactions_set_registrations, ide = T.dustactions_set_spends, ode = T.dustactions_spends, ade = T.dustactions_toString, cde = T.dustgenerationstate_deserialize, lde = T.dustgenerationstate_new, ude = T.dustgenerationstate_serialize, dde = T.dustgenerationstate_toString, fde = T.dustlocalstate_deserialize, pde = T.dustlocalstate_generationInfo, hde = T.dustlocalstate_new, gde = T.dustlocalstate_params, bde = T.dustlocalstate_processTtls, mde = T.dustlocalstate_replayEvents, yde = T.dustlocalstate_replayEventsWithChanges, wde = T.dustlocalstate_serialize, _de = T.dustlocalstate_spend, xde = T.dustlocalstate_syncTime, vde = T.dustlocalstate_toString, Sde = T.dustlocalstate_utxos, kde = T.dustlocalstate_walletBalance, Tde = T.dustlocalstatewithchanges_changes, Cde = T.dustlocalstatewithchanges_state, Ede = T.dustparameters_deserialize, Ide = T.dustparameters_dustGracePeriodSeconds, Ade = T.dustparameters_generationDecayRate, Pde = T.dustparameters_new, Ode = T.dustparameters_nightDustRatio, Mde = T.dustparameters_serialize, Rde = T.dustparameters_set_dustGracePeriodSeconds, Nde = T.dustparameters_set_generationDecayRate, Vde = T.dustparameters_set_nightDustRatio, Dde = T.dustparameters_timeToCapSeconds, Bde = T.dustparameters_toString, Fde = T.dustregistration_allowFeePayment, Lde = T.dustregistration_deserialize, zde = T.dustregistration_dustAddress, Ude = T.dustregistration_new, Hde = T.dustregistration_nightKey, jde = T.dustregistration_serialize, qde = T.dustregistration_set_allowFeePayment, Wde = T.dustregistration_set_dustAddress, Kde = T.dustregistration_set_nightKey, $de = T.dustregistration_set_signature, Xde = T.dustregistration_signature, Gde = T.dustregistration_toString, Zde = T.dustsecretkey_clear, Jde = T.dustsecretkey_fromBigint, Yde = T.dustsecretkey_fromSeed, Qde = T.dustsecretkey_new, efe = T.dustsecretkey_publicKey, tfe = T.dustspend_new, nfe = T.dustspend_newCommitment, rfe = T.dustspend_oldNullifier, sfe = T.dustspend_proof, ife = T.dustspend_toString, ofe = T.dustspend_vFee, afe = T.duststate_deserialize, cfe = T.duststate_generation, lfe = T.duststate_new, ufe = T.duststate_serialize, dfe = T.duststate_toString, ffe = T.duststate_utxo, pfe = T.duststatechanges_receivedUtxos, hfe = T.duststatechanges_source, gfe = T.duststatechanges_spentUtxos, bfe = T.dustutxostate_deserialize, mfe = T.dustutxostate_new, yfe = T.dustutxostate_serialize, wfe = T.dustutxostate_toString, _fe = T.encryptionsecretkey_clear, xfe = T.encryptionsecretkey_deserialize, vfe = T.encryptionsecretkey_new, Sfe = T.encryptionsecretkey_public_key, kfe = T.encryptionsecretkey_taggedDeserialize, Tfe = T.encryptionsecretkey_test, Cfe = T.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize, Efe = T.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize, Ife = T.event_deserialize, Afe = T.event_new, Pfe = T.event_serialize, Ofe = T.event_toString, Mfe = T.feeToken, Rfe = T.intent_actions, Nfe = T.intent_addCall, Vfe = T.intent_addDeploy, Dfe = T.intent_addMaintenanceUpdate, Bfe = T.intent_bind, Ffe = T.intent_binding, Lfe = T.intent_construct, zfe = T.intent_deserialize, Ufe = T.intent_dustActions, Hfe = T.intent_eraseProofs, jfe = T.intent_eraseSignatures, qfe = T.intent_fallibleUnshieldedOffer, Wfe = T.intent_guaranteedUnshieldedOffer, Kfe = T.intent_intentHash, $fe = T.intent_new, Xfe = T.intent_serialize, Gfe = T.intent_set_actions, Zfe = T.intent_set_dustActions, Jfe = T.intent_set_fallibleUnshieldedOffer, Yfe = T.intent_set_guaranteedUnshieldedOffer, Qfe = T.intent_set_ttl, epe = T.intent_signatureData, tpe = T.intent_toString, npe = T.intent_ttl, rpe = T.ledgerparameters_deserialize, spe = T.ledgerparameters_dust, ipe = T.ledgerparameters_feePrices, ope = T.ledgerparameters_initialParameters, ape = T.ledgerparameters_maxPriceAdjustment, cpe = T.ledgerparameters_new, lpe = T.ledgerparameters_normalizeFullness, upe = T.ledgerparameters_serialize, dpe = T.ledgerparameters_toString, fpe = T.ledgerparameters_transactionCostModel, ppe = T.ledgerstate_apply, hpe = T.ledgerstate_applySystemTx, gpe = T.ledgerstate_blank, bpe = T.ledgerstate_block_reward_pool, mpe = T.ledgerstate_bridgeReceiving, ype = T.ledgerstate_deserialize, wpe = T.ledgerstate_dust, _pe = T.ledgerstate_index, xpe = T.ledgerstate_locked_pool, vpe = T.ledgerstate_new, Spe = T.ledgerstate_parameters, kpe = T.ledgerstate_postBlockUpdate, Tpe = T.ledgerstate_reserve_pool, Cpe = T.ledgerstate_serialize, Epe = T.ledgerstate_set_parameters, Ipe = T.ledgerstate_testingDistributeNight, Ape = T.ledgerstate_toString, Ppe = T.ledgerstate_treasuryBalance, Ope = T.ledgerstate_unclaimedBlockRewards, Mpe = T.ledgerstate_updateIndex, Rpe = T.ledgerstate_utxo, Npe = T.ledgerstate_zswap, Vpe = T.maintenanceupdate_addSignature, Dpe = T.maintenanceupdate_address, Bpe = T.maintenanceupdate_counter, Fpe = T.maintenanceupdate_data_to_sign, Lpe = T.maintenanceupdate_new, zpe = T.maintenanceupdate_signatures, Upe = T.maintenanceupdate_toString, Hpe = T.maintenanceupdate_updates, jpe = T.merkletreecollapsedupdate_deserialize, qpe = T.merkletreecollapsedupdate_new, Wpe = T.merkletreecollapsedupdate_serialize, Kpe = T.merkletreecollapsedupdate_toString, $pe = T.nativeToken, Xpe = T.nobinding_deserialize, Gpe = T.nobinding_instance, Zpe = T.nobinding_new, Jpe = T.nobinding_serialize, Ype = T.nobinding_toString, Qpe = T.noproof_instance, ehe = T.noproof_new, the = T.noproof_toString, nhe = T.parseCheckResult, rhe = T.partitionTranscripts, she = T.prebinding_deserialize, ihe = T.prebinding_instance, ohe = T.prebinding_new, ahe = T.prebinding_serialize, che = T.prebinding_toString, lhe = T.prepartitioncontractcall_new, uhe = T.prepartitioncontractcall_toString, dhe = T.preproof_deserialize, fhe = T.preproof_instance, phe = T.preproof_new, hhe = T.preproof_serialize, ghe = T.preproof_toString, bhe = T.pretranscript_new, mhe = T.pretranscript_toString, yhe = T.proof_deserialize, whe = T.proof_instance, _he = T.proof_new, xhe = T.proof_serialize, vhe = T.proof_toString, She = T.replaceauthority_authority, khe = T.replaceauthority_new, The = T.replaceauthority_toString, Che = T.sampleCoinPublicKey, Ehe = T.sampleDustSecretKey, Ihe = T.sampleEncryptionPublicKey, Ahe = T.sampleIntentHash, Phe = T.shieldedToken, Ohe = T.signatureenabled_deserialize, Mhe = T.signatureenabled_instance, Rhe = T.signatureenabled_new, Nhe = T.signatureenabled_serialize, Vhe = T.signatureenabled_toString, Dhe = T.signatureerased_instance, Bhe = T.signatureerased_toString, Fhe = T.systemtransaction_deserialize, Lhe = T.systemtransaction_new, zhe = T.systemtransaction_serialize, Uhe = T.systemtransaction_toString, Hhe = T.transaction_addCalls, jhe = T.transaction_bind, qhe = T.transaction_bindingRandomness, Whe = T.transaction_cost, Khe = T.transaction_deserialize, $he = T.transaction_eraseProofs, Xhe = T.transaction_eraseSignatures, Ghe = T.transaction_fallibleOffer, Zhe = T.transaction_fees, Jhe = T.transaction_feesWithMargin, Yhe = T.transaction_fromParts, Qhe = T.transaction_fromPartsRandomized, e0e = T.transaction_fromRewards, t0e = T.transaction_guaranteedOffer, n0e = T.transaction_identifiers, r0e = T.transaction_imbalances, s0e = T.transaction_intents, i0e = T.transaction_merge, o0e = T.transaction_mockProve, a0e = T.transaction_new, c0e = T.transaction_prove, l0e = T.transaction_rewards, u0e = T.transaction_serialize, d0e = T.transaction_set_fallibleOffer, f0e = T.transaction_set_guaranteedOffer, p0e = T.transaction_set_intents, h0e = T.transaction_toString, g0e = T.transaction_transactionHash, b0e = T.transaction_wellFormed, m0e = T.transactioncontext_new, y0e = T.transactioncontext_toString, w0e = T.transactioncostmodel_baselineCost, _0e = T.transactioncostmodel_deserialize, x0e = T.transactioncostmodel_initialTransactionCostModel, v0e = T.transactioncostmodel_new, S0e = T.transactioncostmodel_runtimeCostModel, k0e = T.transactioncostmodel_serialize, T0e = T.transactioncostmodel_toString, C0e = T.transactionresult_error, E0e = T.transactionresult_events, I0e = T.transactionresult_new, A0e = T.transactionresult_successfulSegments, P0e = T.transactionresult_toString, O0e = T.transactionresult_type_, M0e = T.unshieldedoffer_addSignatures, R0e = T.unshieldedoffer_construct, N0e = T.unshieldedoffer_eraseSignatures, V0e = T.unshieldedoffer_inputs, D0e = T.unshieldedoffer_new, B0e = T.unshieldedoffer_outputs, F0e = T.unshieldedoffer_signatures, L0e = T.unshieldedoffer_toString, z0e = T.updatedValue, U0e = T.utxometa_ctime, H0e = T.utxometa_new, j0e = T.utxometa_set_ctime, q0e = T.utxostate_delta, W0e = T.utxostate_filter, K0e = T.utxostate_lookupMeta, $0e = T.utxostate_new, X0e = T.utxostate_utxos, G0e = T.verifiedtransaction_transaction, Z0e = T.verifierkeyinsert_new, J0e = T.verifierkeyinsert_operation, Y0e = T.verifierkeyinsert_toString, Q0e = T.verifierkeyinsert_vk, ege = T.verifierkeyremove_new, tge = T.verifierkeyremove_operation, nge = T.verifierkeyremove_toString, rge = T.verifierkeyremove_version, sge = T.wellformedstrictness_enforce_balancing, ige = T.wellformedstrictness_enforce_limits, oge = T.wellformedstrictness_new, age = T.wellformedstrictness_set_enforce_balancing, cge = T.wellformedstrictness_set_enforce_limits, lge = T.wellformedstrictness_set_verify_contract_proofs, uge = T.wellformedstrictness_set_verify_native_proofs, dge = T.wellformedstrictness_set_verify_signatures, fge = T.wellformedstrictness_verify_contract_proofs, pge = T.wellformedstrictness_verify_native_proofs, hge = T.wellformedstrictness_verify_signatures, gge = T.zswapchainstate_deserialize, bge = T.zswapchainstate_deserializeFromLedgerState, mge = T.zswapchainstate_filter, yge = T.zswapchainstate_firstFree, wge = T.zswapchainstate_new, _ge = T.zswapchainstate_postBlockUpdate, xge = T.zswapchainstate_serialize, vge = T.zswapchainstate_toString, Sge = T.zswapchainstate_tryApply, kge = T.zswapinput_contractAddress, Tge = T.zswapinput_deserialize, Cge = T.zswapinput_new, Ege = T.zswapinput_newContractOwned, Ige = T.zswapinput_nullifier, Age = T.zswapinput_proof, Pge = T.zswapinput_serialize, Oge = T.zswapinput_toString, Mge = T.zswaplocalstate_apply, Rge = T.zswaplocalstate_applyCollapsedUpdate, Nge = T.zswaplocalstate_applyFailed, Vge = T.zswaplocalstate_clearPending, Dge = T.zswaplocalstate_coins, Bge = T.zswaplocalstate_deserialize, Fge = T.zswaplocalstate_firstFree, Lge = T.zswaplocalstate_new, zge = T.zswaplocalstate_pendingOutputs, Uge = T.zswaplocalstate_pendingSpends, Hge = T.zswaplocalstate_replayEvents, jge = T.zswaplocalstate_replayEventsWithChanges, qge = T.zswaplocalstate_revertTransaction, Wge = T.zswaplocalstate_serialize, Kge = T.zswaplocalstate_spend, $ge = T.zswaplocalstate_spendFromOutput, Xge = T.zswaplocalstate_toString, Gge = T.zswaplocalstate_watchFor, Zge = T.zswaplocalstatewithchanges_changes, Jge = T.zswaplocalstatewithchanges_state, Yge = T.zswapoffer_deltas, Qge = T.zswapoffer_deserialize, ebe = T.zswapoffer_fromInput, tbe = T.zswapoffer_fromOutput, nbe = T.zswapoffer_fromTransient, rbe = T.zswapoffer_inputs, sbe = T.zswapoffer_merge, ibe = T.zswapoffer_new, obe = T.zswapoffer_outputs, abe = T.zswapoffer_serialize, cbe = T.zswapoffer_toString, lbe = T.zswapoffer_transients, ube = T.zswapoutput_commitment, dbe = T.zswapoutput_construct, fbe = T.zswapoutput_contractAddress, pbe = T.zswapoutput_deserialize, hbe = T.zswapoutput_new, gbe = T.zswapoutput_newContractOwned, bbe = T.zswapoutput_proof, mbe = T.zswapoutput_serialize, ybe = T.zswapoutput_toString, wbe = T.zswapsecretkeys_clear, _be = T.zswapsecretkeys_coinPublicKey, xbe = T.zswapsecretkeys_coinSecretKey, vbe = T.zswapsecretkeys_encryptionPublicKey, Sbe = T.zswapsecretkeys_encryptionSecretKey, kbe = T.zswapsecretkeys_fromSeed, Tbe = T.zswapsecretkeys_fromSeedRng, Cbe = T.zswapsecretkeys_new, Ebe = T.zswapstatechanges_receivedCoins, Ibe = T.zswapstatechanges_source, Abe = T.zswapstatechanges_spentCoins, Pbe = T.zswaptransient_commitment, Obe = T.zswaptransient_contractAddress, Mbe = T.zswaptransient_deserialize, Rbe = T.zswaptransient_inputProof, Nbe = T.zswaptransient_new, Vbe = T.zswaptransient_newFromContractOwnedOutput, Dbe = T.zswaptransient_nullifier, Bbe = T.zswaptransient_outputProof, Fbe = T.zswaptransient_serialize, Lbe = T.zswaptransient_toString, zbe = T.signatureerased_new, Ube = T.unshieldedToken, Hbe = T.__wbg_signatureerased_free, jbe = T.__wbg_noproof_free, qbe = T.__wbg_verifierkeyremove_free, Wbe = T.__wbg_chargedstate_free, Kbe = T.__wbg_contractmaintenanceauthority_free, $be = T.__wbg_contractoperation_free, Xbe = T.__wbg_contractstate_free, Gbe = T.__wbg_costmodel_free, Zbe = T.__wbg_querycontext_free, Jbe = T.__wbg_queryresults_free, Ybe = T.__wbg_stateboundedmerkletree_free, Qbe = T.__wbg_statemap_free, eme = T.__wbg_statevalue_free, tme = T.__wbg_vmresults_free, nme = T.__wbg_vmstack_free, rme = T.bigIntModFr, sme = T.bigIntToValue, ime = T.chargedstate_new, ome = T.chargedstate_state, ame = T.chargedstate_toString, cme = T.communicationCommitment, lme = T.communicationCommitmentRandomness, ume = T.contractmaintenanceauthority_committee, dme = T.contractmaintenanceauthority_counter, fme = T.contractmaintenanceauthority_deserialize, pme = T.contractmaintenanceauthority_new, hme = T.contractmaintenanceauthority_serialize, gme = T.contractmaintenanceauthority_threshold, bme = T.contractmaintenanceauthority_toString, mme = T.contractoperation_deserialize, yme = T.contractoperation_new, wme = T.contractoperation_serialize, _me = T.contractoperation_set_verifier_key, xme = T.contractoperation_toString, vme = T.contractoperation_verifier_key, Sme = T.contractstate_balance, kme = T.contractstate_data, Tme = T.contractstate_deserialize, Cme = T.contractstate_maintenance_authority, Eme = T.contractstate_new, Ime = T.contractstate_operation, Ame = T.contractstate_operations, Pme = T.contractstate_query, Ome = T.contractstate_serialize, Mme = T.contractstate_setOperation, Rme = T.contractstate_set_balance, Nme = T.contractstate_set_data, Vme = T.contractstate_set_maintenance_authority, Dme = T.contractstate_toString, Bme = T.costmodel_initialCostModel, Fme = T.costmodel_new, Lme = T.costmodel_toString, zme = T.decodeCoinPublicKey, Ume = T.decodeContractAddress, Hme = T.decodeQualifiedShieldedCoinInfo, jme = T.decodeRawTokenType, qme = T.decodeShieldedCoinInfo, Wme = T.decodeUserAddress, Kme = T.degradeToTransient, $me = T.dummyContractAddress, Xme = T.dummyUserAddress, Gme = T.ecAdd, Zme = T.ecMul, Jme = T.ecMulGenerator, Yme = T.encodeCoinPublicKey, Qme = T.encodeContractAddress, eye = T.encodeQualifiedShieldedCoinInfo, tye = T.encodeRawTokenType, nye = T.encodeShieldedCoinInfo, rye = T.encodeUserAddress, sye = T.entryPointHash, iye = T.hashToCurve, oye = T.leafHash, aye = T.maxAlignedSize, cye = T.maxField, lye = T.persistentCommit, uye = T.persistentHash, dye = T.proofDataIntoSerializedPreimage, fye = T.querycontext_address, pye = T.querycontext_block, hye = T.querycontext_com_indices, gye = T.querycontext_effects, bye = T.querycontext_insertCommitment, mye = T.querycontext_new, yye = T.querycontext_qualify, wye = T.querycontext_query, _ye = T.querycontext_runTranscript, xye = T.querycontext_set_block, vye = T.querycontext_set_effects, Sye = T.querycontext_state, kye = T.querycontext_toString, Tye = T.querycontext_toVmStack, Cye = T.queryresults_context, Eye = T.queryresults_events, Iye = T.queryresults_gas_cost, Aye = T.queryresults_new, Pye = T.queryresults_toString, Oye = T.rawTokenType, Mye = T.runProgram, Rye = T.runtimeCoinCommitment, Nye = T.runtimeCoinNullifier, Vye = T.sampleContractAddress, Dye = T.sampleRawTokenType, Bye = T.sampleSigningKey, Fye = T.sampleUserAddress, Lye = T.signData, zye = T.signatureVerifyingKey, Uye = T.signingKeyFromBip340, Hye = T.stateboundedmerkletree_blank, jye = T.stateboundedmerkletree_collapse, qye = T.stateboundedmerkletree_findPathForLeaf, Wye = T.stateboundedmerkletree_height, Kye = T.stateboundedmerkletree_pathForLeaf, $ye = T.stateboundedmerkletree_rehash, Xye = T.stateboundedmerkletree_root, Gye = T.stateboundedmerkletree_toString, Zye = T.stateboundedmerkletree_update, Jye = T.statemap_get, Yye = T.statemap_insert, Qye = T.statemap_keys, e1e = T.statemap_new, t1e = T.statemap_remove, n1e = T.statemap_toString, r1e = T.statevalue_arrayPush, s1e = T.statevalue_asArray, i1e = T.statevalue_asBoundedMerkleTree, o1e = T.statevalue_asCell, a1e = T.statevalue_asMap, c1e = T.statevalue_decode, l1e = T.statevalue_encode, u1e = T.statevalue_logSize, d1e = T.statevalue_new, f1e = T.statevalue_newArray, p1e = T.statevalue_newBoundedMerkleTree, h1e = T.statevalue_newCell, g1e = T.statevalue_newMap, b1e = T.statevalue_newNull, m1e = T.statevalue_toString, y1e = T.statevalue_type, w1e = T.transientCommit, _1e = T.transientHash, x1e = T.upgradeFromTransient, v1e = T.valueToBigInt, S1e = T.verifySignature, k1e = T.vmresults_events, T1e = T.vmresults_gas_cost, C1e = T.vmresults_new, E1e = T.vmresults_stack, I1e = T.vmresults_toString, A1e = T.vmstack_get, P1e = T.vmstack_isStrong, O1e = T.vmstack_length, M1e = T.vmstack_new, R1e = T.vmstack_push, N1e = T.vmstack_removeLast, V1e = T.vmstack_toString, D1e = T.__wbg_intounderlyingbytesource_free, B1e = T.__wbg_intounderlyingsink_free, F1e = T.__wbg_intounderlyingsource_free, L1e = T.intounderlyingbytesource_autoAllocateChunkSize, z1e = T.intounderlyingbytesource_cancel, U1e = T.intounderlyingbytesource_pull, H1e = T.intounderlyingbytesource_start, j1e = T.intounderlyingbytesource_type, q1e = T.intounderlyingsink_abort, W1e = T.intounderlyingsink_close, K1e = T.intounderlyingsink_write, $1e = T.intounderlyingsource_cancel, X1e = T.intounderlyingsource_pull, G1e = T.__wbindgen_exn_store, Z1e = T.__externref_table_alloc, J1e = T.__wbindgen_export_2, Y1e = T.__wbindgen_malloc, Q1e = T.__wbindgen_realloc, ewe = T.__externref_drop_slice, twe = T.__wbindgen_free, nwe = T.__wbindgen_export_7, rwe = T.__externref_table_dealloc, swe = T.closure3109_externref_shim, iwe = T.closure3155_externref_shim, owe = T.closure3158_externref_shim, EH = T.__wbindgen_start, awe = Object.freeze(Object.defineProperty({
        __proto__: null,
        __externref_drop_slice: ewe,
        __externref_table_alloc: Z1e,
        __externref_table_dealloc: rwe,
        __wbg_authorizedclaim_free: Kce,
        __wbg_binding_free: $ce,
        __wbg_chargedstate_free: Wbe,
        __wbg_claimrewardstransaction_free: Xce,
        __wbg_coinsecretkey_free: Gce,
        __wbg_contractcall_free: Zce,
        __wbg_contractcallprototype_free: Jce,
        __wbg_contractdeploy_free: Yce,
        __wbg_contractmaintenanceauthority_free: Kbe,
        __wbg_contractoperation_free: $be,
        __wbg_contractoperationversion_free: Qce,
        __wbg_contractoperationversionedverifierkey_free: ele,
        __wbg_contractstate_free: Xbe,
        __wbg_costmodel_free: Gbe,
        __wbg_dustactions_free: tle,
        __wbg_dustgenerationstate_free: nle,
        __wbg_dustlocalstate_free: rle,
        __wbg_dustlocalstatewithchanges_free: sle,
        __wbg_dustparameters_free: ile,
        __wbg_dustregistration_free: ole,
        __wbg_dustsecretkey_free: ale,
        __wbg_dustspend_free: cle,
        __wbg_duststate_free: lle,
        __wbg_duststatechanges_free: ule,
        __wbg_dustutxostate_free: dle,
        __wbg_encryptionsecretkey_free: fle,
        __wbg_event_free: ple,
        __wbg_intent_free: hle,
        __wbg_intounderlyingbytesource_free: D1e,
        __wbg_intounderlyingsink_free: B1e,
        __wbg_intounderlyingsource_free: F1e,
        __wbg_ledgerparameters_free: gle,
        __wbg_ledgerstate_free: ble,
        __wbg_maintenanceupdate_free: mle,
        __wbg_merkletreecollapsedupdate_free: yle,
        __wbg_nobinding_free: wle,
        __wbg_noproof_free: jbe,
        __wbg_prebinding_free: _le,
        __wbg_prepartitioncontractcall_free: xle,
        __wbg_preproof_free: vle,
        __wbg_pretranscript_free: Sle,
        __wbg_proof_free: kle,
        __wbg_querycontext_free: Zbe,
        __wbg_queryresults_free: Jbe,
        __wbg_replaceauthority_free: Tle,
        __wbg_signatureenabled_free: Cle,
        __wbg_signatureerased_free: Hbe,
        __wbg_stateboundedmerkletree_free: Ybe,
        __wbg_statemap_free: Qbe,
        __wbg_statevalue_free: eme,
        __wbg_systemtransaction_free: Ele,
        __wbg_transaction_free: Ile,
        __wbg_transactioncontext_free: Ale,
        __wbg_transactioncostmodel_free: Ple,
        __wbg_transactionresult_free: Ole,
        __wbg_unshieldedoffer_free: Mle,
        __wbg_utxometa_free: Rle,
        __wbg_utxostate_free: Nle,
        __wbg_verifiedtransaction_free: Vle,
        __wbg_verifierkeyinsert_free: Dle,
        __wbg_verifierkeyremove_free: qbe,
        __wbg_vmresults_free: tme,
        __wbg_vmstack_free: nme,
        __wbg_wellformedstrictness_free: Ble,
        __wbg_zswapchainstate_free: Fle,
        __wbg_zswapinput_free: Lle,
        __wbg_zswaplocalstate_free: zle,
        __wbg_zswaplocalstatewithchanges_free: Ule,
        __wbg_zswapoffer_free: Hle,
        __wbg_zswapoutput_free: jle,
        __wbg_zswapsecretkeys_free: qle,
        __wbg_zswapstatechanges_free: Wle,
        __wbg_zswaptransient_free: Kle,
        __wbindgen_exn_store: G1e,
        __wbindgen_export_2: J1e,
        __wbindgen_export_7: nwe,
        __wbindgen_free: twe,
        __wbindgen_malloc: Y1e,
        __wbindgen_realloc: Q1e,
        __wbindgen_start: EH,
        addressFromKey: $le,
        authorizedclaim_coin: Xle,
        authorizedclaim_deserialize: Gle,
        authorizedclaim_eraseProof: Zle,
        authorizedclaim_new: Jle,
        authorizedclaim_recipient: Yle,
        authorizedclaim_serialize: Qle,
        authorizedclaim_toString: eue,
        bigIntModFr: rme,
        bigIntToValue: sme,
        binding_deserialize: tue,
        binding_instance: nue,
        binding_new: rue,
        binding_serialize: sue,
        binding_toString: iue,
        chargedstate_new: ime,
        chargedstate_state: ome,
        chargedstate_toString: ame,
        claimrewardstransaction_addSignature: oue,
        claimrewardstransaction_construct: aue,
        claimrewardstransaction_dataToSign: cue,
        claimrewardstransaction_deserialize: lue,
        claimrewardstransaction_eraseSignatures: uue,
        claimrewardstransaction_kind: due,
        claimrewardstransaction_new: fue,
        claimrewardstransaction_nonce: pue,
        claimrewardstransaction_owner: hue,
        claimrewardstransaction_serialize: gue,
        claimrewardstransaction_signature: bue,
        claimrewardstransaction_toString: mue,
        claimrewardstransaction_value: yue,
        closure3109_externref_shim: swe,
        closure3155_externref_shim: iwe,
        closure3158_externref_shim: owe,
        coinCommitment: wue,
        coinNullifier: _ue,
        coinsecretkey_clear: xue,
        coinsecretkey_new: vue,
        coinsecretkey_public_key: Sue,
        coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize: kue,
        communicationCommitment: cme,
        communicationCommitmentRandomness: lme,
        contractcall_address: Tue,
        contractcall_communicationCommitment: Cue,
        contractcall_entryPoint: Eue,
        contractcall_fallibleTranscript: Iue,
        contractcall_guaranteedTranscript: Aue,
        contractcall_new: Pue,
        contractcall_proof: Oue,
        contractcall_toString: Mue,
        contractcallprototype_intoCall: Rue,
        contractcallprototype_new: Nue,
        contractcallprototype_toString: Vue,
        contractdeploy_address: Due,
        contractdeploy_initialState: Bue,
        contractdeploy_new: Fue,
        contractdeploy_toString: Lue,
        contractmaintenanceauthority_committee: ume,
        contractmaintenanceauthority_counter: dme,
        contractmaintenanceauthority_deserialize: fme,
        contractmaintenanceauthority_new: pme,
        contractmaintenanceauthority_serialize: hme,
        contractmaintenanceauthority_threshold: gme,
        contractmaintenanceauthority_toString: bme,
        contractoperation_deserialize: mme,
        contractoperation_new: yme,
        contractoperation_serialize: wme,
        contractoperation_set_verifier_key: _me,
        contractoperation_toString: xme,
        contractoperation_verifier_key: vme,
        contractoperationversion_new: zue,
        contractoperationversion_toString: Uue,
        contractoperationversion_version: Hue,
        contractoperationversionedverifierkey_new: jue,
        contractoperationversionedverifierkey_raw_vk: que,
        contractoperationversionedverifierkey_toString: Wue,
        contractoperationversionedverifierkey_version: Kue,
        contractstate_balance: Sme,
        contractstate_data: kme,
        contractstate_deserialize: Tme,
        contractstate_maintenance_authority: Cme,
        contractstate_new: Eme,
        contractstate_operation: Ime,
        contractstate_operations: Ame,
        contractstate_query: Pme,
        contractstate_serialize: Ome,
        contractstate_setOperation: Mme,
        contractstate_set_balance: Rme,
        contractstate_set_data: Nme,
        contractstate_set_maintenance_authority: Vme,
        contractstate_toString: Dme,
        costmodel_initialCostModel: Bme,
        costmodel_new: Fme,
        costmodel_toString: Lme,
        createCheckPayload: $ue,
        createCoinInfo: Xue,
        createProvingPayload: Gue,
        createProvingTransactionPayload: Zue,
        createShieldedCoinInfo: Jue,
        decodeCoinPublicKey: zme,
        decodeContractAddress: Ume,
        decodeQualifiedShieldedCoinInfo: Hme,
        decodeRawTokenType: jme,
        decodeShieldedCoinInfo: qme,
        decodeUserAddress: Wme,
        degradeToTransient: Kme,
        dummyContractAddress: $me,
        dummyUserAddress: Xme,
        dustactions_ctime: Yue,
        dustactions_deserialize: Que,
        dustactions_new: ede,
        dustactions_registrations: tde,
        dustactions_serialize: nde,
        dustactions_set_ctime: rde,
        dustactions_set_registrations: sde,
        dustactions_set_spends: ide,
        dustactions_spends: ode,
        dustactions_toString: ade,
        dustgenerationstate_deserialize: cde,
        dustgenerationstate_new: lde,
        dustgenerationstate_serialize: ude,
        dustgenerationstate_toString: dde,
        dustlocalstate_deserialize: fde,
        dustlocalstate_generationInfo: pde,
        dustlocalstate_new: hde,
        dustlocalstate_params: gde,
        dustlocalstate_processTtls: bde,
        dustlocalstate_replayEvents: mde,
        dustlocalstate_replayEventsWithChanges: yde,
        dustlocalstate_serialize: wde,
        dustlocalstate_spend: _de,
        dustlocalstate_syncTime: xde,
        dustlocalstate_toString: vde,
        dustlocalstate_utxos: Sde,
        dustlocalstate_walletBalance: kde,
        dustlocalstatewithchanges_changes: Tde,
        dustlocalstatewithchanges_state: Cde,
        dustparameters_deserialize: Ede,
        dustparameters_dustGracePeriodSeconds: Ide,
        dustparameters_generationDecayRate: Ade,
        dustparameters_new: Pde,
        dustparameters_nightDustRatio: Ode,
        dustparameters_serialize: Mde,
        dustparameters_set_dustGracePeriodSeconds: Rde,
        dustparameters_set_generationDecayRate: Nde,
        dustparameters_set_nightDustRatio: Vde,
        dustparameters_timeToCapSeconds: Dde,
        dustparameters_toString: Bde,
        dustregistration_allowFeePayment: Fde,
        dustregistration_deserialize: Lde,
        dustregistration_dustAddress: zde,
        dustregistration_new: Ude,
        dustregistration_nightKey: Hde,
        dustregistration_serialize: jde,
        dustregistration_set_allowFeePayment: qde,
        dustregistration_set_dustAddress: Wde,
        dustregistration_set_nightKey: Kde,
        dustregistration_set_signature: $de,
        dustregistration_signature: Xde,
        dustregistration_toString: Gde,
        dustsecretkey_clear: Zde,
        dustsecretkey_fromBigint: Jde,
        dustsecretkey_fromSeed: Yde,
        dustsecretkey_new: Qde,
        dustsecretkey_publicKey: efe,
        dustspend_new: tfe,
        dustspend_newCommitment: nfe,
        dustspend_oldNullifier: rfe,
        dustspend_proof: sfe,
        dustspend_toString: ife,
        dustspend_vFee: ofe,
        duststate_deserialize: afe,
        duststate_generation: cfe,
        duststate_new: lfe,
        duststate_serialize: ufe,
        duststate_toString: dfe,
        duststate_utxo: ffe,
        duststatechanges_receivedUtxos: pfe,
        duststatechanges_source: hfe,
        duststatechanges_spentUtxos: gfe,
        dustutxostate_deserialize: bfe,
        dustutxostate_new: mfe,
        dustutxostate_serialize: yfe,
        dustutxostate_toString: wfe,
        ecAdd: Gme,
        ecMul: Zme,
        ecMulGenerator: Jme,
        encodeCoinPublicKey: Yme,
        encodeContractAddress: Qme,
        encodeQualifiedShieldedCoinInfo: eye,
        encodeRawTokenType: tye,
        encodeShieldedCoinInfo: nye,
        encodeUserAddress: rye,
        encryptionsecretkey_clear: _fe,
        encryptionsecretkey_deserialize: xfe,
        encryptionsecretkey_new: vfe,
        encryptionsecretkey_public_key: Sfe,
        encryptionsecretkey_taggedDeserialize: kfe,
        encryptionsecretkey_test: Tfe,
        encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize: Cfe,
        encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize: Efe,
        entryPointHash: sye,
        event_deserialize: Ife,
        event_new: Afe,
        event_serialize: Pfe,
        event_toString: Ofe,
        feeToken: Mfe,
        hashToCurve: iye,
        intent_actions: Rfe,
        intent_addCall: Nfe,
        intent_addDeploy: Vfe,
        intent_addMaintenanceUpdate: Dfe,
        intent_bind: Bfe,
        intent_binding: Ffe,
        intent_construct: Lfe,
        intent_deserialize: zfe,
        intent_dustActions: Ufe,
        intent_eraseProofs: Hfe,
        intent_eraseSignatures: jfe,
        intent_fallibleUnshieldedOffer: qfe,
        intent_guaranteedUnshieldedOffer: Wfe,
        intent_intentHash: Kfe,
        intent_new: $fe,
        intent_serialize: Xfe,
        intent_set_actions: Gfe,
        intent_set_dustActions: Zfe,
        intent_set_fallibleUnshieldedOffer: Jfe,
        intent_set_guaranteedUnshieldedOffer: Yfe,
        intent_set_ttl: Qfe,
        intent_signatureData: epe,
        intent_toString: tpe,
        intent_ttl: npe,
        intounderlyingbytesource_autoAllocateChunkSize: L1e,
        intounderlyingbytesource_cancel: z1e,
        intounderlyingbytesource_pull: U1e,
        intounderlyingbytesource_start: H1e,
        intounderlyingbytesource_type: j1e,
        intounderlyingsink_abort: q1e,
        intounderlyingsink_close: W1e,
        intounderlyingsink_write: K1e,
        intounderlyingsource_cancel: $1e,
        intounderlyingsource_pull: X1e,
        leafHash: oye,
        ledgerparameters_deserialize: rpe,
        ledgerparameters_dust: spe,
        ledgerparameters_feePrices: ipe,
        ledgerparameters_initialParameters: ope,
        ledgerparameters_maxPriceAdjustment: ape,
        ledgerparameters_new: cpe,
        ledgerparameters_normalizeFullness: lpe,
        ledgerparameters_serialize: upe,
        ledgerparameters_toString: dpe,
        ledgerparameters_transactionCostModel: fpe,
        ledgerstate_apply: ppe,
        ledgerstate_applySystemTx: hpe,
        ledgerstate_blank: gpe,
        ledgerstate_block_reward_pool: bpe,
        ledgerstate_bridgeReceiving: mpe,
        ledgerstate_deserialize: ype,
        ledgerstate_dust: wpe,
        ledgerstate_index: _pe,
        ledgerstate_locked_pool: xpe,
        ledgerstate_new: vpe,
        ledgerstate_parameters: Spe,
        ledgerstate_postBlockUpdate: kpe,
        ledgerstate_reserve_pool: Tpe,
        ledgerstate_serialize: Cpe,
        ledgerstate_set_parameters: Epe,
        ledgerstate_testingDistributeNight: Ipe,
        ledgerstate_toString: Ape,
        ledgerstate_treasuryBalance: Ppe,
        ledgerstate_unclaimedBlockRewards: Ope,
        ledgerstate_updateIndex: Mpe,
        ledgerstate_utxo: Rpe,
        ledgerstate_zswap: Npe,
        maintenanceupdate_addSignature: Vpe,
        maintenanceupdate_address: Dpe,
        maintenanceupdate_counter: Bpe,
        maintenanceupdate_data_to_sign: Fpe,
        maintenanceupdate_new: Lpe,
        maintenanceupdate_signatures: zpe,
        maintenanceupdate_toString: Upe,
        maintenanceupdate_updates: Hpe,
        maxAlignedSize: aye,
        maxField: cye,
        memory: Wce,
        merkletreecollapsedupdate_deserialize: jpe,
        merkletreecollapsedupdate_new: qpe,
        merkletreecollapsedupdate_serialize: Wpe,
        merkletreecollapsedupdate_toString: Kpe,
        nativeToken: $pe,
        nobinding_deserialize: Xpe,
        nobinding_instance: Gpe,
        nobinding_new: Zpe,
        nobinding_serialize: Jpe,
        nobinding_toString: Ype,
        noproof_instance: Qpe,
        noproof_new: ehe,
        noproof_toString: the,
        parseCheckResult: nhe,
        partitionTranscripts: rhe,
        persistentCommit: lye,
        persistentHash: uye,
        prebinding_deserialize: she,
        prebinding_instance: ihe,
        prebinding_new: ohe,
        prebinding_serialize: ahe,
        prebinding_toString: che,
        prepartitioncontractcall_new: lhe,
        prepartitioncontractcall_toString: uhe,
        preproof_deserialize: dhe,
        preproof_instance: fhe,
        preproof_new: phe,
        preproof_serialize: hhe,
        preproof_toString: ghe,
        pretranscript_new: bhe,
        pretranscript_toString: mhe,
        proofDataIntoSerializedPreimage: dye,
        proof_deserialize: yhe,
        proof_instance: whe,
        proof_new: _he,
        proof_serialize: xhe,
        proof_toString: vhe,
        querycontext_address: fye,
        querycontext_block: pye,
        querycontext_com_indices: hye,
        querycontext_effects: gye,
        querycontext_insertCommitment: bye,
        querycontext_new: mye,
        querycontext_qualify: yye,
        querycontext_query: wye,
        querycontext_runTranscript: _ye,
        querycontext_set_block: xye,
        querycontext_set_effects: vye,
        querycontext_state: Sye,
        querycontext_toString: kye,
        querycontext_toVmStack: Tye,
        queryresults_context: Cye,
        queryresults_events: Eye,
        queryresults_gas_cost: Iye,
        queryresults_new: Aye,
        queryresults_toString: Pye,
        rawTokenType: Oye,
        replaceauthority_authority: She,
        replaceauthority_new: khe,
        replaceauthority_toString: The,
        runProgram: Mye,
        runtimeCoinCommitment: Rye,
        runtimeCoinNullifier: Nye,
        sampleCoinPublicKey: Che,
        sampleContractAddress: Vye,
        sampleDustSecretKey: Ehe,
        sampleEncryptionPublicKey: Ihe,
        sampleIntentHash: Ahe,
        sampleRawTokenType: Dye,
        sampleSigningKey: Bye,
        sampleUserAddress: Fye,
        shieldedToken: Phe,
        signData: Lye,
        signatureVerifyingKey: zye,
        signatureenabled_deserialize: Ohe,
        signatureenabled_instance: Mhe,
        signatureenabled_new: Rhe,
        signatureenabled_serialize: Nhe,
        signatureenabled_toString: Vhe,
        signatureerased_instance: Dhe,
        signatureerased_new: zbe,
        signatureerased_toString: Bhe,
        signingKeyFromBip340: Uye,
        stateboundedmerkletree_blank: Hye,
        stateboundedmerkletree_collapse: jye,
        stateboundedmerkletree_findPathForLeaf: qye,
        stateboundedmerkletree_height: Wye,
        stateboundedmerkletree_pathForLeaf: Kye,
        stateboundedmerkletree_rehash: $ye,
        stateboundedmerkletree_root: Xye,
        stateboundedmerkletree_toString: Gye,
        stateboundedmerkletree_update: Zye,
        statemap_get: Jye,
        statemap_insert: Yye,
        statemap_keys: Qye,
        statemap_new: e1e,
        statemap_remove: t1e,
        statemap_toString: n1e,
        statevalue_arrayPush: r1e,
        statevalue_asArray: s1e,
        statevalue_asBoundedMerkleTree: i1e,
        statevalue_asCell: o1e,
        statevalue_asMap: a1e,
        statevalue_decode: c1e,
        statevalue_encode: l1e,
        statevalue_logSize: u1e,
        statevalue_new: d1e,
        statevalue_newArray: f1e,
        statevalue_newBoundedMerkleTree: p1e,
        statevalue_newCell: h1e,
        statevalue_newMap: g1e,
        statevalue_newNull: b1e,
        statevalue_toString: m1e,
        statevalue_type: y1e,
        systemtransaction_deserialize: Fhe,
        systemtransaction_new: Lhe,
        systemtransaction_serialize: zhe,
        systemtransaction_toString: Uhe,
        transaction_addCalls: Hhe,
        transaction_bind: jhe,
        transaction_bindingRandomness: qhe,
        transaction_cost: Whe,
        transaction_deserialize: Khe,
        transaction_eraseProofs: $he,
        transaction_eraseSignatures: Xhe,
        transaction_fallibleOffer: Ghe,
        transaction_fees: Zhe,
        transaction_feesWithMargin: Jhe,
        transaction_fromParts: Yhe,
        transaction_fromPartsRandomized: Qhe,
        transaction_fromRewards: e0e,
        transaction_guaranteedOffer: t0e,
        transaction_identifiers: n0e,
        transaction_imbalances: r0e,
        transaction_intents: s0e,
        transaction_merge: i0e,
        transaction_mockProve: o0e,
        transaction_new: a0e,
        transaction_prove: c0e,
        transaction_rewards: l0e,
        transaction_serialize: u0e,
        transaction_set_fallibleOffer: d0e,
        transaction_set_guaranteedOffer: f0e,
        transaction_set_intents: p0e,
        transaction_toString: h0e,
        transaction_transactionHash: g0e,
        transaction_wellFormed: b0e,
        transactioncontext_new: m0e,
        transactioncontext_toString: y0e,
        transactioncostmodel_baselineCost: w0e,
        transactioncostmodel_deserialize: _0e,
        transactioncostmodel_initialTransactionCostModel: x0e,
        transactioncostmodel_new: v0e,
        transactioncostmodel_runtimeCostModel: S0e,
        transactioncostmodel_serialize: k0e,
        transactioncostmodel_toString: T0e,
        transactionresult_error: C0e,
        transactionresult_events: E0e,
        transactionresult_new: I0e,
        transactionresult_successfulSegments: A0e,
        transactionresult_toString: P0e,
        transactionresult_type_: O0e,
        transientCommit: w1e,
        transientHash: _1e,
        unshieldedToken: Ube,
        unshieldedoffer_addSignatures: M0e,
        unshieldedoffer_construct: R0e,
        unshieldedoffer_eraseSignatures: N0e,
        unshieldedoffer_inputs: V0e,
        unshieldedoffer_new: D0e,
        unshieldedoffer_outputs: B0e,
        unshieldedoffer_signatures: F0e,
        unshieldedoffer_toString: L0e,
        updatedValue: z0e,
        upgradeFromTransient: x1e,
        utxometa_ctime: U0e,
        utxometa_new: H0e,
        utxometa_set_ctime: j0e,
        utxostate_delta: q0e,
        utxostate_filter: W0e,
        utxostate_lookupMeta: K0e,
        utxostate_new: $0e,
        utxostate_utxos: X0e,
        valueToBigInt: v1e,
        verifiedtransaction_transaction: G0e,
        verifierkeyinsert_new: Z0e,
        verifierkeyinsert_operation: J0e,
        verifierkeyinsert_toString: Y0e,
        verifierkeyinsert_vk: Q0e,
        verifierkeyremove_new: ege,
        verifierkeyremove_operation: tge,
        verifierkeyremove_toString: nge,
        verifierkeyremove_version: rge,
        verifySignature: S1e,
        vmresults_events: k1e,
        vmresults_gas_cost: T1e,
        vmresults_new: C1e,
        vmresults_stack: E1e,
        vmresults_toString: I1e,
        vmstack_get: A1e,
        vmstack_isStrong: P1e,
        vmstack_length: O1e,
        vmstack_new: M1e,
        vmstack_push: R1e,
        vmstack_removeLast: N1e,
        vmstack_toString: V1e,
        wellformedstrictness_enforce_balancing: sge,
        wellformedstrictness_enforce_limits: ige,
        wellformedstrictness_new: oge,
        wellformedstrictness_set_enforce_balancing: age,
        wellformedstrictness_set_enforce_limits: cge,
        wellformedstrictness_set_verify_contract_proofs: lge,
        wellformedstrictness_set_verify_native_proofs: uge,
        wellformedstrictness_set_verify_signatures: dge,
        wellformedstrictness_verify_contract_proofs: fge,
        wellformedstrictness_verify_native_proofs: pge,
        wellformedstrictness_verify_signatures: hge,
        zswapchainstate_deserialize: gge,
        zswapchainstate_deserializeFromLedgerState: bge,
        zswapchainstate_filter: mge,
        zswapchainstate_firstFree: yge,
        zswapchainstate_new: wge,
        zswapchainstate_postBlockUpdate: _ge,
        zswapchainstate_serialize: xge,
        zswapchainstate_toString: vge,
        zswapchainstate_tryApply: Sge,
        zswapinput_contractAddress: kge,
        zswapinput_deserialize: Tge,
        zswapinput_new: Cge,
        zswapinput_newContractOwned: Ege,
        zswapinput_nullifier: Ige,
        zswapinput_proof: Age,
        zswapinput_serialize: Pge,
        zswapinput_toString: Oge,
        zswaplocalstate_apply: Mge,
        zswaplocalstate_applyCollapsedUpdate: Rge,
        zswaplocalstate_applyFailed: Nge,
        zswaplocalstate_clearPending: Vge,
        zswaplocalstate_coins: Dge,
        zswaplocalstate_deserialize: Bge,
        zswaplocalstate_firstFree: Fge,
        zswaplocalstate_new: Lge,
        zswaplocalstate_pendingOutputs: zge,
        zswaplocalstate_pendingSpends: Uge,
        zswaplocalstate_replayEvents: Hge,
        zswaplocalstate_replayEventsWithChanges: jge,
        zswaplocalstate_revertTransaction: qge,
        zswaplocalstate_serialize: Wge,
        zswaplocalstate_spend: Kge,
        zswaplocalstate_spendFromOutput: $ge,
        zswaplocalstate_toString: Xge,
        zswaplocalstate_watchFor: Gge,
        zswaplocalstatewithchanges_changes: Zge,
        zswaplocalstatewithchanges_state: Jge,
        zswapoffer_deltas: Yge,
        zswapoffer_deserialize: Qge,
        zswapoffer_fromInput: ebe,
        zswapoffer_fromOutput: tbe,
        zswapoffer_fromTransient: nbe,
        zswapoffer_inputs: rbe,
        zswapoffer_merge: sbe,
        zswapoffer_new: ibe,
        zswapoffer_outputs: obe,
        zswapoffer_serialize: abe,
        zswapoffer_toString: cbe,
        zswapoffer_transients: lbe,
        zswapoutput_commitment: ube,
        zswapoutput_construct: dbe,
        zswapoutput_contractAddress: fbe,
        zswapoutput_deserialize: pbe,
        zswapoutput_new: hbe,
        zswapoutput_newContractOwned: gbe,
        zswapoutput_proof: bbe,
        zswapoutput_serialize: mbe,
        zswapoutput_toString: ybe,
        zswapsecretkeys_clear: wbe,
        zswapsecretkeys_coinPublicKey: _be,
        zswapsecretkeys_coinSecretKey: xbe,
        zswapsecretkeys_encryptionPublicKey: vbe,
        zswapsecretkeys_encryptionSecretKey: Sbe,
        zswapsecretkeys_fromSeed: kbe,
        zswapsecretkeys_fromSeedRng: Tbe,
        zswapsecretkeys_new: Cbe,
        zswapstatechanges_receivedCoins: Ebe,
        zswapstatechanges_source: Ibe,
        zswapstatechanges_spentCoins: Abe,
        zswaptransient_commitment: Pbe,
        zswaptransient_contractAddress: Obe,
        zswaptransient_deserialize: Mbe,
        zswaptransient_inputProof: Rbe,
        zswaptransient_new: Nbe,
        zswaptransient_newFromContractOwnedOutput: Vbe,
        zswaptransient_nullifier: Dbe,
        zswaptransient_outputProof: Bbe,
        zswaptransient_serialize: Fbe,
        zswaptransient_toString: Lbe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    Vie(awe);
    EH();
    const Es = new class {
        empty = ()=>new Map;
        fromEntry = (t, e)=>new Map([
                [
                    t,
                    e
                ]
            ]);
        fromEntries = (t)=>{
            const e = new Map;
            for (const [n, r] of t){
                const s = this.getValue(e, n);
                e.set(n, r + s);
            }
            return e;
        };
        fromMap = (t)=>this.fromEntries(t.entries());
        fromMaybeMap = (t)=>this.fromMap(t ?? new Map);
        getValue = (t, e)=>t.get(e) ?? 0n;
        typeSet = (t)=>new Set(t.keys());
        ensureZerosFor(t, e) {
            const n = this.fromEntries(t.entries());
            for (const r of e){
                const s = this.getValue(n, r);
                n.set(r, s);
            }
            return n;
        }
        merge = (t, e)=>{
            const n = this.typeSet(t).union(this.typeSet(e));
            return this.fromEntries(n.values().map((r)=>{
                const s = this.getValue(t, r), i = this.getValue(e, r);
                return [
                    r,
                    s + i
                ];
            }).filter(([, r])=>r !== 0n).toArray());
        };
    };
    class cwe {
        imbalances;
        transactionCostModel;
        feeTokenType;
        inputs;
        outputs;
        targetImbalances;
        constructor(e, n, r, s){
            this.imbalances = Es.ensureZerosFor(e, Es.typeSet(s)), this.transactionCostModel = n, this.feeTokenType = r, this.inputs = [], this.outputs = [], this.targetImbalances = s;
        }
        getTargetImbalance(e) {
            return this.targetImbalances.get(e) ?? 0n;
        }
        findNonNativeImbalance() {
            return Array.from(this.imbalances.entries()).filter(([e])=>e !== this.feeTokenType).find(([e, n])=>n !== this.getTargetImbalance(e));
        }
        findNativeImbalance() {
            if (!this.feeTokenType) return;
            const e = this.imbalances.get(this.feeTokenType);
            if (e !== void 0 && e !== this.getTargetImbalance(this.feeTokenType)) return [
                this.feeTokenType,
                e
            ];
        }
        addInput(e) {
            this.inputs.push(e);
            const n = this.imbalances.get(e.type) || 0n;
            this.imbalances.set(e.type, n + e.value);
            const r = this.imbalances.get(this.feeTokenType) || 0n;
            this.imbalances.set(this.feeTokenType, r - this.transactionCostModel.inputFeeOverhead);
        }
        addOutput(e) {
            const n = this.imbalances.get(e.type) || 0n, r = e.type === this.feeTokenType ? this.transactionCostModel.outputFeeOverhead : 0n, s = e.value < 0n ? -e.value : e.value;
            if (this.outputs.push({
                ...e,
                type: e.type,
                value: s - r
            }), this.imbalances.set(e.type, n - s), e.type !== this.feeTokenType) {
                const i = this.imbalances.get(this.feeTokenType) || 0n;
                this.imbalances.set(this.feeTokenType, i - this.transactionCostModel.outputFeeOverhead);
            }
        }
    }
    let jm = class extends Error {
        tokenType;
        constructor(e){
            super(`Insufficient Funds: could not balance ${e}`), this.tokenType = e;
        }
    };
    let b2, lwe, qM, GT, uwe, Ht, Qx, WM, qm, IH, m2;
    b2 = ({ coins: t, initialImbalances: e, transactionCostModel: n, feeTokenType: r, createOutput: s, coinSelection: i, isCoinEqual: o, targetImbalances: a })=>{
        const c = lwe(t, e, n, r, i ?? GT, s, o, a);
        return {
            inputs: c.inputs,
            outputs: c.outputs
        };
    };
    lwe = (t, e, n, r, s, i, o, a = new Map)=>{
        const c = new cwe(e, n, r, a);
        let l;
        for(; l = c.findNonNativeImbalance();)t = qM(l, t, c, s, i, o);
        for(; l = c.findNativeImbalance();)t = qM(l, t, c, s, i, o);
        return c;
    };
    qM = (t, e, n, r, s, i)=>{
        const [o, a] = t;
        if (o === n.feeTokenType && a >= n.getTargetImbalance(n.feeTokenType) + n.transactionCostModel.outputFeeOverhead || o !== n.feeTokenType && a > n.getTargetImbalance(o)) {
            const l = s({
                type: o,
                value: a - n.getTargetImbalance(o)
            });
            n.addOutput(l);
        } else {
            const l = r(e, o, a, n.transactionCostModel);
            if (typeof l > "u") throw new jm(o);
            n.addInput(l), e = e.filter((u)=>!i(u, l));
        }
        return e;
    };
    GT = (t, e)=>t.filter((n)=>n.type === e).sort((n, r)=>Number(n.value - r.value)).at(0);
    uwe = (t)=>typeof t == "function";
    j = function(t, e) {
        if (typeof t == "function") return function() {
            return t(arguments) ? e.apply(this, arguments) : (n)=>e(n, ...arguments);
        };
        switch(t){
            case 0:
            case 1:
                throw new RangeError(`Invalid arity ${t}`);
            case 2:
                return function(n, r) {
                    return arguments.length >= 2 ? e(n, r) : function(s) {
                        return e(s, n);
                    };
                };
            case 3:
                return function(n, r, s) {
                    return arguments.length >= 3 ? e(n, r, s) : function(i) {
                        return e(i, n, r);
                    };
                };
            case 4:
                return function(n, r, s, i) {
                    return arguments.length >= 4 ? e(n, r, s, i) : function(o) {
                        return e(o, n, r, s);
                    };
                };
            case 5:
                return function(n, r, s, i, o) {
                    return arguments.length >= 5 ? e(n, r, s, i, o) : function(a) {
                        return e(a, n, r, s, i);
                    };
                };
            default:
                return function() {
                    if (arguments.length >= t) return e.apply(this, arguments);
                    const n = arguments;
                    return function(r) {
                        return e(r, ...n);
                    };
                };
        }
    };
    Ht = (t)=>t;
    Qx = (t)=>()=>t;
    WM = Qx(!0);
    qm = Qx(!1);
    IH = Qx(void 0);
    m2 = IH;
    V = function(t, e, n, r, s, i, o, a, c) {
        switch(arguments.length){
            case 1:
                return t;
            case 2:
                return e(t);
            case 3:
                return n(e(t));
            case 4:
                return r(n(e(t)));
            case 5:
                return s(r(n(e(t))));
            case 6:
                return i(s(r(n(e(t)))));
            case 7:
                return o(i(s(r(n(e(t))))));
            case 8:
                return a(o(i(s(r(n(e(t)))))));
            case 9:
                return c(a(o(i(s(r(n(e(t))))))));
            default:
                {
                    let l = arguments[0];
                    for(let u = 1; u < arguments.length; u++)l = arguments[u](l);
                    return l;
                }
        }
    };
    const E0 = (t)=>(e, n)=>e === n || t(e, n), dwe = (t, e)=>t === e, fwe = ()=>dwe, pwe = fwe(), AH = j(2, (t, e)=>E0((n, r)=>t(e(n), e(r)))), hwe = AH(pwe, (t)=>t.getTime()), gwe = (t)=>E0((e, n)=>{
            if (e.length !== n.length) return !1;
            for(let r = 0; r < e.length; r++)if (!t(e[r], n[r])) return !1;
            return !0;
        }), bwe = (t)=>j(3, (e, n, r)=>t(e, (s)=>({
                    ...s,
                    [n]: r(s)
                }))), mwe = (t)=>j(2, (e, n)=>t(e, (r)=>({
                    [n]: r
                }))), ywe = (t, e)=>j(3, (n, r, s)=>e(n, (i)=>t(s(i), (o)=>({
                        ...i,
                        [r]: o
                    })))), KM = "effect/GlobalValue";
    let _b;
    let wwe, ZT, JT, bh, OH, MH, tv, u6, Twe;
    Xt = (t, e)=>(_b || (globalThis[KM] ??= new Map, _b = globalThis[KM]), _b.has(t) || _b.set(t, e()), _b.get(t));
    wwe = (t)=>t instanceof Map;
    To = (t)=>typeof t == "string";
    sp = (t)=>typeof t == "number";
    Hy = (t)=>typeof t == "boolean";
    ev = (t)=>typeof t == "bigint";
    l6 = (t)=>typeof t == "symbol";
    mg = uwe;
    _we = (t)=>t === void 0;
    xwe = (t)=>!1;
    ZT = (t)=>typeof t == "object" && t !== null;
    qc = (t)=>ZT(t) || mg(t);
    Ft = j(2, (t, e)=>qc(t) && e in t);
    JT = j(2, (t, e)=>Ft(t, "_tag") && t._tag === e);
    bh = (t)=>t == null;
    vwe = (t)=>t != null;
    Kwt = (t)=>t instanceof Error;
    Swe = (t)=>t instanceof Uint8Array;
    PH = (t)=>t instanceof Date;
    OH = (t)=>typeof t == "string" || Ft(t, Symbol.iterator);
    kwe = (t)=>ZT(t) && !Array.isArray(t);
    MH = (t)=>Ft(t, "then") && mg(t.then);
    tv = (t)=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;
    u6 = Symbol.for("effect/Gen/GenKind");
    Twe = (t)=>qc(t) && u6 in t;
    class Cwe {
        value;
        constructor(e){
            this.value = e;
        }
        get _F() {
            return Ht;
        }
        get _R() {
            return (e)=>e;
        }
        get _O() {
            return (e)=>e;
        }
        get _E() {
            return (e)=>e;
        }
        [u6] = u6;
        [Symbol.iterator]() {
            return new YT(this);
        }
    }
    let YT = class RH {
        self;
        called = !1;
        constructor(e){
            this.self = e;
        }
        next(e) {
            return this.called ? {
                value: e,
                done: !0
            } : (this.called = !0, {
                value: this.self,
                done: !1
            });
        }
        return(e) {
            return {
                value: e,
                done: !0
            };
        }
        throw(e) {
            throw e;
        }
        [Symbol.iterator]() {
            return new RH(this.self);
        }
    };
    const Ewe = ()=>function() {
            let t = arguments[0];
            for(let e = 1; e < arguments.length; e++)t = arguments[e](t);
            return new Cwe(t);
        }, Iwe = 335903614, Awe = 4150755663, Pwe = 1481765933, Owe = 1284865837, Mwe = 9007199254740992, Rwe = 134217728;
    class Nwe {
        _state;
        constructor(e, n, r, s){
            return bh(n) && bh(e) ? (n = Math.random() * 4294967295 >>> 0, e = 0) : bh(n) && (n = e, e = 0), bh(s) && bh(r) ? (s = this._state ? this._state[3] : Awe, r = this._state ? this._state[2] : Iwe) : bh(s) && (s = r, r = 0), this._state = new Int32Array([
                0,
                0,
                r >>> 0,
                ((s || 0) | 1) >>> 0
            ]), this._next(), $M(this._state, this._state[0], this._state[1], e >>> 0, n >>> 0), this._next(), this;
        }
        getState() {
            return [
                this._state[0],
                this._state[1],
                this._state[2],
                this._state[3]
            ];
        }
        setState(e) {
            this._state[0] = e[0], this._state[1] = e[1], this._state[2] = e[2], this._state[3] = e[3] | 1;
        }
        integer(e) {
            return Math.round(this.number() * Number.MAX_SAFE_INTEGER) % e;
        }
        number() {
            const e = (this._next() & 67108863) * 1, n = (this._next() & 134217727) * 1;
            return (e * Rwe + n) / Mwe;
        }
        _next() {
            const e = this._state[0] >>> 0, n = this._state[1] >>> 0;
            Vwe(this._state, e, n, Pwe, Owe), $M(this._state, this._state[0], this._state[1], this._state[2], this._state[3]);
            let r = e >>> 18, s = (n >>> 18 | e << 14) >>> 0;
            r = (r ^ e) >>> 0, s = (s ^ n) >>> 0;
            const i = (s >>> 27 | r << 5) >>> 0, o = e >>> 27, a = (-o >>> 0 & 31) >>> 0;
            return (i >>> o | i << a) >>> 0;
        }
    }
    function Vwe(t, e, n, r, s) {
        let i = (n >>> 16) * (s & 65535) >>> 0, o = (n & 65535) * (s >>> 16) >>> 0, a = (n & 65535) * (s & 65535) >>> 0, c = (n >>> 16) * (s >>> 16) + ((o >>> 16) + (i >>> 16)) >>> 0;
        o = o << 16 >>> 0, a = a + o >>> 0, a >>> 0 < o >>> 0 && (c = c + 1 >>> 0), i = i << 16 >>> 0, a = a + i >>> 0, a >>> 0 < i >>> 0 && (c = c + 1 >>> 0), c = c + Math.imul(n, r) >>> 0, c = c + Math.imul(e, s) >>> 0, t[0] = c, t[1] = a;
    }
    function $M(t, e, n, r, s) {
        let i = e + r >>> 0;
        const o = n + s >>> 0;
        o >>> 0 < n >>> 0 && (i = i + 1 | 0), t[0] = i, t[1] = o;
    }
    const d6 = Symbol.for("effect/Utils/YieldWrap");
    class jy {
        #e;
        constructor(e){
            this.#e = e;
        }
        [d6]() {
            return this.#e;
        }
    }
    function NH(t) {
        if (typeof t == "object" && t !== null && d6 in t) return t[d6]();
        throw new Error(tv("yieldWrapGet"));
    }
    const zo = Xt("effect/Utils/isStructuralRegion", ()=>({
            enabled: !1,
            tester: void 0
        })), VH = {
        effect_internal_function: (t)=>t()
    }, Dwe = {
        effect_internal_function: (t)=>{
            try {
                return t();
            } finally{}
        }
    }, Bwe = VH.effect_internal_function(()=>new Error().stack)?.includes("effect_internal_function") === !0, js = Bwe ? VH.effect_internal_function : Dwe.effect_internal_function, v8 = Xt(Symbol.for("effect/Hash/randomHashCache"), ()=>new WeakMap), Jt = Symbol.for("effect/Hash"), At = (t)=>{
        if (zo.enabled === !0) return 0;
        switch(typeof t){
            case "number":
                return qy(t);
            case "bigint":
                return qr(t.toString(10));
            case "boolean":
                return qr(String(t));
            case "symbol":
                return qr(String(t));
            case "string":
                return qr(t);
            case "undefined":
                return qr("undefined");
            case "function":
            case "object":
                return t === null ? qr("null") : t instanceof Date ? Number.isNaN(t.getTime()) ? qr("Invalid Date") : At(t.toISOString()) : t instanceof URL ? At(t.href) : Fwe(t) ? t[Jt]() : QT(t);
            default:
                throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`);
        }
    }, QT = (t)=>(v8.has(t) || v8.set(t, qy(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER))), v8.get(t)), bn = (t)=>(e)=>e * 53 ^ t, nv = (t)=>t & 3221225471 | t >>> 1 & 1073741824, Fwe = (t)=>Ft(t, Jt), qy = (t)=>{
        if (t !== t || t === 1 / 0) return 0;
        let e = t | 0;
        for(e !== t && (e ^= t * 4294967295); t > 4294967295;)e ^= t /= 4294967295;
        return nv(e);
    }, qr = (t)=>{
        let e = 5381, n = t.length;
        for(; n;)e = e * 33 ^ t.charCodeAt(--n);
        return nv(e);
    }, Lwe = (t, e)=>{
        let n = 12289;
        for(let r = 0; r < e.length; r++)n ^= V(qr(e[r]), bn(At(t[e[r]])));
        return nv(n);
    }, DH = (t)=>Lwe(t, Object.keys(t)), yg = (t)=>{
        let e = 6151;
        for(let n = 0; n < t.length; n++)e = V(e, bn(At(t[n])));
        return nv(e);
    }, ur = function() {
        if (arguments.length === 1) {
            const n = arguments[0];
            return function(r) {
                return Object.defineProperty(n, Jt, {
                    value () {
                        return r;
                    },
                    enumerable: !1
                }), r;
            };
        }
        const t = arguments[0], e = arguments[1];
        return Object.defineProperty(t, Jt, {
            value () {
                return e;
            },
            enumerable: !1
        }), e;
    }, $t = Symbol.for("effect/Equal");
    jt = function() {
        return arguments.length === 1 ? (t)=>y2(t, arguments[0]) : y2(arguments[0], arguments[1]);
    };
    function y2(t, e) {
        if (t === e) return !0;
        const n = typeof t;
        if (n !== typeof e) return !1;
        if (n === "object" || n === "function") {
            if (t !== null && e !== null) {
                if (Wm(t) && Wm(e)) return At(t) === At(e) && t[$t](e) ? !0 : zo.enabled && zo.tester ? zo.tester(t, e) : !1;
                if (t instanceof Date && e instanceof Date) {
                    const r = t.getTime(), s = e.getTime();
                    return r === s || Number.isNaN(r) && Number.isNaN(s);
                } else if (t instanceof URL && e instanceof URL) return t.href === e.href;
            }
            if (zo.enabled) {
                if (t === null || e === null) return !1;
                if (Array.isArray(t) && Array.isArray(e)) return t.length === e.length && t.every((r, s)=>y2(r, e[s]));
                if (Object.getPrototypeOf(t) === Object.prototype && Object.getPrototypeOf(e) === Object.prototype) {
                    const r = Object.keys(t), s = Object.keys(e);
                    if (r.length === s.length) {
                        for (const i of r)if (!(i in e && y2(t[i], e[i]))) return zo.tester ? zo.tester(t, e) : !1;
                        return !0;
                    }
                }
                return zo.tester ? zo.tester(t, e) : !1;
            }
        }
        return zo.enabled && zo.tester ? zo.tester(t, e) : !1;
    }
    let Wm, eC, Ir, S8;
    Wm = (t)=>Ft(t, $t);
    eC = ()=>jt;
    Bn = Symbol.for("nodejs.util.inspect.custom");
    Ir = (t)=>{
        try {
            if (Ft(t, "toJSON") && mg(t.toJSON) && t.toJSON.length === 0) return t.toJSON();
            if (Array.isArray(t)) return t.map(Ir);
        } catch  {
            return {};
        }
        return tC(t);
    };
    S8 = "[Circular]";
    function BH(t) {
        try {
            return t.toISOString();
        } catch  {
            return "Invalid Date";
        }
    }
    function zwe(t) {
        try {
            const e = t.toString();
            return typeof e == "string" ? e : String(e);
        } catch  {
            return "[toString threw]";
        }
    }
    function FH(t) {
        return To(t) ? JSON.stringify(t) : String(t);
    }
    function jd(t, e) {
        const n = new WeakSet, r = (o, a)=>{
            const c = o?.constructor;
            return c && c !== Object.prototype.constructor && c.name ? `${c.name}(${a})` : a;
        }, s = (o)=>{
            try {
                return Reflect.ownKeys(o);
            } catch  {
                return [
                    "[ownKeys threw]"
                ];
            }
        };
        function i(o, a = 0) {
            if (Array.isArray(o)) return n.has(o) ? S8 : (n.add(o), `[${o.map((c)=>i(c, a)).join(",")}]`);
            if (PH(o)) return BH(o);
            if (Ft(o, "toString") && mg(o.toString) && o.toString !== Object.prototype.toString && o.toString !== Array.prototype.toString) {
                const c = zwe(o);
                return o instanceof Error && o.cause ? `${c} (cause: ${i(o.cause, a)})` : c;
            }
            if (To(o)) return JSON.stringify(o);
            if (sp(o) || o == null || Hy(o) || l6(o)) return String(o);
            if (ev(o)) return String(o) + "n";
            if (o instanceof Set || o instanceof Map) return n.has(o) ? S8 : (n.add(o), `${o.constructor.name}(${i(Array.from(o), a)})`);
            if (qc(o)) {
                if (n.has(o)) return S8;
                n.add(o);
                const c = s(o);
                {
                    const l = `{${c.map((u)=>`${FH(u)}:${i(o[u], a)}`).join(",")}}`;
                    return r(o, l);
                }
            }
            return String(o);
        }
        return i(t, 0);
    }
    const Mr = (t)=>JSON.stringify(t, null, 2), rv = {
        toJSON () {
            return Ir(this);
        },
        [Bn] () {
            return this.toJSON();
        },
        toString () {
            return Mr(this.toJSON());
        }
    };
    let Uwe = class {
        [Bn]() {
            return this.toJSON();
        }
        toString() {
            return Mr(this.toJSON());
        }
    };
    let I0, LH, sv, zH, Lf, Hwe, tC, bm, iv, Is, S_, w2, _2, As, UH, jwe, wg, x2, mm, HH, k_, nC;
    I0 = (t, e = 2)=>{
        if (typeof t == "string") return t;
        try {
            return typeof t == "object" ? LH(t, e) : String(t);
        } catch  {
            return String(t);
        }
    };
    LH = (t, e)=>{
        let n = [];
        const r = JSON.stringify(t, (s, i)=>typeof i == "object" && i !== null ? n.includes(i) ? void 0 : n.push(i) && (Lf.fiberRefs !== void 0 && zH(i) ? i[sv](Lf.fiberRefs) : i) : i, e);
        return n = void 0, r;
    };
    sv = Symbol.for("effect/Inspectable/Redactable");
    zH = (t)=>typeof t == "object" && t !== null && sv in t;
    Lf = Xt("effect/Inspectable/redactableState", ()=>({
            fiberRefs: void 0
        }));
    Hwe = (t, e)=>{
        const n = Lf.fiberRefs;
        Lf.fiberRefs = t;
        try {
            return e();
        } finally{
            Lf.fiberRefs = n;
        }
    };
    tC = (t)=>zH(t) && Lf.fiberRefs !== void 0 ? t[sv](Lf.fiberRefs) : t;
    St = (t, e)=>{
        switch(e.length){
            case 0:
                return t;
            case 1:
                return e[0](t);
            case 2:
                return e[1](e[0](t));
            case 3:
                return e[2](e[1](e[0](t)));
            case 4:
                return e[3](e[2](e[1](e[0](t))));
            case 5:
                return e[4](e[3](e[2](e[1](e[0](t)))));
            case 6:
                return e[5](e[4](e[3](e[2](e[1](e[0](t))))));
            case 7:
                return e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))));
            case 8:
                return e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t))))))));
            case 9:
                return e[8](e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))))));
            default:
                {
                    let n = t;
                    for(let r = 0, s = e.length; r < s; r++)n = e[r](n);
                    return n;
                }
        }
    };
    bm = "Async";
    iv = "Commit";
    Is = "Failure";
    S_ = "OnFailure";
    w2 = "OnSuccess";
    _2 = "OnSuccessAndFailure";
    As = "Success";
    UH = "Sync";
    jwe = "Tag";
    wg = "UpdateRuntimeFlags";
    x2 = "While";
    mm = "Iterator";
    HH = "WithRuntime";
    k_ = "Yield";
    nC = "RevertFlags";
    let qwe = "3.21.0";
    let rC, Wwe, Kwe, $we, Xwe, A0, Gwe, Zwe, Wy, Ky, $y, Jwe, Ywe, jH, qH, Qwe, e_e, t_e, WH, sC, KH, Km, nd, $H, XH, n_e, r_e, iC, oC, GH, ZH, JH, s_e, i_e, o_e, aC, a_e, YH, Ks, Qs, xr, c_e, l_e, ov, _g, u_e, qs, QH, av, cv, d_e, f_e, p_e, h_e, ej, g_e, Qr, b_e, m_e, y_e, w_e, Ac, __e, x_e, v_e, S_e, k_e, v2, C_e, E_e, f6, I_e, A_e, lC, P_e, O_e, M_e, p6, op, V_e, Un, D_e, k8, S2, $m, uv, z_e, nj, U_e, H_e, rj, wm, Si, j_e, sj, ap, q_e, W_e, K_e, $_e, GM, ZM, X_e, G_e, Z_e, uC, J_e, Y_e, T_, tu, qo, Ps, Q_e, dv, Xy, e2e, nu, t2e, n2e, JM, ij, r2e, Sg, s2e, oj, aj, cj, i2e, YM, o2e, Rp, a2e, c2e, QM, l2e, u2e, eR, d2e, f2e, p2e, h2e, g2e, b2e, m2e, y2e, w2e, _2e, lj, dC, fC, Ga, h6, Np, uj, dj, fj, pj, hj, gj, x2e, bj, mj, yj, wj, _j, xj, v2e, Oi, S2e, k2e, T2e, vj, Sj, fv, kj, C2e, E2e, I2e, A2e, P2e, Tj, O2e, M2e, Cj, R2e, N2e, V2e;
    rC = ()=>qwe;
    Wwe = Symbol.for("effect/Effect");
    Kwe = Symbol.for("effect/Stream");
    $we = Symbol.for("effect/Sink");
    Xwe = Symbol.for("effect/Channel");
    A0 = {
        _R: (t)=>t,
        _E: (t)=>t,
        _A: (t)=>t,
        _V: rC()
    };
    Gwe = {
        _A: (t)=>t,
        _In: (t)=>t,
        _L: (t)=>t,
        _E: (t)=>t,
        _R: (t)=>t
    };
    Zwe = {
        _Env: (t)=>t,
        _InErr: (t)=>t,
        _InElem: (t)=>t,
        _InDone: (t)=>t,
        _OutErr: (t)=>t,
        _OutElem: (t)=>t,
        _OutDone: (t)=>t
    };
    Wy = {
        [Wwe]: A0,
        [Kwe]: A0,
        [$we]: Gwe,
        [Xwe]: Zwe,
        [$t] (t) {
            return this === t;
        },
        [Jt] () {
            return ur(this, QT(this));
        },
        [Symbol.iterator] () {
            return new YT(new jy(this));
        },
        pipe () {
            return St(this, arguments);
        }
    };
    Ky = {
        [Jt] () {
            return ur(this, DH(this));
        },
        [$t] (t) {
            const e = Object.keys(this), n = Object.keys(t);
            if (e.length !== n.length) return !1;
            for (const r of e)if (!(r in t && jt(this[r], t[r]))) return !1;
            return !0;
        }
    };
    $y = {
        ...Wy,
        _op: iv
    };
    Jwe = {
        ...$y,
        ...Ky
    };
    Ywe = (function() {
        function t() {}
        return t.prototype = $y, t;
    })();
    jH = Symbol.for("effect/Option");
    qH = {
        ...Wy,
        [jH]: {
            _A: (t)=>t
        },
        [Bn] () {
            return this.toJSON();
        },
        toString () {
            return Mr(this.toJSON());
        }
    };
    Qwe = Object.assign(Object.create(qH), {
        _tag: "Some",
        _op: "Some",
        [$t] (t) {
            return WH(t) && KH(t) && jt(this.value, t.value);
        },
        [Jt] () {
            return ur(this, bn(At(this._tag))(At(this.value)));
        },
        toJSON () {
            return {
                _id: "Option",
                _tag: this._tag,
                value: Ir(this.value)
            };
        }
    });
    e_e = At("None");
    t_e = Object.assign(Object.create(qH), {
        _tag: "None",
        _op: "None",
        [$t] (t) {
            return WH(t) && sC(t);
        },
        [Jt] () {
            return e_e;
        },
        toJSON () {
            return {
                _id: "Option",
                _tag: this._tag
            };
        }
    });
    WH = (t)=>Ft(t, jH);
    sC = (t)=>t._tag === "None";
    KH = (t)=>t._tag === "Some";
    Km = Object.create(t_e);
    nd = (t)=>{
        const e = Object.create(Qwe);
        return e.value = t, e;
    };
    $H = Symbol.for("effect/Either");
    XH = {
        ...Wy,
        [$H]: {
            _R: (t)=>t
        },
        [Bn] () {
            return this.toJSON();
        },
        toString () {
            return Mr(this.toJSON());
        }
    };
    n_e = Object.assign(Object.create(XH), {
        _tag: "Right",
        _op: "Right",
        [$t] (t) {
            return iC(t) && GH(t) && jt(this.right, t.right);
        },
        [Jt] () {
            return bn(At(this._tag))(At(this.right));
        },
        toJSON () {
            return {
                _id: "Either",
                _tag: this._tag,
                right: Ir(this.right)
            };
        }
    });
    r_e = Object.assign(Object.create(XH), {
        _tag: "Left",
        _op: "Left",
        [$t] (t) {
            return iC(t) && oC(t) && jt(this.left, t.left);
        },
        [Jt] () {
            return bn(At(this._tag))(At(this.left));
        },
        toJSON () {
            return {
                _id: "Either",
                _tag: this._tag,
                left: Ir(this.left)
            };
        }
    });
    iC = (t)=>Ft(t, $H);
    oC = (t)=>t._tag === "Left";
    GH = (t)=>t._tag === "Right";
    ZH = (t)=>{
        const e = Object.create(r_e);
        return e.left = t, e;
    };
    JH = (t)=>{
        const e = Object.create(n_e);
        return e.right = t, e;
    };
    s_e = (t)=>oC(t) ? Km : nd(t.right);
    i_e = j(2, (t, e)=>sC(t) ? ZH(e()) : JH(t.value));
    mt = JH;
    o_e = mt(void 0);
    st = ZH;
    aC = i_e;
    yo = (t)=>{
        if (mg(t)) try {
            return mt(t());
        } catch (e) {
            return st(e);
        }
        else try {
            return mt(t.try());
        } catch (e) {
            return st(t.catch(e));
        }
    };
    a_e = iC;
    pr = oC;
    Ma = GH;
    YH = j(2, (t, { onLeft: e, onRight: n })=>pr(t) ? st(e(t.left)) : mt(n(t.right)));
    Ks = j(2, (t, e)=>pr(t) ? st(e(t.left)) : mt(t.right));
    Qs = j(2, (t, e)=>Ma(t) ? mt(e(t.right)) : st(t.left));
    xr = j(2, (t, { onLeft: e, onRight: n })=>pr(t) ? e(t.left) : n(t.right));
    c_e = xr({
        onLeft: Ht,
        onRight: Ht
    });
    l_e = j(2, (t, e)=>pr(t) ? e(t.left) : t.right);
    cC = j(2, (t, e)=>{
        if (Ma(t)) return t.right;
        throw e(t.left);
    });
    ov = cC(()=>new Error("getOrThrow called on a Left"));
    _g = j(2, (t, e)=>pr(t) ? st(t.left) : e(t.right));
    u_e = Ewe();
    qs = (...t)=>{
        const n = (t.length === 1 ? t[0] : t[1].bind(t[0]))(u_e);
        let r = n.next();
        for(; !r.done;){
            const s = Twe(r.value) ? r.value.value : NH(r.value);
            if (pr(s)) return s;
            r = n.next(s.right);
        }
        return mt(r.value);
    };
    QH = (t)=>t.length > 0;
    av = (t)=>(e, n)=>e === n ? 0 : t(e, n);
    cv = av((t, e)=>t < e ? -1 : 1);
    d_e = av((t, e)=>t < e ? -1 : 1);
    f_e = (t)=>av((e, n)=>t(n, e));
    ip = j(2, (t, e)=>av((n, r)=>t(e(n), e(r))));
    p_e = ip(cv, (t)=>t.getTime());
    h_e = (t)=>j(2, (e, n)=>t(e, n) === 1);
    ej = (t)=>j(2, (e, n)=>e === n || t(e, n) < 1 ? e : n);
    g_e = (t)=>j(2, (e, n)=>e === n || t(e, n) > -1 ? e : n);
    Fe = ()=>Km;
    ze = nd;
    Qr = sC;
    gr = KH;
    dn = j(2, (t, { onNone: e, onSome: n })=>Qr(t) ? e() : n(t.value));
    b_e = s_e;
    Pr = j(2, (t, e)=>Qr(t) ? e() : t.value);
    ad = j(2, (t, e)=>Qr(t) ? e() : t);
    m_e = j(2, (t, e)=>Qr(t) ? ze(e()) : t);
    Mp = (t)=>t == null ? Fe() : ze(t);
    _c = Pr(IH);
    tj = (t)=>(...e)=>{
            try {
                return ze(t(...e));
            } catch  {
                return Fe();
            }
        };
    y_e = j(2, (t, e)=>{
        if (gr(t)) return t.value;
        throw e();
    });
    w_e = y_e(()=>new Error("getOrThrow called on a None"));
    Ac = j(2, (t, e)=>Qr(t) ? Fe() : ze(e(t.value)));
    xg = j(2, (t, e)=>Qr(t) ? Fe() : e(t.value));
    __e = j(2, (t, e)=>Qr(t) ? Fe() : Mp(e(t.value)));
    Xwt = xg;
    x_e = (t)=>j(2, (e, n)=>Qr(e) ? !1 : t(e.value, n));
    v_e = eC();
    S_e = x_e(v_e);
    k_e = j(2, (t, e)=>Qr(t) ? !1 : e(t.value));
    v2 = (t)=>(e, n)=>Qr(e) ? n : Qr(n) ? e : ze(t(e.value, n.value));
    T_e = (...t)=>t;
    C_e = (t)=>{
        const n = t[Symbol.iterator]().next();
        return n.done ? Fe() : ze(n.value);
    };
    E_e = j(2, (t, e)=>{
        let n = 0;
        for (const r of t){
            const s = e(r, n);
            if (Hy(s)) {
                if (s) return ze(r);
            } else if (gr(s)) return s;
            n++;
        }
        return Fe();
    });
    f6 = j(2, (t, e)=>({
            [Symbol.iterator] () {
                const n = t[Symbol.iterator]();
                let r = 0;
                return {
                    next () {
                        const s = n.next();
                        return s.done ? {
                            done: !0,
                            value: void 0
                        } : {
                            done: !1,
                            value: e(s.value, r++)
                        };
                    }
                };
            }
        }));
    I_e = j(2, (t, e)=>({
            [Symbol.iterator] () {
                const n = t[Symbol.iterator]();
                let r = 0;
                return {
                    next () {
                        let s = n.next();
                        for(; !s.done;){
                            const i = e(s.value, r++);
                            if (gr(i)) return {
                                done: !1,
                                value: i.value
                            };
                            s = n.next();
                        }
                        return {
                            done: !0,
                            value: void 0
                        };
                    }
                };
            }
        }));
    A_e = j(2, (t, e)=>({
            [Symbol.iterator] () {
                const n = t[Symbol.iterator]();
                let r = 0;
                return {
                    next () {
                        let s = n.next();
                        for(; !s.done;){
                            if (e(s.value, r++)) return {
                                done: !1,
                                value: s.value
                            };
                            s = n.next();
                        }
                        return {
                            done: !0,
                            value: void 0
                        };
                    }
                };
            }
        }));
    lC = ()=>({});
    XM = (t)=>op(t).length === 0;
    P_e = j(2, (t, e)=>{
        const n = lC();
        for (const r of t){
            const [s, i] = e(r);
            n[s] = i;
        }
        return n;
    });
    O_e = j(2, (t, e)=>{
        const n = [];
        for (const r of op(t))n.push(e(r, t[r]));
        return n;
    });
    M_e = O_e((t, e)=>[
            t,
            e
        ]);
    p6 = j(2, (t, e)=>Object.prototype.hasOwnProperty.call(t, e));
    Gwt = j(2, (t, e)=>{
        if (!p6(t, e)) return {
            ...t
        };
        const n = {
            ...t
        };
        return delete n[e], n;
    });
    R_e = j(2, (t, e)=>{
        const n = {
            ...t
        };
        for (const r of op(t))n[r] = e(t[r], r);
        return n;
    });
    Zwt = j(2, (t, e)=>{
        const n = {};
        for (const r of op(t)){
            const [s, i] = e(t[r], r);
            n[s] = i;
        }
        return n;
    });
    Jwt = j(2, (t, e)=>{
        const n = lC();
        for (const r of op(t))e(t[r], r) && (n[r] = t[r]);
        return n;
    });
    op = (t)=>Object.keys(t);
    N_e = j(3, (t, e, n)=>{
        if (XM(t)) return {
            ...e
        };
        if (XM(e)) return {
            ...t
        };
        const r = lC();
        for (const s of op(t))p6(e, s) ? r[s] = n(t[s], e[s]) : r[s] = t[s];
        for (const s of op(e))p6(r, s) || (r[s] = e[s]);
        return r;
    });
    lv = (t)=>new Array(t);
    V_e = j(2, (t, e)=>{
        const n = Math.max(1, Math.floor(t)), r = new Array(n);
        for(let s = 0; s < n; s++)r[s] = e(s);
        return r;
    });
    Un = (t)=>Array.isArray(t) ? t : Array.from(t);
    D_e = (t)=>Array.isArray(t) ? t : [
            t
        ];
    k8 = j(2, (t, { onEmpty: e, onNonEmpty: n })=>Fr(t) ? n(t) : e());
    B_e = j(2, (t, { onEmpty: e, onNonEmpty: n })=>Fr(t) ? n(Si(t), ap(t)) : e());
    S2 = j(2, (t, e)=>[
            e,
            ...t
        ]);
    $m = j(2, (t, e)=>[
            ...t,
            e
        ]);
    uv = j(2, (t, e)=>Un(t).concat(Un(e)));
    F_e = Array.isArray;
    L_e = (t)=>t.length === 0;
    z_e = L_e;
    ym = QH;
    Fr = QH;
    nj = (t, e)=>t < 0 || t >= e.length;
    U_e = (t, e)=>Math.floor(Math.min(Math.max(0, t), e.length));
    H_e = j(2, (t, e)=>{
        const n = Math.floor(e);
        return nj(n, t) ? Fe() : ze(t[n]);
    });
    rj = j(2, (t, e)=>{
        const n = Math.floor(e);
        if (nj(n, t)) throw new Error(`Index ${n} out of bounds`);
        return t[n];
    });
    wm = H_e(0);
    Si = rj(0);
    j_e = (t)=>Fr(t) ? ze(sj(t)) : Fe();
    sj = (t)=>t[t.length - 1];
    ap = (t)=>t.slice(1);
    q_e = (t, e)=>{
        let n = 0;
        for (const r of t){
            if (!e(r, n)) break;
            n++;
        }
        return n;
    };
    W_e = j(2, (t, e)=>uC(t, q_e(t, e)));
    K_e = j(2, (t, e)=>{
        const n = Un(t);
        return n.slice(U_e(e, n), n.length);
    });
    $_e = E_e;
    GM = (t)=>Array.from(t).reverse();
    P0 = j(2, (t, e)=>{
        const n = Array.from(t);
        return n.sort(e), n;
    });
    ZM = j(2, (t, e)=>X_e(t, e, T_e));
    X_e = j(3, (t, e, n)=>{
        const r = Un(t), s = Un(e);
        if (Fr(r) && Fr(s)) {
            const i = [
                n(Si(r), Si(s))
            ], o = Math.min(r.length, s.length);
            for(let a = 1; a < o; a++)i[a] = n(r[a], s[a]);
            return i;
        }
        return [];
    });
    G_e = (t)=>j(2, (e, n)=>{
            for (const r of e)if (t(n, r)) return !0;
            return !1;
        });
    Z_e = eC();
    uC = j(2, (t, e)=>{
        const n = Array.from(t), r = Math.floor(e);
        return Fr(n) ? r >= 1 ? J_e(n, r) : [
            [],
            n
        ] : [
            n,
            []
        ];
    });
    J_e = j(2, (t, e)=>{
        const n = Math.max(1, Math.floor(e));
        return n >= t.length ? [
            Zb(t),
            []
        ] : [
            S2(t.slice(1, n), Si(t)),
            t.slice(n)
        ];
    });
    Zb = (t)=>t.slice();
    Y_e = j(3, (t, e, n)=>{
        const r = Un(t), s = Un(e);
        return Fr(r) ? Fr(s) ? ij(n)(uv(r, s)) : r : s;
    });
    T_ = j(2, (t, e)=>Y_e(t, e, Z_e));
    Ywt = (t)=>{
        const e = G_e(t);
        return j(2, (n, r)=>{
            const s = Un(r);
            return Un(n).filter((i)=>!e(s, i));
        });
    };
    tu = ()=>[];
    qo = (t)=>[
            t
        ];
    Ps = j(2, (t, e)=>t.map(e));
    vg = j(2, (t, e)=>{
        if (z_e(t)) return [];
        const n = [];
        for(let r = 0; r < t.length; r++){
            const s = e(t[r], r);
            for(let i = 0; i < s.length; i++)n.push(s[i]);
        }
        return n;
    });
    Q_e = vg(Ht);
    dv = j(2, (t, e)=>{
        const n = Un(t), r = [];
        for(let s = 0; s < n.length; s++){
            const i = e(n[s], s);
            gr(i) && r.push(i.value);
        }
        return r;
    });
    Xy = j(2, (t, e)=>{
        const n = Un(t), r = [];
        for(let s = 0; s < n.length; s++)e(n[s], s) && r.push(n[s]);
        return r;
    });
    e2e = j(2, (t, e)=>{
        const n = [], r = [], s = Un(t);
        for(let i = 0; i < s.length; i++)e(s[i], i) ? r.push(s[i]) : n.push(s[i]);
        return [
            n,
            r
        ];
    });
    nu = j(3, (t, e, n)=>Un(t).reduce((r, s, i)=>n(r, s, i), e));
    t2e = j(2, (t, e)=>t.reduce(ej(e)));
    n2e = j(2, (t, e)=>t.reduce(g_e(e)));
    JM = (t, e)=>{
        const n = [];
        let r = t, s;
        for(; gr(s = e(r));){
            const [i, o] = s.value;
            n.push(i), r = o;
        }
        return n;
    };
    Gy = gwe;
    ij = j(2, (t, e)=>{
        const n = Un(t);
        if (Fr(n)) {
            const r = [
                Si(n)
            ], s = ap(n);
            for (const i of s)r.every((o)=>!e(i, o)) && r.push(i);
            return r;
        }
        return [];
    });
    r2e = (t)=>ij(t, eC());
    Sg = j(2, (t, e)=>Un(t).join(e));
    s2e = j(3, (t, e, n)=>{
        let r = 0, s = e;
        const i = [];
        for (const o of t){
            const a = n(s, o, r);
            s = a[0], i.push(a[1]), r++;
        }
        return [
            s,
            i
        ];
    });
    oj = (t, e)=>{
        switch(e._tag){
            case "StringKeyword":
            case "TemplateLiteral":
                return Object.keys(t);
            case "SymbolKeyword":
                return Object.getOwnPropertySymbols(t);
            case "Refinement":
                return oj(t, e.from);
        }
    };
    aj = (t)=>{
        let e = !1, n;
        return ()=>(e || (n = t(), e = !0), n);
    };
    cj = (t)=>Array.isArray(t);
    i2e = (t)=>!Array.isArray(t);
    YM = (t)=>`[${FH(t)}]`;
    o2e = (t)=>cj(t) ? t.map(YM).join("") : YM(t);
    Rp = (t, e, n, r)=>{
        let s = t;
        return e !== void 0 && (s += `
details: ${e}`), r && (s += `
schema (${r._tag}): ${r}`), s;
    };
    a2e = (t)=>Rp("Unsupported key schema", void 0, void 0, t);
    c2e = (t)=>Rp("Unsupported literal", `literal value: ${jd(t)}`);
    QM = (t)=>Rp("Duplicate index signature", `${t} index signature`);
    l2e = Rp("Unsupported index signature parameter", "An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types");
    u2e = Rp("Invalid element", "A required element cannot follow an optional element. ts(1257)");
    eR = (t)=>Rp("Duplicate property signature transformation", `Duplicate key ${jd(t)}`);
    d2e = (t)=>Rp("Duplicate property signature", `Duplicate key ${jd(t)}`);
    f2e = Symbol.for("effect/SchemaId/DateFromSelf");
    p2e = Symbol.for("effect/SchemaId/Int");
    h2e = Symbol.for("effect/SchemaId/Between");
    g2e = Symbol.for("effect/SchemaId/BetweenBigint");
    O0 = cv;
    b2e = (t)=>{
        const e = Math.ceil(Math.log(t) / Math.log(2));
        return Math.max(Math.pow(2, e), 2);
    };
    m2e = (t)=>{
        if (t === "NaN") return nd(NaN);
        if (t === "Infinity") return nd(1 / 0);
        if (t === "-Infinity") return nd(-1 / 0);
        if (t.trim() === "") return Km;
        const e = Number(t);
        return Number.isNaN(e) ? Km : nd(e);
    };
    k2 = (t)=>t.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
    y2e = Symbol.for("effect/annotation/TypeConstructor");
    w2e = Symbol.for("effect/annotation/Brand");
    _2e = Symbol.for("effect/annotation/SchemaId");
    lj = Symbol.for("effect/annotation/Message");
    dC = Symbol.for("effect/annotation/MissingMessage");
    fC = Symbol.for("effect/annotation/Identifier");
    Ga = Symbol.for("effect/annotation/Title");
    h6 = Symbol.for("effect/annotation/AutoTitle");
    Np = Symbol.for("effect/annotation/Description");
    uj = Symbol.for("effect/annotation/Examples");
    dj = Symbol.for("effect/annotation/Default");
    fj = Symbol.for("effect/annotation/JSONSchema");
    pj = Symbol.for("effect/annotation/Arbitrary");
    hj = Symbol.for("effect/annotation/Pretty");
    gj = Symbol.for("effect/annotation/Equivalence");
    x2e = Symbol.for("effect/annotation/Documentation");
    bj = Symbol.for("effect/annotation/Concurrency");
    mj = Symbol.for("effect/annotation/Batching");
    yj = Symbol.for("effect/annotation/ParseIssueTitle");
    wj = Symbol.for("effect/annotation/ParseOptions");
    _j = Symbol.for("effect/annotation/DecodingFallback");
    xj = Symbol.for("effect/annotation/Surrogate");
    v2e = Symbol.for("effect/annotation/StableFilter");
    Oi = j(2, (t, e)=>Object.prototype.hasOwnProperty.call(t.annotations, e) ? ze(t.annotations[e]) : Fe());
    S2e = Oi(w2e);
    k2e = Oi(lj);
    T2e = Oi(dC);
    vj = Oi(Ga);
    Sj = Oi(h6);
    fv = Oi(fC);
    kj = Oi(Np);
    C2e = Oi(bj);
    E2e = Oi(mj);
    I2e = Oi(yj);
    A2e = Oi(wj);
    P2e = Oi(_j);
    Tj = Oi(xj);
    O2e = Oi(v2e);
    M2e = (t)=>k_e(O2e(t), (e)=>e === !0);
    Cj = Symbol.for("effect/annotation/JSONIdentifier");
    R2e = Oi(Cj);
    N2e = (t)=>ad(R2e(t), ()=>fv(t));
    V2e = Symbol.for("effect/schema/ParseJson");
    class pv {
        typeParameters;
        decodeUnknown;
        encodeUnknown;
        annotations;
        _tag = "Declaration";
        constructor(e, n, r, s = {}){
            this.typeParameters = e, this.decodeUnknown = n, this.encodeUnknown = r, this.annotations = s;
        }
        toString() {
            return Pr(Fc(this), ()=>"<declaration schema>");
        }
        toJSON() {
            return {
                _tag: this._tag,
                typeParameters: this.typeParameters.map((e)=>e.toJSON()),
                annotations: ns(this.annotations)
            };
        }
    }
    const Zy = (t)=>(e)=>e._tag === t;
    let T2 = class {
        literal;
        annotations;
        _tag = "Literal";
        constructor(e, n = {}){
            this.literal = e, this.annotations = n;
        }
        toString() {
            return Pr(Fc(this), ()=>jd(this.literal));
        }
        toJSON() {
            return {
                _tag: this._tag,
                literal: ev(this.literal) ? String(this.literal) : this.literal,
                annotations: ns(this.annotations)
            };
        }
    };
    const tR = Zy("Literal"), D2e = new T2(null);
    class B2e {
        symbol;
        annotations;
        _tag = "UniqueSymbol";
        constructor(e, n = {}){
            this.symbol = e, this.annotations = n;
        }
        toString() {
            return Pr(Fc(this), ()=>jd(this.symbol));
        }
        toJSON() {
            return {
                _tag: this._tag,
                symbol: String(this.symbol),
                annotations: ns(this.annotations)
            };
        }
    }
    class F2e {
        annotations;
        _tag = "UndefinedKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const g6 = new F2e({
        [Ga]: "undefined"
    });
    class L2e {
        annotations;
        _tag = "NeverKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const pC = new L2e({
        [Ga]: "never"
    });
    class z2e {
        annotations;
        _tag = "UnknownKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const Ej = new z2e({
        [Ga]: "unknown"
    });
    class U2e {
        annotations;
        _tag = "AnyKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const H2e = new U2e({
        [Ga]: "any"
    });
    class j2e {
        annotations;
        _tag = "StringKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const q2e = new j2e({
        [Ga]: "string",
        [Np]: "a string"
    }), W2e = Zy("StringKeyword");
    class K2e {
        annotations;
        _tag = "NumberKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const $2e = new K2e({
        [Ga]: "number",
        [Np]: "a number"
    });
    class X2e {
        annotations;
        _tag = "BooleanKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const G2e = new X2e({
        [Ga]: "boolean",
        [Np]: "a boolean"
    });
    class Z2e {
        annotations;
        _tag = "BigIntKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const J2e = new Z2e({
        [Ga]: "bigint",
        [Np]: "a bigint"
    }), Y2e = Zy("SymbolKeyword");
    class Q2e {
        annotations;
        _tag = "ObjectKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return mu(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: ns(this.annotations)
            };
        }
    }
    const exe = new Q2e({
        [Ga]: "object",
        [Np]: "an object in the TypeScript meaning, i.e. the `object` type"
    });
    let hv = class {
        type;
        annotations;
        constructor(e, n = {}){
            this.type = e, this.annotations = n;
        }
        toJSON() {
            return {
                type: this.type.toJSON(),
                annotations: ns(this.annotations)
            };
        }
        toString() {
            return String(this.type);
        }
    };
    class kg extends hv {
        isOptional;
        constructor(e, n, r = {}){
            super(e, r), this.isOptional = n;
        }
        toJSON() {
            return {
                type: this.type.toJSON(),
                isOptional: this.isOptional,
                annotations: ns(this.annotations)
            };
        }
        toString() {
            return String(this.type) + (this.isOptional ? "?" : "");
        }
    }
    const Ij = (t)=>t.map((e)=>e.type);
    class hC {
        elements;
        rest;
        isReadonly;
        annotations;
        _tag = "TupleType";
        constructor(e, n, r, s = {}){
            this.elements = e, this.rest = n, this.isReadonly = r, this.annotations = s;
            let i = !1, o = !1;
            for (const a of e)if (a.isOptional) i = !0;
            else if (i) {
                o = !0;
                break;
            }
            if (o || i && n.length > 1) throw new Error(u2e);
        }
        toString() {
            return Pr(Fc(this), ()=>txe(this));
        }
        toJSON() {
            return {
                _tag: this._tag,
                elements: this.elements.map((e)=>e.toJSON()),
                rest: this.rest.map((e)=>e.toJSON()),
                isReadonly: this.isReadonly,
                annotations: ns(this.annotations)
            };
        }
    }
    const txe = (t)=>{
        const e = t.elements.map(String).join(", ");
        return B_e(t.rest, {
            onEmpty: ()=>`readonly [${e}]`,
            onNonEmpty: (n, r)=>{
                const s = String(n), i = s.includes(" | ") ? `(${s})` : s;
                if (r.length > 0) {
                    const o = r.map(String).join(", ");
                    return t.elements.length > 0 ? `readonly [${e}, ...${i}[], ${o}]` : `readonly [...${i}[], ${o}]`;
                } else return t.elements.length > 0 ? `readonly [${e}, ...${i}[]]` : `ReadonlyArray<${s}>`;
            }
        });
    };
    class Ys extends kg {
        name;
        isReadonly;
        constructor(e, n, r, s, i){
            super(n, r, i), this.name = e, this.isReadonly = s;
        }
        toString() {
            return (this.isReadonly ? "readonly " : "") + String(this.name) + (this.isOptional ? "?" : "") + ": " + this.type;
        }
        toJSON() {
            return {
                name: String(this.name),
                type: this.type.toJSON(),
                isOptional: this.isOptional,
                isReadonly: this.isReadonly,
                annotations: ns(this.annotations)
            };
        }
    }
    const Aj = (t)=>{
        switch(t._tag){
            case "StringKeyword":
            case "SymbolKeyword":
            case "TemplateLiteral":
                return !0;
            case "Refinement":
                return Aj(t.from);
        }
        return !1;
    };
    class gv {
        type;
        isReadonly;
        parameter;
        constructor(e, n, r){
            if (this.type = n, this.isReadonly = r, Aj(e)) this.parameter = e;
            else throw new Error(l2e);
        }
        toString() {
            return (this.isReadonly ? "readonly " : "") + `[x: ${this.parameter}]: ${this.type}`;
        }
        toJSON() {
            return {
                parameter: this.parameter.toJSON(),
                type: this.type.toJSON(),
                isReadonly: this.isReadonly
            };
        }
    }
    class zf {
        annotations;
        _tag = "TypeLiteral";
        propertySignatures;
        indexSignatures;
        constructor(e, n, r = {}){
            this.annotations = r;
            const s = {};
            for(let o = 0; o < e.length; o++){
                const a = e[o].name;
                if (Object.prototype.hasOwnProperty.call(s, a)) throw new Error(d2e(a));
                s[a] = null;
            }
            const i = {
                string: !1,
                symbol: !1
            };
            for(let o = 0; o < n.length; o++){
                const a = Dj(n[o].parameter);
                if (W2e(a)) {
                    if (i.string) throw new Error(QM("string"));
                    i.string = !0;
                } else if (Y2e(a)) {
                    if (i.symbol) throw new Error(QM("symbol"));
                    i.symbol = !0;
                }
            }
            this.propertySignatures = e, this.indexSignatures = n;
        }
        toString() {
            return Pr(Fc(this), ()=>nxe(this));
        }
        toJSON() {
            return {
                _tag: this._tag,
                propertySignatures: this.propertySignatures.map((e)=>e.toJSON()),
                indexSignatures: this.indexSignatures.map((e)=>e.toJSON()),
                annotations: ns(this.annotations)
            };
        }
    }
    const nR = (t)=>t.map(String).join("; "), nxe = (t)=>{
        if (t.propertySignatures.length > 0) {
            const e = t.propertySignatures.map(String).join("; ");
            return t.indexSignatures.length > 0 ? `{ ${e}; ${nR(t.indexSignatures)} }` : `{ ${e} }`;
        } else return t.indexSignatures.length > 0 ? `{ ${nR(t.indexSignatures)} }` : "{}";
    }, rxe = P0(ip(O0, (t)=>{
        switch(t._tag){
            case "AnyKeyword":
                return 0;
            case "UnknownKeyword":
                return 1;
            case "ObjectKeyword":
                return 2;
            case "StringKeyword":
            case "NumberKeyword":
            case "BooleanKeyword":
            case "BigIntKeyword":
            case "SymbolKeyword":
                return 3;
        }
        return 4;
    })), sxe = {
        string: "StringKeyword",
        number: "NumberKeyword",
        boolean: "BooleanKeyword",
        bigint: "BigIntKeyword"
    }, Pj = (t)=>vg(t, (e)=>Oj(e) ? Pj(e.types) : [
                e
            ]), ixe = (t)=>{
        const e = rxe(t), n = [], r = {}, s = [];
        for (const i of e)switch(i._tag){
            case "NeverKeyword":
                break;
            case "AnyKeyword":
                return [
                    H2e
                ];
            case "UnknownKeyword":
                return [
                    Ej
                ];
            case "ObjectKeyword":
            case "UndefinedKeyword":
            case "VoidKeyword":
            case "StringKeyword":
            case "NumberKeyword":
            case "BooleanKeyword":
            case "BigIntKeyword":
            case "SymbolKeyword":
                {
                    r[i._tag] || (r[i._tag] = i, n.push(i));
                    break;
                }
            case "Literal":
                {
                    const o = typeof i.literal;
                    switch(o){
                        case "string":
                        case "number":
                        case "bigint":
                        case "boolean":
                            {
                                const a = sxe[o];
                                !r[a] && !s.includes(i.literal) && (s.push(i.literal), n.push(i));
                                break;
                            }
                        case "object":
                            {
                                s.includes(i.literal) || (s.push(i.literal), n.push(i));
                                break;
                            }
                    }
                    break;
                }
            case "UniqueSymbol":
                {
                    !r.SymbolKeyword && !s.includes(i.symbol) && (s.push(i.symbol), n.push(i));
                    break;
                }
            case "TupleType":
                {
                    r.ObjectKeyword || n.push(i);
                    break;
                }
            case "TypeLiteral":
                {
                    i.propertySignatures.length === 0 && i.indexSignatures.length === 0 ? r["{}"] || (r["{}"] = i, n.push(i)) : r.ObjectKeyword || n.push(i);
                    break;
                }
            default:
                n.push(i);
        }
        return n;
    };
    let xc = class b6 {
        types;
        annotations;
        static make = (e, n)=>gC(e) ? new b6(e, n) : e.length === 1 ? e[0] : pC;
        static unify = (e, n)=>b6.make(ixe(Pj(e)), n);
        _tag = "Union";
        constructor(e, n = {}){
            this.types = e, this.annotations = n;
        }
        toString() {
            return Pr(Fc(this), ()=>this.types.map(String).join(" | "));
        }
        toJSON() {
            return {
                _tag: this._tag,
                types: this.types.map((e)=>e.toJSON()),
                annotations: ns(this.annotations)
            };
        }
    };
    const oxe = (t, e)=>t.map(e), gC = (t)=>t.length > 1, Oj = Zy("Union"), T8 = Xt(Symbol.for("effect/Schema/AST/toJSONMemoMap"), ()=>new WeakMap);
    class Mj {
        f;
        annotations;
        _tag = "Suspend";
        constructor(e, n = {}){
            this.f = e, this.annotations = n, this.f = aj(e);
        }
        toString() {
            return Fc(this).pipe(ad(()=>xg(tj(this.f)(), (e)=>Fc(e))), Pr(()=>"<suspended schema>"));
        }
        toJSON() {
            const e = this.f();
            let n = T8.get(e);
            return n || (T8.set(e, {
                _tag: this._tag
            }), n = {
                _tag: this._tag,
                ast: e.toJSON(),
                annotations: ns(this.annotations)
            }, T8.set(e, n), n);
        }
    }
    let bC = class {
        from;
        filter;
        annotations;
        _tag = "Refinement";
        constructor(e, n, r = {}){
            this.from = e, this.filter = n, this.annotations = r;
        }
        toString() {
            return fv(this).pipe(Pr(()=>dn(Bj(this), {
                    onNone: ()=>`{ ${this.from} | filter }`,
                    onSome: (e)=>mC(this.from) ? String(this.from) + " & " + e : e
                })));
        }
        toJSON() {
            return {
                _tag: this._tag,
                from: this.from.toJSON(),
                annotations: ns(this.annotations)
            };
        }
    };
    const mC = Zy("Refinement"), C8 = {};
    let yC = class {
        from;
        to;
        transformation;
        annotations;
        _tag = "Transformation";
        constructor(e, n, r, s = {}){
            this.from = e, this.to = n, this.transformation = r, this.annotations = s;
        }
        toString() {
            return Pr(Fc(this), ()=>`(${String(this.from)} <-> ${String(this.to)})`);
        }
        toJSON() {
            return {
                _tag: this._tag,
                from: this.from.toJSON(),
                to: this.to.toJSON(),
                annotations: ns(this.annotations)
            };
        }
    };
    class axe {
        decode;
        encode;
        _tag = "FinalTransformation";
        constructor(e, n){
            this.decode = e, this.encode = n;
        }
    }
    class cxe {
        _tag = "ComposeTransformation";
    }
    const lxe = new cxe;
    let uxe = class {
        from;
        to;
        decode;
        encode;
        constructor(e, n, r, s){
            this.from = e, this.to = n, this.decode = r, this.encode = s;
        }
    };
    class dxe {
        propertySignatureTransformations;
        _tag = "TypeLiteralTransformation";
        constructor(e){
            this.propertySignatureTransformations = e;
            const n = {}, r = {};
            for (const s of e){
                const i = s.from;
                if (n[i]) throw new Error(eR(i));
                n[i] = !0;
                const o = s.to;
                if (r[o]) throw new Error(eR(o));
                r[o] = !0;
            }
        }
    }
    const wC = (t, e)=>{
        const n = Object.getOwnPropertyDescriptors(t), r = {
            ...t.annotations
        };
        delete r[fC];
        const s = {
            ...r,
            ...e
        }, i = Tj(t);
        return gr(i) && (s[xj] = wC(i.value, e)), n.annotations.value = s, Object.create(Object.getPrototypeOf(t), n);
    }, fxe = "[\\s\\S]*?", pxe = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?", Rj = (t, e)=>{
        switch(t._tag){
            case "Literal":
                return k2(String(t.literal));
            case "StringKeyword":
                return fxe;
            case "NumberKeyword":
                return pxe;
            case "TemplateLiteral":
                return Nj(t);
            case "Union":
                return t.types.map((n)=>Rj(n)).join("|");
        }
    }, hxe = (t, e, n, r)=>Oj(t) ? `(${e})` : e, Nj = (t, e, n)=>{
        let r = "";
        if (t.head !== "") {
            const s = k2(t.head);
            r += s;
        }
        for (const s of t.spans){
            const i = Rj(s.type);
            if (r += hxe(s.type, i), s.literal !== "") {
                const o = k2(s.literal);
                r += o;
            }
        }
        return r;
    }, gxe = (t)=>new RegExp(`^${Nj(t)}$`), rR = (t, e)=>{
        const n = [], r = [], s = (i)=>{
            switch(i._tag){
                case "NeverKeyword":
                    break;
                case "StringKeyword":
                case "SymbolKeyword":
                case "TemplateLiteral":
                case "Refinement":
                    r.push(new gv(i, e, !0));
                    break;
                case "Literal":
                    if (To(i.literal) || sp(i.literal)) n.push(new Ys(i.literal, e, !1, !0));
                    else throw new Error(c2e(i.literal));
                    break;
                case "Enums":
                    {
                        for (const [o, a] of i.enums)n.push(new Ys(a, e, !1, !0));
                        break;
                    }
                case "UniqueSymbol":
                    n.push(new Ys(i.symbol, e, !1, !0));
                    break;
                case "Union":
                    i.types.forEach(s);
                    break;
                default:
                    throw new Error(a2e(i));
            }
        };
        return s(t), {
            propertySignatures: n,
            indexSignatures: r
        };
    }, Vj = (t)=>(e)=>{
            let n;
            for (const r of t)Object.prototype.hasOwnProperty.call(e.annotations, r) && (n === void 0 && (n = {}), n[r] = e.annotations[r]);
            return n;
        }, bxe = Vj([
        uj,
        dj,
        fj,
        pj,
        hj,
        gj
    ]), ms = (t)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const e = Ko(t.typeParameters, ms);
                    return e === t.typeParameters ? t : new pv(e, t.decodeUnknown, t.encodeUnknown, t.annotations);
                }
            case "TupleType":
                {
                    const e = Ko(t.elements, (s)=>{
                        const i = ms(s.type);
                        return i === s.type ? s : new kg(i, s.isOptional);
                    }), n = Ij(t.rest), r = Ko(n, ms);
                    return e === t.elements && r === n ? t : new hC(e, r.map((s)=>new hv(s)), t.isReadonly, t.annotations);
                }
            case "TypeLiteral":
                {
                    const e = Ko(t.propertySignatures, (r)=>{
                        const s = ms(r.type);
                        return s === r.type ? r : new Ys(r.name, s, r.isOptional, r.isReadonly);
                    }), n = Ko(t.indexSignatures, (r)=>{
                        const s = ms(r.type);
                        return s === r.type ? r : new gv(r.parameter, s, r.isReadonly);
                    });
                    return e === t.propertySignatures && n === t.indexSignatures ? t : new zf(e, n, t.annotations);
                }
            case "Union":
                {
                    const e = Ko(t.types, ms);
                    return e === t.types ? t : xc.make(e, t.annotations);
                }
            case "Suspend":
                return new Mj(()=>ms(t.f()), t.annotations);
            case "Refinement":
                {
                    const e = ms(t.from);
                    return e === t.from ? t : new bC(e, t.filter, t.annotations);
                }
            case "Transformation":
                {
                    const e = bxe(t);
                    return ms(e !== void 0 ? wC(t.to, e) : t.to);
                }
        }
        return t;
    };
    function Ko(t, e) {
        let n = !1;
        const r = lv(t.length);
        for(let s = 0; s < t.length; s++){
            const i = t[s], o = e(i);
            o !== i && (n = !0), r[s] = o;
        }
        return n ? r : t;
    }
    const bc = (t, e)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const n = Ko(t.typeParameters, (r)=>bc(r));
                    return n === t.typeParameters ? t : new pv(n, t.decodeUnknown, t.encodeUnknown);
                }
            case "TupleType":
                {
                    const n = Ko(t.elements, (i)=>{
                        const o = bc(i.type);
                        return o === i.type ? i : new kg(o, i.isOptional);
                    }), r = Ij(t.rest), s = Ko(r, (i)=>bc(i));
                    return n === t.elements && s === r ? t : new hC(n, s.map((i)=>new hv(i)), t.isReadonly);
                }
            case "TypeLiteral":
                {
                    const n = Ko(t.propertySignatures, (s)=>{
                        const i = bc(s.type);
                        return i === s.type ? s : new Ys(s.name, i, s.isOptional, s.isReadonly);
                    }), r = Ko(t.indexSignatures, (s)=>{
                        const i = bc(s.type);
                        return i === s.type ? s : new gv(s.parameter, i, s.isReadonly);
                    });
                    return n === t.propertySignatures && r === t.indexSignatures ? t : new zf(n, r);
                }
            case "Union":
                {
                    const n = Ko(t.types, (r)=>bc(r));
                    return n === t.types ? t : xc.make(n);
                }
            case "Suspend":
                {
                    let n;
                    const r = N2e(t);
                    return gr(r) && (n = {
                        [Cj]: `${r.value}Encoded`
                    }), new Mj(()=>bc(t.f()), n);
                }
            case "Refinement":
                return bc(t.from);
            case "Transformation":
                return bc(t.from);
        }
        return t;
    }, sR = (t)=>bc(t), ns = (t)=>{
        const e = {};
        for (const n of Object.getOwnPropertySymbols(t))e[String(n)] = t[n];
        return e;
    }, Dj = (t)=>{
        switch(t._tag){
            case "StringKeyword":
            case "SymbolKeyword":
            case "TemplateLiteral":
                return t;
            case "Refinement":
                return Dj(t.from);
        }
    }, mxe = (t, e)=>new yC(t, e, lxe), mu = (t)=>Pr(Fc(t), ()=>t._tag);
    function yxe(t) {
        return dn(S2e(t), {
            onNone: ()=>"",
            onSome: (e)=>e.map((n)=>` & Brand<${jd(n)}>`).join("")
        });
    }
    let Bj, Fc, wxe, iR, _xe, xxe, vxe, C2, Fj;
    Bj = (t)=>vj(t).pipe(ad(()=>kj(t)), ad(()=>Sj(t)), Ac((e)=>e + yxe(t)));
    Fc = (t)=>ad(fv(t), ()=>Bj(t));
    wxe = BigInt(0);
    s_t = j(2, (t, e)=>t + e);
    iR = (t)=>{
        let e = wxe;
        for (const n of t)e += n;
        return e;
    };
    _xe = (t)=>t > BigInt(Number.MAX_SAFE_INTEGER) || t < BigInt(Number.MIN_SAFE_INTEGER) ? Fe() : ze(Number(t));
    xxe = (t)=>{
        try {
            return t.trim() === "" ? Fe() : ze(BigInt(t));
        } catch  {
            return Fe();
        }
    };
    vxe = (t)=>{
        if (t > Number.MAX_SAFE_INTEGER || t < Number.MIN_SAFE_INTEGER) return Fe();
        try {
            return ze(BigInt(t));
        } catch  {
            return Fe();
        }
    };
    C2 = Symbol.for("effect/Brand/Refined");
    Fj = (t, e)=>[
            {
                message: t,
                meta: e
            }
        ];
    function Lj(...t) {
        const e = t.length === 2 ? (n)=>t[0](n) ? mt(n) : st(t[1](n)) : (n)=>dn(t[0](n), {
                onNone: ()=>mt(n),
                onSome: st
            });
        return Object.assign((n)=>cC(e(n), Ht), {
            [C2]: C2,
            option: (n)=>b_e(e(n)),
            either: e,
            is: (n)=>Ma(e(n))
        });
    }
    let bv, zj, E2, Sxe, kxe, _C, Txe, Cxe, Exe, Ixe, Uj, Axe, cp, Pxe, Hj, Oxe, Mxe, Rxe, Nxe, jj, Vxe, E8, xC, Dxe, qj, Bxe, Fxe, Lxe, zxe, Wc, Uxe, vC, Xm, mv, kc, Pc, Wj, Vp, Tg, Hxe, Cg, Kj;
    bv = ()=>Object.assign((t)=>t, {
            [C2]: C2,
            option: (t)=>ze(t),
            either: (t)=>mt(t),
            is: (t)=>!0
        });
    zj = Symbol.for("effect/Context/Tag");
    E2 = Symbol.for("effect/Context/Reference");
    Sxe = "effect/STM";
    kxe = Symbol.for(Sxe);
    _C = {
        ...Wy,
        _op: "Tag",
        [kxe]: A0,
        [zj]: {
            _Service: (t)=>t,
            _Identifier: (t)=>t
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Tag",
                key: this.key,
                stack: this.stack
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        of (t) {
            return t;
        },
        context (t) {
            return jj(this, t);
        }
    };
    Txe = {
        ..._C,
        [E2]: E2
    };
    Cxe = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 2;
        const n = new Error;
        Error.stackTraceLimit = e;
        const r = Object.create(_C);
        return Object.defineProperty(r, "stack", {
            get () {
                return n.stack;
            }
        }), r.key = t, r;
    };
    Exe = (t)=>()=>{
            const e = Error.stackTraceLimit;
            Error.stackTraceLimit = 2;
            const n = new Error;
            Error.stackTraceLimit = e;
            function r() {}
            return Object.setPrototypeOf(r, _C), r.key = t, Object.defineProperty(r, "stack", {
                get () {
                    return n.stack;
                }
            }), r;
        };
    Ixe = ()=>(t, e)=>{
            const n = Error.stackTraceLimit;
            Error.stackTraceLimit = 2;
            const r = new Error;
            Error.stackTraceLimit = n;
            function s() {}
            return Object.setPrototypeOf(s, Txe), s.key = t, s.defaultValue = e.defaultValue, Object.defineProperty(s, "stack", {
                get () {
                    return r.stack;
                }
            }), s;
        };
    Uj = Symbol.for("effect/Context");
    Axe = {
        [Uj]: {
            _Services: (t)=>t
        },
        [$t] (t) {
            if (Hj(t) && this.unsafeMap.size === t.unsafeMap.size) {
                for (const e of this.unsafeMap.keys())if (!t.unsafeMap.has(e) || !jt(this.unsafeMap.get(e), t.unsafeMap.get(e))) return !1;
                return !0;
            }
            return !1;
        },
        [Jt] () {
            return ur(this, qy(this.unsafeMap.size));
        },
        pipe () {
            return St(this, arguments);
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Context",
                services: Array.from(this.unsafeMap).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        }
    };
    cp = (t)=>{
        const e = Object.create(Axe);
        return e.unsafeMap = t, e;
    };
    Pxe = (t)=>{
        const e = new Error(`Service not found${t.key ? `: ${String(t.key)}` : ""}`);
        if (t.stack) {
            const n = t.stack.split(`
`);
            if (n.length > 2) {
                const r = n[2].match(/at (.*)/);
                r && (e.message = e.message + ` (defined at ${r[1]})`);
            }
        }
        if (e.stack) {
            const n = e.stack.split(`
`);
            n.splice(1, 3), e.stack = n.join(`
`);
        }
        return e;
    };
    Hj = (t)=>Ft(t, Uj);
    Oxe = (t)=>Ft(t, zj);
    Mxe = (t)=>Ft(t, E2);
    Rxe = cp(new Map);
    Nxe = ()=>Rxe;
    jj = (t, e)=>cp(new Map([
            [
                t.key,
                e
            ]
        ]));
    Vxe = j(3, (t, e, n)=>{
        const r = new Map(t.unsafeMap);
        return r.set(e.key, n), cp(r);
    });
    E8 = Xt("effect/Context/defaultValueCache", ()=>new Map);
    xC = (t)=>{
        if (E8.has(t.key)) return E8.get(t.key);
        const e = t.defaultValue();
        return E8.set(t.key, e), e;
    };
    Dxe = (t, e)=>t.unsafeMap.has(e.key) ? t.unsafeMap.get(e.key) : xC(e);
    qj = j(2, (t, e)=>{
        if (!t.unsafeMap.has(e.key)) {
            if (E2 in e) return xC(e);
            throw Pxe(e);
        }
        return t.unsafeMap.get(e.key);
    });
    Bxe = qj;
    Fxe = j(2, (t, e)=>t.unsafeMap.has(e.key) ? nd(t.unsafeMap.get(e.key)) : Mxe(e) ? nd(xC(e)) : Km);
    Lxe = j(2, (t, e)=>{
        const n = new Map(t.unsafeMap);
        for (const [r, s] of e.unsafeMap)n.set(r, s);
        return cp(n);
    });
    zxe = (...t)=>{
        const e = new Map;
        for(let n = 0; n < t.length; n++)t[n].unsafeMap.forEach((r, s)=>{
            e.set(s, r);
        });
        return cp(e);
    };
    Wc = Cxe;
    Uxe = Hj;
    vC = Oxe;
    Xm = Nxe;
    mv = jj;
    kc = Vxe;
    Pc = Bxe;
    Wj = qj;
    Vp = Fxe;
    Tg = Lxe;
    Hxe = zxe;
    yv = Exe;
    Cg = Ixe;
    Kj = Symbol.for("effect/Chunk");
    function jxe(t, e, n, r, s) {
        for(let i = e; i < Math.min(t.length, e + s); i++)n[r + i - e] = t[i];
        return n;
    }
    const $j = [], qxe = (t)=>E0((e, n)=>e.length === n.length && _o(e).every((r, s)=>t(r, Da(n, s)))), Wxe = qxe(jt), Kxe = {
        [Kj]: {
            _A: (t)=>t
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Chunk",
                values: _o(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        [$t] (t) {
            return SC(t) && Wxe(this, t);
        },
        [Jt] () {
            return ur(this, yg(_o(this)));
        },
        [Symbol.iterator] () {
            switch(this.backing._tag){
                case "IArray":
                    return this.backing.array[Symbol.iterator]();
                case "IEmpty":
                    return $j[Symbol.iterator]();
                default:
                    return _o(this)[Symbol.iterator]();
            }
        },
        pipe () {
            return St(this, arguments);
        }
    }, Hr = (t)=>{
        const e = Object.create(Kxe);
        switch(e.backing = t, t._tag){
            case "IEmpty":
                {
                    e.length = 0, e.depth = 0, e.left = e, e.right = e;
                    break;
                }
            case "IConcat":
                {
                    e.length = t.left.length + t.right.length, e.depth = 1 + Math.max(t.left.depth, t.right.depth), e.left = t.left, e.right = t.right;
                    break;
                }
            case "IArray":
                {
                    e.length = t.array.length, e.depth = 0, e.left = $o, e.right = $o;
                    break;
                }
            case "ISingleton":
                {
                    e.length = 1, e.depth = 0, e.left = $o, e.right = $o;
                    break;
                }
            case "ISlice":
                {
                    e.length = t.length, e.depth = t.chunk.depth + 1, e.left = $o, e.right = $o;
                    break;
                }
        }
        return e;
    }, SC = (t)=>Ft(t, Kj), $o = Hr({
        _tag: "IEmpty"
    }), En = ()=>$o, _m = (...t)=>Jxe(t), Mn = (t)=>Hr({
            _tag: "ISingleton",
            a: t
        }), Co = (t)=>SC(t) ? t : Yi(Un(t)), m6 = (t, e, n)=>{
        switch(t.backing._tag){
            case "IArray":
                {
                    jxe(t.backing.array, 0, e, n, t.length);
                    break;
                }
            case "IConcat":
                {
                    m6(t.left, e, n), m6(t.right, e, n + t.left.length);
                    break;
                }
            case "ISingleton":
                {
                    e[n] = t.backing.a;
                    break;
                }
            case "ISlice":
                {
                    let r = 0, s = n;
                    for(; r < t.length;)e[s] = Da(t, r), r += 1, s += 1;
                    break;
                }
        }
    }, $xe = (t)=>_o(t).slice(), kC = $xe, Xxe = (t)=>{
        switch(t.backing._tag){
            case "IEmpty":
                return $j;
            case "IArray":
                return t.backing.array;
            default:
                {
                    const e = new Array(t.length);
                    return m6(t, e, 0), t.backing = {
                        _tag: "IArray",
                        array: e
                    }, t.left = $o, t.right = $o, t.depth = 0, e;
                }
        }
    }, _o = Xxe, Gxe = (t)=>{
        switch(t.backing._tag){
            case "IEmpty":
            case "ISingleton":
                return t;
            case "IArray":
                return Hr({
                    _tag: "IArray",
                    array: GM(t.backing.array)
                });
            case "IConcat":
                return Hr({
                    _tag: "IConcat",
                    left: ru(t.backing.right),
                    right: ru(t.backing.left)
                });
            case "ISlice":
                return Yi(GM(_o(t)));
        }
    }, ru = Gxe, Zxe = j(2, (t, e)=>e < 0 || e >= t.length ? Fe() : ze(Da(t, e))), Yi = (t)=>t.length === 0 ? En() : t.length === 1 ? Mn(t[0]) : Hr({
            _tag: "IArray",
            array: t
        }), Jxe = (t)=>Yi(t), Da = j(2, (t, e)=>{
        switch(t.backing._tag){
            case "IEmpty":
                throw new Error("Index out of bounds");
            case "ISingleton":
                {
                    if (e !== 0) throw new Error("Index out of bounds");
                    return t.backing.a;
                }
            case "IArray":
                {
                    if (e >= t.length || e < 0) throw new Error("Index out of bounds");
                    return t.backing.array[e];
                }
            case "IConcat":
                return e < t.left.length ? Da(t.left, e) : Da(t.right, e - t.left.length);
            case "ISlice":
                return Da(t.backing.chunk, e + t.backing.offset);
        }
    }), Gm = j(2, (t, e)=>Ar(t, Mn(e))), Rs = j(2, (t, e)=>Ar(Mn(e), t)), y6 = j(2, (t, e)=>{
        if (e <= 0) return $o;
        if (e >= t.length) return t;
        switch(t.backing._tag){
            case "ISlice":
                return Hr({
                    _tag: "ISlice",
                    chunk: t.backing.chunk,
                    length: e,
                    offset: t.backing.offset
                });
            case "IConcat":
                return e > t.left.length ? Hr({
                    _tag: "IConcat",
                    left: t.left,
                    right: y6(t.right, e - t.left.length)
                }) : y6(t.left, e);
            default:
                return Hr({
                    _tag: "ISlice",
                    chunk: t,
                    offset: 0,
                    length: e
                });
        }
    }), xd = j(2, (t, e)=>{
        if (e <= 0) return t;
        if (e >= t.length) return $o;
        switch(t.backing._tag){
            case "ISlice":
                return Hr({
                    _tag: "ISlice",
                    chunk: t.backing.chunk,
                    offset: t.backing.offset + e,
                    length: t.backing.length - e
                });
            case "IConcat":
                return e > t.left.length ? xd(t.right, e - t.left.length) : Hr({
                    _tag: "IConcat",
                    left: xd(t.left, e),
                    right: t.right
                });
            default:
                return Hr({
                    _tag: "ISlice",
                    chunk: t,
                    offset: e,
                    length: t.length - e
                });
        }
    }), Ar = j(2, (t, e)=>{
        if (t.backing._tag === "IEmpty") return e;
        if (e.backing._tag === "IEmpty") return t;
        const n = e.depth - t.depth;
        if (Math.abs(n) <= 1) return Hr({
            _tag: "IConcat",
            left: t,
            right: e
        });
        if (n < -1) if (t.left.depth >= t.right.depth) {
            const r = Ar(t.right, e);
            return Hr({
                _tag: "IConcat",
                left: t.left,
                right: r
            });
        } else {
            const r = Ar(t.right.right, e);
            if (r.depth === t.depth - 3) {
                const s = Hr({
                    _tag: "IConcat",
                    left: t.right.left,
                    right: r
                });
                return Hr({
                    _tag: "IConcat",
                    left: t.left,
                    right: s
                });
            } else {
                const s = Hr({
                    _tag: "IConcat",
                    left: t.left,
                    right: t.right.left
                });
                return Hr({
                    _tag: "IConcat",
                    left: s,
                    right: r
                });
            }
        }
        else if (e.right.depth >= e.left.depth) {
            const r = Ar(t, e.left);
            return Hr({
                _tag: "IConcat",
                left: r,
                right: e.right
            });
        } else {
            const r = Ar(t, e.left.left);
            if (r.depth === e.depth - 3) {
                const s = Hr({
                    _tag: "IConcat",
                    left: r,
                    right: e.left.right
                });
                return Hr({
                    _tag: "IConcat",
                    left: s,
                    right: e.right
                });
            } else {
                const s = Hr({
                    _tag: "IConcat",
                    left: e.left.right,
                    right: e.right
                });
                return Hr({
                    _tag: "IConcat",
                    left: r,
                    right: s
                });
            }
        }
    }), Xj = j(2, (t, e)=>Yi(dv(t, e))), Jy = j(2, (t, e)=>Yi(Xy(t, e))), Gj = j(2, (t, e)=>{
        if (t.backing._tag === "ISingleton") return e(t.backing.a, 0);
        let n = $o, r = 0;
        for (const s of t)n = Ar(n, e(s, r++));
        return n;
    }), Yxe = j(2, (t, e)=>_o(t).forEach(e)), Qxe = Gj(Ht), Eg = (t)=>t.length === 0, ca = (t)=>t.length > 0, wv = Zxe(0), TC = (t)=>Da(t, 0), Cc = TC, Zj = j(2, (t, e)=>t.backing._tag === "ISingleton" ? Mn(e(t.backing.a, 0)) : Yi(V(_o(t), Ps((n, r)=>e(n, r))))), eve = j(3, (t, e, n)=>{
        const [r, s] = s2e(t, e, n);
        return [
            r,
            Yi(s)
        ];
    }), Jj = j(2, (t, e)=>[
            y6(t, e),
            xd(t, e)
        ]), tve = j(2, (t, e)=>{
        let n = 0;
        for (const r of _o(t)){
            if (e(r)) break;
            n++;
        }
        return Jj(t, n);
    }), Pl = (t)=>xd(t, 1), nve = $_e, rve = nu, w6 = Symbol.for("effect/Duration"), Yj = BigInt(0), oR = BigInt(24), Bw = BigInt(60), _6 = BigInt(1e3), aR = BigInt(1e6), cR = BigInt(1e9), sve = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/, Ei = (t)=>{
        if (Qj(t)) return t;
        if (sp(t)) return ls(t);
        if (ev(t)) return I8(t);
        if (Array.isArray(t) && t.length === 2 && t.every(sp)) return t[0] === -1 / 0 || t[1] === -1 / 0 || Number.isNaN(t[0]) || Number.isNaN(t[1]) ? lp : t[0] === 1 / 0 || t[1] === 1 / 0 ? eq : I8(BigInt(Math.round(t[0] * 1e9)) + BigInt(Math.round(t[1])));
        if (To(t)) {
            const e = sve.exec(t);
            if (e) {
                const [n, r, s] = e, i = Number(r);
                switch(s){
                    case "nano":
                    case "nanos":
                        return I8(BigInt(r));
                    case "micro":
                    case "micros":
                        return lve(BigInt(r));
                    case "milli":
                    case "millis":
                        return ls(i);
                    case "second":
                    case "seconds":
                        return yu(i);
                    case "minute":
                    case "minutes":
                        return Yy(i);
                    case "hour":
                    case "hours":
                        return uve(i);
                    case "day":
                    case "days":
                        return dve(i);
                    case "week":
                    case "weeks":
                        return fve(i);
                }
            }
        }
        throw new Error("Invalid DurationInput");
    }, lR = {
        _tag: "Millis",
        millis: 0
    }, ive = {
        _tag: "Infinity"
    }, ove = {
        [w6]: w6,
        [Jt] () {
            return ur(this, DH(this.value));
        },
        [$t] (t) {
            return Qj(t) && wve(this, t);
        },
        toString () {
            return `Duration(${rq(this)})`;
        },
        toJSON () {
            switch(this.value._tag){
                case "Millis":
                    return {
                        _id: "Duration",
                        _tag: "Millis",
                        millis: this.value.millis
                    };
                case "Nanos":
                    return {
                        _id: "Duration",
                        _tag: "Nanos",
                        hrtime: hve(this)
                    };
                case "Infinity":
                    return {
                        _id: "Duration",
                        _tag: "Infinity"
                    };
            }
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, Qi = (t)=>{
        const e = Object.create(ove);
        return sp(t) ? isNaN(t) || t <= 0 ? e.value = lR : Number.isFinite(t) ? Number.isInteger(t) ? e.value = {
            _tag: "Millis",
            millis: t
        } : e.value = {
            _tag: "Nanos",
            nanos: BigInt(Math.round(t * 1e6))
        } : e.value = ive : t <= Yj ? e.value = lR : e.value = {
            _tag: "Nanos",
            nanos: t
        }, e;
    }, Qj = (t)=>Ft(t, w6), ave = (t)=>t.value._tag !== "Infinity", cve = (t)=>{
        switch(t.value._tag){
            case "Millis":
                return t.value.millis === 0;
            case "Nanos":
                return t.value.nanos === Yj;
            case "Infinity":
                return !1;
        }
    }, lp = Qi(0), eq = Qi(1 / 0), I8 = (t)=>Qi(t), lve = (t)=>Qi(t * _6), ls = (t)=>Qi(t), yu = (t)=>Qi(t * 1e3), Yy = (t)=>Qi(t * 6e4), uve = (t)=>Qi(t * 36e5), dve = (t)=>Qi(t * 864e5), fve = (t)=>Qi(t * 6048e5), ki = (t)=>tq(t, {
            onMillis: (e)=>e,
            onNanos: (e)=>Number(e) / 1e6
        }), pve = (t)=>{
        const e = Ei(t);
        switch(e.value._tag){
            case "Infinity":
                throw new Error("Cannot convert infinite duration to nanos");
            case "Nanos":
                return e.value.nanos;
            case "Millis":
                return BigInt(Math.round(e.value.millis * 1e6));
        }
    }, hve = (t)=>{
        const e = Ei(t);
        switch(e.value._tag){
            case "Infinity":
                return [
                    1 / 0,
                    0
                ];
            case "Nanos":
                return [
                    Number(e.value.nanos / cR),
                    Number(e.value.nanos % cR)
                ];
            case "Millis":
                return [
                    Math.floor(e.value.millis / 1e3),
                    Math.round(e.value.millis % 1e3 * 1e6)
                ];
        }
    }, tq = j(2, (t, e)=>{
        const n = Ei(t);
        switch(n.value._tag){
            case "Nanos":
                return e.onNanos(n.value.nanos);
            case "Infinity":
                return e.onMillis(1 / 0);
            case "Millis":
                return e.onMillis(n.value.millis);
        }
    }), _v = j(3, (t, e, n)=>{
        const r = Ei(t), s = Ei(e);
        if (r.value._tag === "Infinity" || s.value._tag === "Infinity") return n.onMillis(ki(r), ki(s));
        if (r.value._tag === "Nanos" || s.value._tag === "Nanos") {
            const i = r.value._tag === "Nanos" ? r.value.nanos : BigInt(Math.round(r.value.millis * 1e6)), o = s.value._tag === "Nanos" ? s.value.nanos : BigInt(Math.round(s.value.millis * 1e6));
            return n.onNanos(i, o);
        }
        return n.onMillis(r.value.millis, s.value.millis);
    }), gve = (t, e)=>_v(t, e, {
            onMillis: (n, r)=>n === r,
            onNanos: (n, r)=>n === r
        }), bve = j(2, (t, e)=>tq(t, {
            onMillis: (n)=>Qi(n * e),
            onNanos: (n)=>Qi(n * BigInt(e))
        })), mve = j(2, (t, e)=>_v(t, e, {
            onMillis: (n, r)=>Qi(n + r),
            onNanos: (n, r)=>Qi(n + r)
        })), yve = j(2, (t, e)=>_v(t, e, {
            onMillis: (n, r)=>n <= r,
            onNanos: (n, r)=>n <= r
        })), nq = j(2, (t, e)=>_v(t, e, {
            onMillis: (n, r)=>n >= r,
            onNanos: (n, r)=>n >= r
        })), wve = j(2, (t, e)=>gve(Ei(t), Ei(e))), _ve = (t)=>{
        const e = Ei(t);
        if (e.value._tag === "Infinity") return {
            days: 1 / 0,
            hours: 1 / 0,
            minutes: 1 / 0,
            seconds: 1 / 0,
            millis: 1 / 0,
            nanos: 1 / 0
        };
        const n = pve(e), r = n / aR, s = r / _6, i = s / Bw, o = i / Bw, a = o / oR;
        return {
            days: Number(a),
            hours: Number(o % oR),
            minutes: Number(i % Bw),
            seconds: Number(s % Bw),
            millis: Number(r % _6),
            nanos: Number(n % aR)
        };
    }, rq = (t)=>{
        const e = Ei(t);
        if (e.value._tag === "Infinity") return "Infinity";
        if (cve(e)) return "0";
        const n = _ve(e), r = [];
        return n.days !== 0 && r.push(`${n.days}d`), n.hours !== 0 && r.push(`${n.hours}h`), n.minutes !== 0 && r.push(`${n.minutes}m`), n.seconds !== 0 && r.push(`${n.seconds}s`), n.millis !== 0 && r.push(`${n.millis}ms`), n.nanos !== 0 && r.push(`${n.nanos}ns`), r.join(" ");
    }, up = 5, CC = Math.pow(2, up), xve = CC - 1, vve = CC / 2, Sve = CC / 4;
    function kve(t) {
        return t -= t >> 1 & 1431655765, t = (t & 858993459) + (t >> 2 & 858993459), t = t + (t >> 4) & 252645135, t += t >> 8, t += t >> 16, t & 127;
    }
    function M0(t, e) {
        return e >>> t & xve;
    }
    function Dh(t) {
        return 1 << t;
    }
    function sq(t, e) {
        return kve(t & e - 1);
    }
    const Tve = (t, e)=>({
            value: t,
            previous: e
        });
    function Wh(t, e, n, r) {
        let s = r;
        if (!t) {
            const i = r.length;
            s = new Array(i);
            for(let o = 0; o < i; ++o)s[o] = r[o];
        }
        return s[e] = n, s;
    }
    function iq(t, e, n) {
        const r = n.length - 1;
        let s = 0, i = 0, o = n;
        if (t) s = i = e;
        else for(o = new Array(r); s < e;)o[i++] = n[s++];
        for(++s; s <= r;)o[i++] = n[s++];
        return t && (o.length = r), o;
    }
    function Cve(t, e, n, r) {
        const s = r.length;
        if (t) {
            let c = s;
            for(; c >= e;)r[c--] = r[c];
            return r[e] = n, r;
        }
        let i = 0, o = 0;
        const a = new Array(s + 1);
        for(; i < e;)a[o++] = r[i++];
        for(a[e] = n; i < s;)a[++o] = r[i++];
        return a;
    }
    class vd {
        _tag = "EmptyNode";
        modify(e, n, r, s, i, o) {
            const a = r(Fe());
            return Qr(a) ? new vd : (++o.value, new Uf(e, s, i, a));
        }
    }
    function Ra(t) {
        return JT(t, "EmptyNode");
    }
    function Eve(t) {
        return Ra(t) || t._tag === "LeafNode" || t._tag === "CollisionNode";
    }
    function xv(t, e) {
        return Ra(t) ? !1 : e === t.edit;
    }
    class Uf {
        edit;
        hash;
        key;
        value;
        _tag = "LeafNode";
        constructor(e, n, r, s){
            this.edit = e, this.hash = n, this.key = r, this.value = s;
        }
        modify(e, n, r, s, i, o) {
            if (jt(i, this.key)) {
                const c = r(this.value);
                return c === this.value ? this : Qr(c) ? (--o.value, new vd) : xv(this, e) ? (this.value = c, this) : new Uf(e, s, i, c);
            }
            const a = r(Fe());
            return Qr(a) ? this : (++o.value, oq(e, n, this.hash, this, s, new Uf(e, s, i, a)));
        }
    }
    class EC {
        edit;
        hash;
        children;
        _tag = "CollisionNode";
        constructor(e, n, r){
            this.edit = e, this.hash = n, this.children = r;
        }
        modify(e, n, r, s, i, o) {
            if (s === this.hash) {
                const c = xv(this, e), l = this.updateCollisionList(c, e, this.hash, this.children, r, i, o);
                return l === this.children ? this : l.length > 1 ? new EC(e, this.hash, l) : l[0];
            }
            const a = r(Fe());
            return Qr(a) ? this : (++o.value, oq(e, n, this.hash, this, s, new Uf(e, s, i, a)));
        }
        updateCollisionList(e, n, r, s, i, o, a) {
            const c = s.length;
            for(let u = 0; u < c; ++u){
                const d = s[u];
                if ("key" in d && jt(o, d.key)) {
                    const f = d.value, p = i(f);
                    return p === f ? s : Qr(p) ? (--a.value, iq(e, u, s)) : Wh(e, u, new Uf(n, r, o, p), s);
                }
            }
            const l = i(Fe());
            return Qr(l) ? s : (++a.value, Wh(e, c, new Uf(n, r, o, l), s));
        }
    }
    class R0 {
        edit;
        mask;
        children;
        _tag = "IndexedNode";
        constructor(e, n, r){
            this.edit = e, this.mask = n, this.children = r;
        }
        modify(e, n, r, s, i, o) {
            const a = this.mask, c = this.children, l = M0(n, s), u = Dh(l), d = sq(a, u), f = a & u, p = xv(this, e);
            if (!f) {
                const k = new vd().modify(e, n + up, r, s, i, o);
                return k ? c.length >= vve ? Ave(e, l, k, a, c) : new R0(e, a | u, Cve(p, d, k, c)) : this;
            }
            const h = c[d], m = h.modify(e, n + up, r, s, i, o);
            if (h === m) return this;
            let w = a, v;
            if (Ra(m)) {
                if (w &= ~u, !w) return new vd;
                if (c.length <= 2 && Eve(c[d ^ 1])) return c[d ^ 1];
                v = iq(p, d, c);
            } else v = Wh(p, d, m, c);
            return p ? (this.mask = w, this.children = v, this) : new R0(e, w, v);
        }
    }
    class IC {
        edit;
        size;
        children;
        _tag = "ArrayNode";
        constructor(e, n, r){
            this.edit = e, this.size = n, this.children = r;
        }
        modify(e, n, r, s, i, o) {
            let a = this.size;
            const c = this.children, l = M0(n, s), u = c[l], d = (u || new vd).modify(e, n + up, r, s, i, o);
            if (u === d) return this;
            const f = xv(this, e);
            let p;
            if (Ra(u) && !Ra(d)) ++a, p = Wh(f, l, d, c);
            else if (!Ra(u) && Ra(d)) {
                if (--a, a <= Sve) return Ive(e, a, l, c);
                p = Wh(f, l, new vd, c);
            } else p = Wh(f, l, d, c);
            return f ? (this.size = a, this.children = p, this) : new IC(e, a, p);
        }
    }
    function Ive(t, e, n, r) {
        const s = new Array(e - 1);
        let i = 0, o = 0;
        for(let a = 0, c = r.length; a < c; ++a)if (a !== n) {
            const l = r[a];
            l && !Ra(l) && (s[i++] = l, o |= 1 << a);
        }
        return new R0(t, o, s);
    }
    function Ave(t, e, n, r, s) {
        const i = [];
        let o = r, a = 0;
        for(let c = 0; o; ++c)o & 1 && (i[c] = s[a++]), o >>>= 1;
        return i[e] = n, new IC(t, a + 1, i);
    }
    function Pve(t, e, n, r, s, i) {
        if (n === s) return new EC(t, n, [
            i,
            r
        ]);
        const o = M0(e, n), a = M0(e, s);
        if (o === a) return (c)=>new R0(t, Dh(o) | Dh(a), [
                c
            ]);
        {
            const c = o < a ? [
                r,
                i
            ] : [
                i,
                r
            ];
            return new R0(t, Dh(o) | Dh(a), c);
        }
    }
    function oq(t, e, n, r, s, i) {
        let o, a = e;
        for(;;){
            const c = Pve(t, a, n, r, s, i);
            if (typeof c == "function") o = Tve(c, o), a = a + up;
            else {
                let l = c;
                for(; o != null;)l = o.value(l), o = o.previous;
                return l;
            }
        }
    }
    const aq = "effect/HashMap", x6 = Symbol.for(aq), Ove = {
        [x6]: x6,
        [Symbol.iterator] () {
            return new Qy(this, (t, e)=>[
                    t,
                    e
                ]);
        },
        [Jt] () {
            let t = At(aq);
            for (const e of this)t ^= V(At(e[0]), bn(At(e[1])));
            return ur(this, t);
        },
        [$t] (t) {
            if (Nve(t)) {
                if (t._size !== this._size) return !1;
                for (const e of this){
                    const n = V(t, PC(e[0], At(e[0])));
                    if (Qr(n)) return !1;
                    if (!jt(e[1], n.value)) return !1;
                }
                return !0;
            }
            return !1;
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "HashMap",
                values: Array.from(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, AC = (t, e, n, r)=>{
        const s = Object.create(Ove);
        return s._editable = t, s._edit = e, s._root = n, s._size = r, s;
    };
    class Qy {
        map;
        f;
        v;
        constructor(e, n){
            this.map = e, this.f = n, this.v = cq(this.map._root, this.f, void 0);
        }
        next() {
            if (Qr(this.v)) return {
                done: !0,
                value: void 0
            };
            const e = this.v.value;
            return this.v = I2(e.cont), {
                done: !1,
                value: e.value
            };
        }
        [Symbol.iterator]() {
            return new Qy(this.map, this.f);
        }
    }
    const I2 = (t)=>t ? lq(t[0], t[1], t[2], t[3], t[4]) : Fe(), cq = (t, e, n = void 0)=>{
        switch(t._tag){
            case "LeafNode":
                return gr(t.value) ? ze({
                    value: e(t.key, t.value.value),
                    cont: n
                }) : I2(n);
            case "CollisionNode":
            case "ArrayNode":
            case "IndexedNode":
                {
                    const r = t.children;
                    return lq(r.length, r, 0, e, n);
                }
            default:
                return I2(n);
        }
    }, lq = (t, e, n, r, s)=>{
        for(; n < t;){
            const i = e[n++];
            if (i && !Ra(i)) return cq(i, r, [
                t,
                e,
                n,
                r,
                s
            ]);
        }
        return I2(s);
    }, Mve = AC(!1, 0, new vd, 0), vv = ()=>Mve, Rve = (t)=>{
        const e = Sv(vv());
        for (const n of t)N0(e, n[0], n[1]);
        return OC(e);
    }, Nve = (t)=>Ft(t, x6), Vve = (t)=>t && Ra(t._root), Dve = j(2, (t, e)=>PC(t, e, At(e))), PC = j(3, (t, e, n)=>{
        let r = t._root, s = 0;
        for(;;)switch(r._tag){
            case "LeafNode":
                return jt(e, r.key) ? r.value : Fe();
            case "CollisionNode":
                {
                    if (n === r.hash) {
                        const i = r.children;
                        for(let o = 0, a = i.length; o < a; ++o){
                            const c = i[o];
                            if ("key" in c && jt(e, c.key)) return c.value;
                        }
                    }
                    return Fe();
                }
            case "IndexedNode":
                {
                    const i = M0(s, n), o = Dh(i);
                    if (r.mask & o) {
                        r = r.children[sq(r.mask, o)], s += up;
                        break;
                    }
                    return Fe();
                }
            case "ArrayNode":
                {
                    if (r = r.children[M0(s, n)], r) {
                        s += up;
                        break;
                    }
                    return Fe();
                }
            default:
                return Fe();
        }
    }), uq = j(2, (t, e)=>gr(PC(t, e, At(e)))), N0 = j(3, (t, e, n)=>MC(t, e, ()=>ze(n))), Bve = j(3, (t, e, n)=>t._editable ? (t._root = e, t._size = n, t) : e === t._root ? t : AC(t._editable, t._edit, e, n)), dq = (t)=>new Qy(t, (e)=>e), Fve = (t)=>new Qy(t, (e, n)=>n), v6 = (t)=>t._size, Sv = (t)=>AC(!0, t._edit + 1, t._root, t._size), OC = (t)=>(t._editable = !1, t), Lve = j(2, (t, e)=>{
        const n = Sv(t);
        return e(n), OC(n);
    }), MC = j(3, (t, e, n)=>zve(t, e, At(e), n)), zve = j(4, (t, e, n, r)=>{
        const s = {
            value: t._size
        }, i = t._root.modify(t._editable ? t._edit : NaN, 0, r, n, e, s);
        return V(t, Bve(i, s.value));
    }), Uve = j(2, (t, e)=>{
        const n = Sv(t);
        return RC(e, (r, s)=>N0(n, s, r)), OC(n);
    }), A2 = j(2, (t, e)=>MC(t, e, Fe)), Hve = j(2, (t, e)=>Lve(t, (n)=>{
            for (const r of e)A2(r)(n);
        })), jve = j(2, (t, e)=>kv(t, vv(), (n, r, s)=>N0(n, s, e(r, s)))), RC = j(2, (t, e)=>kv(t, void 0, (n, r, s)=>e(r, s))), kv = j(3, (t, e, n)=>{
        const r = t._root;
        if (r._tag === "LeafNode") return gr(r.value) ? n(e, r.value.value, r.key) : e;
        if (r._tag === "EmptyNode") return e;
        const s = [
            r.children
        ];
        let i;
        for(; i = s.pop();)for(let o = 0, a = i.length; o < a;){
            const c = i[o++];
            c && !Ra(c) && (c._tag === "LeafNode" ? gr(c.value) && (e = n(e, c.value.value, c.key)) : s.push(c.children));
        }
        return e;
    }), fq = "effect/HashSet", S6 = Symbol.for(fq), qve = {
        [S6]: S6,
        [Symbol.iterator] () {
            return dq(this._keyMap);
        },
        [Jt] () {
            return ur(this, bn(At(this._keyMap))(At(fq)));
        },
        [$t] (t) {
            return Wve(t) ? v6(this._keyMap) === v6(t._keyMap) && jt(this._keyMap, t._keyMap) : !1;
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "HashSet",
                values: Array.from(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, Tv = (t)=>{
        const e = Object.create(qve);
        return e._keyMap = t, e;
    }, Wve = (t)=>Ft(t, S6), Kve = Tv(vv()), e1 = ()=>Kve, $ve = (t)=>{
        const e = VC(e1());
        for (const n of t)V0(e, n);
        return DC(e);
    }, Xve = (...t)=>{
        const e = VC(e1());
        for (const n of t)V0(e, n);
        return DC(e);
    }, NC = j(2, (t, e)=>uq(t._keyMap, e)), Gve = j(2, (t, e)=>{
        let n = !1;
        for (const r of t)if (n = e(r), n) break;
        return n;
    }), Zve = j(2, (t, e)=>!Gve(t, (n)=>!e(n))), Jve = j(2, (t, e)=>Zve(t, (n)=>NC(e, n))), Yve = (t)=>v6(t._keyMap), VC = (t)=>Tv(Sv(t._keyMap)), DC = (t)=>(t._keyMap._editable = !1, t), BC = j(2, (t, e)=>{
        const n = VC(t);
        return e(n), DC(n);
    }), V0 = j(2, (t, e)=>t._keyMap._editable ? (N0(e, !0)(t._keyMap), t) : Tv(N0(e, !0)(t._keyMap))), pq = j(2, (t, e)=>t._keyMap._editable ? (A2(e)(t._keyMap), t) : Tv(A2(e)(t._keyMap))), Qve = j(2, (t, e)=>BC(t, (n)=>{
            for (const r of e)pq(n, r);
        })), e3e = j(2, (t, e)=>BC(e1(), (n)=>{
            for (const r of e)NC(r)(t) && V0(r)(n);
        })), t3e = j(2, (t, e)=>BC(e1(), (n)=>{
            n3e(t, (r)=>V0(n, r));
            for (const r of e)V0(n, r);
        })), n3e = j(2, (t, e)=>RC(t._keyMap, (n, r)=>e(r))), r3e = j(3, (t, e, n)=>kv(t._keyMap, e, (r, s, i)=>n(r, i))), dp = e1, Jb = $ve, FC = Xve, s3e = NC, i3e = Jve, Kh = Yve, xm = V0, hq = pq, uR = Qve, o3e = e3e, Zm = t3e, Jm = r3e, dR = Symbol.for("effect/MutableRef"), a3e = {
        [dR]: dR,
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableRef",
                current: Ir(this.current)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, Dp = (t)=>{
        const e = Object.create(a3e);
        return e.current = t, e;
    }, c3e = j(3, (t, e, n)=>jt(e, t.current) ? (t.current = n, !0) : !1), Tn = (t)=>t.current, Bp = j(2, (t, e)=>(t.current = e, t)), Cv = "effect/FiberId", fp = Symbol.for(Cv), D0 = "None", k6 = "Runtime", T6 = "Composite", l3e = qr(`${Cv}-${D0}`);
    let u3e = class {
        [fp] = fp;
        _tag = D0;
        id = -1;
        startTimeMillis = -1;
        [Jt]() {
            return l3e;
        }
        [$t](e) {
            return LC(e) && e._tag === D0;
        }
        toString() {
            return Mr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag
            };
        }
        [Bn]() {
            return this.toJSON();
        }
    };
    class d3e {
        id;
        startTimeMillis;
        [fp] = fp;
        _tag = k6;
        constructor(e, n){
            this.id = e, this.startTimeMillis = n;
        }
        [Jt]() {
            return ur(this, qr(`${Cv}-${this._tag}-${this.id}-${this.startTimeMillis}`));
        }
        [$t](e) {
            return LC(e) && e._tag === k6 && this.id === e.id && this.startTimeMillis === e.startTimeMillis;
        }
        toString() {
            return Mr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag,
                id: this.id,
                startTimeMillis: this.startTimeMillis
            };
        }
        [Bn]() {
            return this.toJSON();
        }
    }
    let f3e = class {
        left;
        right;
        [fp] = fp;
        _tag = T6;
        constructor(e, n){
            this.left = e, this.right = n;
        }
        _hash;
        [Jt]() {
            return V(qr(`${Cv}-${this._tag}`), bn(At(this.left)), bn(At(this.right)), ur(this));
        }
        [$t](e) {
            return LC(e) && e._tag === T6 && jt(this.left, e.left) && jt(this.right, e.right);
        }
        toString() {
            return Mr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag,
                left: Ir(this.left),
                right: Ir(this.right)
            };
        }
        [Bn]() {
            return this.toJSON();
        }
    };
    const gq = new u3e, LC = (t)=>Ft(t, fp), bq = j(2, (t, e)=>t._tag === D0 ? e : e._tag === D0 ? t : new f3e(t, e)), p3e = (t)=>V(t, Jm(gq, (e, n)=>bq(n)(e))), P2 = (t)=>{
        switch(t._tag){
            case D0:
                return dp();
            case k6:
                return FC(t.id);
            case T6:
                return V(P2(t.left), Zm(P2(t.right)));
        }
    }, fR = Xt(Symbol.for("effect/Fiber/Id/_fiberCounter"), ()=>Dp(0)), mq = (t)=>Array.from(P2(t)).map((n)=>`#${n}`).join(","), h3e = ()=>{
        const t = Tn(fR);
        return V(fR, Bp(t + 1)), new d3e(t, Date.now());
    }, B0 = gq, g3e = bq, b3e = p3e, m3e = P2, y3e = mq, yq = h3e, F0 = vv, Yb = Rve, w3e = Vve, O2 = Dve, pR = uq, M2 = N0, wq = dq, _3e = Fve, hR = (t)=>Array.from(_3e(t)), x3e = MC, gR = Uve, bR = A2, A8 = Hve, v3e = jve, S3e = RC, _q = kv, Ym = Symbol.for("effect/List"), C6 = (t)=>Un(t), k3e = (t)=>AH(Gy(t), C6), T3e = k3e(jt), C3e = {
        [Ym]: Ym,
        _tag: "Cons",
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "List",
                _tag: "Cons",
                values: C6(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        [$t] (t) {
            return vq(t) && this._tag === t._tag && T3e(this, t);
        },
        [Jt] () {
            return ur(this, yg(C6(this)));
        },
        [Symbol.iterator] () {
            let t = !1, e = this;
            return {
                next () {
                    if (t) return this.return();
                    if (e._tag === "Nil") return t = !0, this.return();
                    const n = e.head;
                    return e = e.tail, {
                        done: t,
                        value: n
                    };
                },
                return (n) {
                    return t || (t = !0), {
                        done: !0,
                        value: n
                    };
                }
            };
        },
        pipe () {
            return St(this, arguments);
        }
    }, R2 = (t, e)=>{
        const n = Object.create(C3e);
        return n.head = t, n.tail = e, n;
    }, E3e = qr("Nil"), I3e = {
        [Ym]: Ym,
        _tag: "Nil",
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "List",
                _tag: "Nil"
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        [Jt] () {
            return E3e;
        },
        [$t] (t) {
            return vq(t) && this._tag === t._tag;
        },
        [Symbol.iterator] () {
            return {
                next () {
                    return {
                        done: !0,
                        value: void 0
                    };
                }
            };
        },
        pipe () {
            return St(this, arguments);
        }
    }, xq = Object.create(I3e), vq = (t)=>Ft(t, Ym), ql = (t)=>t._tag === "Nil", A3e = (t)=>t._tag === "Cons", P3e = ()=>xq, pp = (t, e)=>R2(t, e), L0 = P3e, zC = (t)=>R2(t, xq), O3e = j(2, (t, e)=>R3e(e, t)), M3e = j(2, (t, e)=>pp(e, t)), R3e = j(2, (t, e)=>{
        if (ql(t)) return e;
        if (ql(e)) return t;
        {
            const n = R2(e.head, t);
            let r = n, s = e.tail;
            for(; !ql(s);){
                const i = R2(s.head, t);
                r.tail = i, r = i, s = s.tail;
            }
            return n;
        }
    }), N3e = j(3, (t, e, n)=>{
        let r = e, s = t;
        for(; !ql(s);)r = n(r, s.head), s = s.tail;
        return r;
    }), V3e = (t)=>{
        let e = L0(), n = t;
        for(; !ql(n);)e = M3e(e, n.head), n = n.tail;
        return e;
    }, D3e = Object.assign(Object.create(Array.prototype), {
        [Jt] () {
            return ur(this, yg(this));
        },
        [$t] (t) {
            return Array.isArray(t) && this.length === t.length ? this.every((e, n)=>jt(e, t[n])) : !1;
        }
    }), UC = (function() {
        function t(e) {
            e && Object.assign(this, e);
        }
        return t.prototype = Ky, t;
    })(), B3e = (t)=>Object.assign(Object.create(Ky), t), F3e = Symbol.for("effect/DifferContextPatch");
    function mR(t) {
        return t;
    }
    const t1 = {
        ...UC.prototype,
        [F3e]: {
            _Value: mR,
            _Patch: mR
        }
    }, L3e = Object.assign(Object.create(t1), {
        _tag: "Empty"
    }), z3e = Object.create(L3e), Sq = ()=>z3e, U3e = Object.assign(Object.create(t1), {
        _tag: "AndThen"
    }), H3e = (t, e)=>{
        const n = Object.create(U3e);
        return n.first = t, n.second = e, n;
    }, j3e = Object.assign(Object.create(t1), {
        _tag: "AddService"
    }), q3e = (t, e)=>{
        const n = Object.create(j3e);
        return n.key = t, n.service = e, n;
    }, W3e = Object.assign(Object.create(t1), {
        _tag: "RemoveService"
    }), K3e = (t)=>{
        const e = Object.create(W3e);
        return e.key = t, e;
    }, $3e = Object.assign(Object.create(t1), {
        _tag: "UpdateService"
    }), X3e = (t, e)=>{
        const n = Object.create($3e);
        return n.key = t, n.update = e, n;
    }, G3e = (t, e)=>{
        const n = new Map(t.unsafeMap);
        let r = Sq();
        for (const [s, i] of e.unsafeMap.entries())if (n.has(s)) {
            const o = n.get(s);
            n.delete(s), jt(o, i) || (r = C_(X3e(s, ()=>i))(r));
        } else n.delete(s), r = C_(q3e(s, i))(r);
        for (const [s] of n.entries())r = C_(K3e(s))(r);
        return r;
    }, C_ = j(2, (t, e)=>H3e(t, e)), Z3e = j(2, (t, e)=>{
        if (t._tag === "Empty") return e;
        let n = !1, r = Mn(t);
        const s = new Map(e.unsafeMap);
        for(; ca(r);){
            const o = Cc(r), a = Pl(r);
            switch(o._tag){
                case "Empty":
                    {
                        r = a;
                        break;
                    }
                case "AddService":
                    {
                        s.set(o.key, o.service), r = a;
                        break;
                    }
                case "AndThen":
                    {
                        r = Rs(Rs(a, o.second), o.first);
                        break;
                    }
                case "RemoveService":
                    {
                        s.delete(o.key), r = a;
                        break;
                    }
                case "UpdateService":
                    {
                        s.set(o.key, o.update(s.get(o.key))), n = !0, r = a;
                        break;
                    }
            }
        }
        if (!n) return cp(s);
        const i = new Map;
        for (const [o] of e.unsafeMap)s.has(o) && (i.set(o, s.get(o)), s.delete(o));
        for (const [o, a] of s)i.set(o, a);
        return cp(i);
    }), J3e = Symbol.for("effect/DifferHashSetPatch");
    function P8(t) {
        return t;
    }
    const Ev = {
        ...UC.prototype,
        [J3e]: {
            _Value: P8,
            _Key: P8,
            _Patch: P8
        }
    }, Y3e = Object.assign(Object.create(Ev), {
        _tag: "Empty"
    }), Q3e = Object.create(Y3e), kq = ()=>Q3e, e9e = Object.assign(Object.create(Ev), {
        _tag: "AndThen"
    }), t9e = (t, e)=>{
        const n = Object.create(e9e);
        return n.first = t, n.second = e, n;
    }, n9e = Object.assign(Object.create(Ev), {
        _tag: "Add"
    }), r9e = (t)=>{
        const e = Object.create(n9e);
        return e.value = t, e;
    }, s9e = Object.assign(Object.create(Ev), {
        _tag: "Remove"
    }), i9e = (t)=>{
        const e = Object.create(s9e);
        return e.value = t, e;
    }, o9e = (t, e)=>{
        const [n, r] = Jm([
            t,
            kq()
        ], ([s, i], o)=>s3e(o)(s) ? [
                hq(o)(s),
                i
            ] : [
                s,
                E6(r9e(o))(i)
            ])(e);
        return Jm(r, (s, i)=>E6(i9e(i))(s))(n);
    }, E6 = j(2, (t, e)=>t9e(t, e)), a9e = j(2, (t, e)=>{
        if (t._tag === "Empty") return e;
        let n = e, r = Mn(t);
        for(; ca(r);){
            const s = Cc(r), i = Pl(r);
            switch(s._tag){
                case "Empty":
                    {
                        r = i;
                        break;
                    }
                case "AndThen":
                    {
                        r = Rs(s.first)(Rs(s.second)(i));
                        break;
                    }
                case "Add":
                    {
                        n = xm(s.value)(n), r = i;
                        break;
                    }
                case "Remove":
                    n = hq(s.value)(n), r = i;
            }
        }
        return n;
    }), c9e = Symbol.for("effect/DifferReadonlyArrayPatch");
    function yR(t) {
        return t;
    }
    const n1 = {
        ...UC.prototype,
        [c9e]: {
            _Value: yR,
            _Patch: yR
        }
    }, l9e = Object.assign(Object.create(n1), {
        _tag: "Empty"
    }), u9e = Object.create(l9e), Tq = ()=>u9e, d9e = Object.assign(Object.create(n1), {
        _tag: "AndThen"
    }), f9e = (t, e)=>{
        const n = Object.create(d9e);
        return n.first = t, n.second = e, n;
    }, p9e = Object.assign(Object.create(n1), {
        _tag: "Append"
    }), h9e = (t)=>{
        const e = Object.create(p9e);
        return e.values = t, e;
    }, g9e = Object.assign(Object.create(n1), {
        _tag: "Slice"
    }), b9e = (t, e)=>{
        const n = Object.create(g9e);
        return n.from = t, n.until = e, n;
    }, m9e = Object.assign(Object.create(n1), {
        _tag: "Update"
    }), y9e = (t, e)=>{
        const n = Object.create(m9e);
        return n.index = t, n.patch = e, n;
    }, w9e = (t)=>{
        let e = 0, n = Tq();
        for(; e < t.oldValue.length && e < t.newValue.length;){
            const r = t.oldValue[e], s = t.newValue[e], i = t.differ.diff(r, s);
            jt(i, t.differ.empty) || (n = E_(n, y9e(e, i))), e = e + 1;
        }
        return e < t.oldValue.length && (n = E_(n, b9e(0, e))), e < t.newValue.length && (n = E_(n, h9e(K_e(e)(t.newValue)))), n;
    }, E_ = j(2, (t, e)=>f9e(t, e)), _9e = j(3, (t, e, n)=>{
        if (t._tag === "Empty") return e;
        let r = e.slice(), s = qo(t);
        for(; ym(s);){
            const i = Si(s), o = ap(s);
            switch(i._tag){
                case "Empty":
                    {
                        s = o;
                        break;
                    }
                case "AndThen":
                    {
                        o.unshift(i.first, i.second), s = o;
                        break;
                    }
                case "Append":
                    {
                        for (const a of i.values)r.push(a);
                        s = o;
                        break;
                    }
                case "Slice":
                    {
                        r = r.slice(i.from, i.until), s = o;
                        break;
                    }
                case "Update":
                    {
                        r[i.index] = n.patch(i.patch, r[i.index]), s = o;
                        break;
                    }
            }
        }
        return r;
    }), x9e = Symbol.for("effect/Differ"), v9e = {
        [x9e]: {
            _P: Ht,
            _V: Ht
        },
        pipe () {
            return St(this, arguments);
        }
    }, Ig = (t)=>{
        const e = Object.create(v9e);
        return e.empty = t.empty, e.diff = t.diff, e.combine = t.combine, e.patch = t.patch, e;
    }, S9e = ()=>Ig({
            empty: Sq(),
            combine: (t, e)=>C_(e)(t),
            diff: (t, e)=>G3e(t, e),
            patch: (t, e)=>Z3e(e)(t)
        }), k9e = ()=>Ig({
            empty: kq(),
            combine: (t, e)=>E6(e)(t),
            diff: (t, e)=>o9e(t, e),
            patch: (t, e)=>a9e(e)(t)
        }), T9e = (t)=>Ig({
            empty: Tq(),
            combine: (e, n)=>E_(e, n),
            diff: (e, n)=>w9e({
                    oldValue: e,
                    newValue: n,
                    differ: t
                }),
            patch: (e, n)=>_9e(e, n, t)
        }), Cq = ()=>C9e((t, e)=>e), C9e = (t)=>Ig({
            empty: Ht,
            combine: (e, n)=>e === Ht ? n : n === Ht ? e : (r)=>n(e(r)),
            diff: (e, n)=>jt(e, n) ? Ht : Qx(n),
            patch: (e, n)=>t(n, e(n))
        }), Qm = 255, Eq = 8, I6 = (t)=>t & Qm, A6 = (t)=>t >> Eq & Qm, r1 = (t, e)=>(t & Qm) + ((e & t & Qm) << Eq), E9e = r1(0, 0), I9e = (t)=>r1(t, t), A9e = (t)=>r1(t, 0), P9e = j(2, (t, e)=>r1(I6(t) & ~e, A6(t))), O9e = j(2, (t, e)=>t | e), M9e = (t)=>~t >>> 0 & Qm, R9e = 0, Fp = 1, N9e = 2, Iq = 4, P6 = 16, Aq = 32, V9e = (t)=>Iv(t, Aq), D9e = j(2, (t, e)=>t & ~e), B9e = j(2, (t, e)=>t | e), Gu = (t)=>Pq(t) && !L9e(t), Pq = (t)=>Iv(t, Fp), Iv = j(2, (t, e)=>(t & e) !== 0), Oq = (...t)=>t.reduce((e, n)=>e | n, 0), F9e = Oq(R9e), wR = (t)=>Iv(t, Iq), L9e = (t)=>Iv(t, P6), cd = j(2, (t, e)=>r1(t ^ e, e)), $h = j(2, (t, e)=>t & (M9e(I6(e)) | A6(e)) | I6(e) & A6(e)), _R = Ig({
        empty: E9e,
        diff: (t, e)=>cd(t, e),
        combine: (t, e)=>O9e(e)(t),
        patch: (t, e)=>$h(e, t)
    }), z9e = I9e, Mq = A9e, xR = P9e, Rq = (t, e)=>({
            _tag: "Par",
            left: t,
            right: e
        }), Fw = (t, e)=>({
            _tag: "Seq",
            left: t,
            right: e
        }), U9e = (t)=>{
        let e = zC(t), n = L0();
        for(;;){
            const [r, s] = N3e(e, [
                Nq(),
                L0()
            ], ([i, o], a)=>{
                const [c, l] = H9e(a);
                return [
                    $9e(i, c),
                    O3e(o, l)
                ];
            });
            if (n = j9e(n, r), ql(s)) return V3e(n);
            e = s;
        }
        throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues");
    }, H9e = (t)=>{
        let e = t, n = Nq(), r = L0(), s = L0();
        for(;;)switch(e._tag){
            case "Empty":
                {
                    if (ql(r)) return [
                        n,
                        s
                    ];
                    e = r.head, r = r.tail;
                    break;
                }
            case "Par":
                {
                    r = pp(e.right, r), e = e.left;
                    break;
                }
            case "Seq":
                {
                    const i = e.left, o = e.right;
                    switch(i._tag){
                        case "Empty":
                            {
                                e = o;
                                break;
                            }
                        case "Par":
                            {
                                const a = i.left, c = i.right;
                                e = Rq(Fw(a, o), Fw(c, o));
                                break;
                            }
                        case "Seq":
                            {
                                const a = i.left, c = i.right;
                                e = Fw(a, Fw(c, o));
                                break;
                            }
                        case "Single":
                            {
                                e = i, s = pp(o, s);
                                break;
                            }
                    }
                    break;
                }
            case "Single":
                {
                    if (n = K9e(n, e), ql(r)) return [
                        n,
                        s
                    ];
                    e = r.head, r = r.tail;
                    break;
                }
        }
        throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues");
    }, j9e = (t, e)=>{
        if (ql(t)) return zC(O8(e));
        if (X9e(e)) return t;
        const n = e5e(t.head), r = G9e(e);
        return n.length === 1 && r.length === 1 && jt(n[0], r[0]) ? pp(Q9e(t.head, O8(e)), t.tail) : pp(O8(e), t);
    }, q9e = Symbol.for("effect/RequestBlock/RequestBlockParallel"), W9e = {
        _R: (t)=>t
    };
    class HC {
        map;
        [q9e] = W9e;
        constructor(e){
            this.map = e;
        }
    }
    const Nq = ()=>new HC(F0()), K9e = (t, e)=>new HC(x3e(t.map, e.dataSource, (n)=>m_e(Ac(n, Gm(e.blockedRequest)), ()=>Mn(e.blockedRequest)))), $9e = (t, e)=>new HC(_q(t.map, e.map, (n, r, s)=>M2(n, s, dn(O2(n, s), {
                onNone: ()=>r,
                onSome: (i)=>Ar(r, i)
            })))), X9e = (t)=>w3e(t.map), G9e = (t)=>Array.from(wq(t.map)), O8 = (t)=>Y9e(v3e(t.map, (e)=>Mn(e))), Z9e = Symbol.for("effect/RequestBlock/RequestBlockSequential"), J9e = {
        _R: (t)=>t
    };
    class Vq {
        map;
        [Z9e] = J9e;
        constructor(e){
            this.map = e;
        }
    }
    const Y9e = (t)=>new Vq(t), Q9e = (t, e)=>new Vq(_q(e.map, t.map, (n, r, s)=>M2(n, s, dn(O2(n, s), {
                onNone: ()=>En(),
                onSome: (i)=>Ar(i, r)
            })))), e5e = (t)=>Array.from(wq(t.map)), t5e = (t)=>Array.from(t.map), Ag = "Die", hp = "Empty", Lp = "Fail", Pg = "Interrupt", z0 = "Parallel", U0 = "Sequential", Dq = "effect/Cause", Bq = Symbol.for(Dq), n5e = {
        _E: (t)=>t
    }, Og = {
        [Bq]: n5e,
        [Jt] () {
            return V(At(Dq), bn(At(p5e(this))), ur(this));
        },
        [$t] (t) {
            return Fq(t) && f5e(this, t);
        },
        pipe () {
            return St(this, arguments);
        },
        toJSON () {
            switch(this._tag){
                case "Empty":
                    return {
                        _id: "Cause",
                        _tag: this._tag
                    };
                case "Die":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        defect: Ir(this.defect)
                    };
                case "Interrupt":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        fiberId: this.fiberId.toJSON()
                    };
                case "Fail":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        failure: Ir(this.error)
                    };
                case "Sequential":
                case "Parallel":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        left: Ir(this.left),
                        right: Ir(this.right)
                    };
            }
        },
        toString () {
            return Mg(this);
        },
        [Bn] () {
            return this.toJSON();
        }
    }, su = (()=>{
        const t = Object.create(Og);
        return t._tag = hp, t;
    })(), Sd = (t)=>{
        const e = Object.create(Og);
        return e._tag = Lp, e.error = t, e;
    }, Ti = (t)=>{
        const e = Object.create(Og);
        return e._tag = Ag, e.defect = t, e;
    }, Go = (t)=>{
        const e = Object.create(Og);
        return e._tag = Pg, e.fiberId = t, e;
    }, iu = (t, e)=>{
        const n = Object.create(Og);
        return n._tag = z0, n.left = t, n.right = e, n;
    }, xs = (t, e)=>{
        const n = Object.create(Og);
        return n._tag = U0, n.left = t, n.right = e, n;
    }, Fq = (t)=>Ft(t, Bq), r5e = (t)=>t._tag === hp, s5e = (t)=>t._tag === Lp, jC = (t)=>t._tag === Ag, i5e = (t)=>t._tag === hp ? !0 : H0(t, !0, (e, n)=>{
            switch(n._tag){
                case hp:
                    return ze(e);
                case Ag:
                case Lp:
                case Pg:
                    return ze(!1);
                default:
                    return Fe();
            }
        }), Lq = (t)=>gr(c5e(t)), Av = (t)=>$C(void 0, g5e)(t), o5e = (t)=>ru(H0(t, En(), (e, n)=>n._tag === Lp ? ze(V(e, Rs(n.error))) : Fe())), qC = (t)=>ru(H0(t, En(), (e, n)=>n._tag === Ag ? ze(V(e, Rs(n.defect))) : Fe())), WC = (t)=>H0(t, dp(), (e, n)=>n._tag === Pg ? ze(V(e, xm(n.fiberId))) : Fe()), zq = (t)=>Pv(t, (e)=>e._tag === Lp ? ze(e.error) : Fe()), KC = (t)=>{
        const e = zq(t);
        switch(e._tag){
            case "None":
                return mt(t);
            case "Some":
                return st(e.value);
        }
    }, a5e = (t)=>s1(t, {
            onEmpty: ze(su),
            onFail: Ac(Sd),
            onDie: (e)=>ze(Ti(e)),
            onInterrupt: (e)=>ze(Go(e)),
            onSequential: v2(xs),
            onParallel: v2(iu)
        }), c5e = (t)=>Pv(t, (e)=>e._tag === Pg ? ze(e.fiberId) : Fe()), l5e = (t)=>s1(t, {
            onEmpty: Fe(),
            onFail: (e)=>ze(Ti(e)),
            onDie: (e)=>ze(Ti(e)),
            onInterrupt: ()=>Fe(),
            onSequential: v2(xs),
            onParallel: v2(iu)
        }), vR = (t)=>s1(t, {
            onEmpty: su,
            onFail: ()=>su,
            onDie: Ti,
            onInterrupt: Go,
            onSequential: xs,
            onParallel: iu
        }), u5e = (t)=>s1(t, {
            onEmpty: su,
            onFail: Ti,
            onDie: Ti,
            onInterrupt: Go,
            onSequential: xs,
            onParallel: iu
        }), Uq = j(2, (t, e)=>d5e(t, (n)=>Sd(e(n)))), d5e = j(2, (t, e)=>s1(t, {
            onEmpty: su,
            onFail: (n)=>e(n),
            onDie: (n)=>Ti(n),
            onInterrupt: (n)=>Go(n),
            onSequential: (n, r)=>xs(n, r),
            onParallel: (n, r)=>iu(n, r)
        })), f5e = (t, e)=>{
        let n = Mn(t), r = Mn(e);
        for(; ca(n) && ca(r);){
            const [s, i] = V(Cc(n), H0([
                dp(),
                En()
            ], ([c, l], u)=>{
                const [d, f] = O6(u);
                return ze([
                    V(c, Zm(d)),
                    V(l, Ar(f))
                ]);
            })), [o, a] = V(Cc(r), H0([
                dp(),
                En()
            ], ([c, l], u)=>{
                const [d, f] = O6(u);
                return ze([
                    V(c, Zm(d)),
                    V(l, Ar(f))
                ]);
            }));
            if (!jt(s, o)) return !1;
            n = i, r = a;
        }
        return !0;
    }, p5e = (t)=>h5e(Mn(t), En()), h5e = (t, e)=>{
        for(;;){
            const [n, r] = V(t, nu([
                dp(),
                En()
            ], ([i, o], a)=>{
                const [c, l] = O6(a);
                return [
                    V(i, Zm(c)),
                    V(o, Ar(l))
                ];
            })), s = Kh(n) > 0 ? V(e, Rs(n)) : e;
            if (Eg(r)) return ru(s);
            t = r, e = s;
        }
        throw new Error(tv("Cause.flattenCauseLoop"));
    }, Pv = j(2, (t, e)=>{
        const n = [
            t
        ];
        for(; n.length > 0;){
            const r = n.pop(), s = e(r);
            switch(s._tag){
                case "None":
                    {
                        switch(r._tag){
                            case U0:
                            case z0:
                                {
                                    n.push(r.right), n.push(r.left);
                                    break;
                                }
                        }
                        break;
                    }
                case "Some":
                    return s;
            }
        }
        return Fe();
    }), O6 = (t)=>{
        let e = t;
        const n = [];
        let r = dp(), s = En();
        for(; e !== void 0;)switch(e._tag){
            case hp:
                {
                    if (n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case Lp:
                {
                    if (r = xm(r, _m(e._tag, e.error)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case Ag:
                {
                    if (r = xm(r, _m(e._tag, e.defect)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case Pg:
                {
                    if (r = xm(r, _m(e._tag, e.fiberId)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case U0:
                {
                    switch(e.left._tag){
                        case hp:
                            {
                                e = e.right;
                                break;
                            }
                        case U0:
                            {
                                e = xs(e.left.left, xs(e.left.right, e.right));
                                break;
                            }
                        case z0:
                            {
                                e = iu(xs(e.left.left, e.right), xs(e.left.right, e.right));
                                break;
                            }
                        default:
                            {
                                s = Rs(s, e.right), e = e.left;
                                break;
                            }
                    }
                    break;
                }
            case z0:
                {
                    n.push(e.right), e = e.left;
                    break;
                }
        }
        throw new Error(tv("Cause.evaluateCauseLoop"));
    }, g5e = {
        emptyCase: WM,
        failCase: qm,
        dieCase: qm,
        interruptCase: WM,
        sequentialCase: (t, e, n)=>e && n,
        parallelCase: (t, e, n)=>e && n
    }, SR = "SequentialCase", kR = "ParallelCase", s1 = j(2, (t, { onDie: e, onEmpty: n, onFail: r, onInterrupt: s, onParallel: i, onSequential: o })=>$C(t, void 0, {
            emptyCase: ()=>n,
            failCase: (a, c)=>r(c),
            dieCase: (a, c)=>e(c),
            interruptCase: (a, c)=>s(c),
            sequentialCase: (a, c, l)=>o(c, l),
            parallelCase: (a, c, l)=>i(c, l)
        })), H0 = j(3, (t, e, n)=>{
        let r = e, s = t;
        const i = [];
        for(; s !== void 0;){
            const o = n(r, s);
            switch(r = gr(o) ? o.value : r, s._tag){
                case U0:
                    {
                        i.push(s.right), s = s.left;
                        break;
                    }
                case z0:
                    {
                        i.push(s.right), s = s.left;
                        break;
                    }
                default:
                    {
                        s = void 0;
                        break;
                    }
            }
            s === void 0 && i.length > 0 && (s = i.pop());
        }
        return r;
    }), $C = j(3, (t, e, n)=>{
        const r = [
            t
        ], s = [];
        for(; r.length > 0;){
            const o = r.pop();
            switch(o._tag){
                case hp:
                    {
                        s.push(mt(n.emptyCase(e)));
                        break;
                    }
                case Lp:
                    {
                        s.push(mt(n.failCase(e, o.error)));
                        break;
                    }
                case Ag:
                    {
                        s.push(mt(n.dieCase(e, o.defect)));
                        break;
                    }
                case Pg:
                    {
                        s.push(mt(n.interruptCase(e, o.fiberId)));
                        break;
                    }
                case U0:
                    {
                        r.push(o.right), r.push(o.left), s.push(st({
                            _tag: SR
                        }));
                        break;
                    }
                case z0:
                    {
                        r.push(o.right), r.push(o.left), s.push(st({
                            _tag: kR
                        }));
                        break;
                    }
            }
        }
        const i = [];
        for(; s.length > 0;){
            const o = s.pop();
            switch(o._tag){
                case "Left":
                    {
                        switch(o.left._tag){
                            case SR:
                                {
                                    const a = i.pop(), c = i.pop(), l = n.sequentialCase(e, a, c);
                                    i.push(l);
                                    break;
                                }
                            case kR:
                                {
                                    const a = i.pop(), c = i.pop(), l = n.parallelCase(e, a, c);
                                    i.push(l);
                                    break;
                                }
                        }
                        break;
                    }
                case "Right":
                    {
                        i.push(o.right);
                        break;
                    }
            }
        }
        if (i.length === 0) throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");
        return i.pop();
    }), Mg = (t, e)=>Av(t) ? "All fibers interrupted without errors." : jq(t).map(function(n) {
            return e?.renderErrorCause !== !0 || n.cause === void 0 ? n.stack : `${n.stack} {
${Hq(n.cause, "  ")}
}`;
        }).join(`
`), Hq = (t, e)=>{
        const n = t.stack.split(`
`);
        let r = `${e}[cause]: ${n[0]}`;
        for(let s = 1, i = n.length; s < i; s++)r += `
${e}${n[s]}`;
        return t.cause && (r += ` {
${Hq(t.cause, `${e}  `)}
${e}}`), r;
    }, M6 = (t)=>{
        const e = typeof t == "object" && t !== null, n = Error.stackTraceLimit;
        Error.stackTraceLimit = 1;
        const r = new Error(b5e(t), e && "cause" in t && typeof t.cause < "u" ? {
            cause: M6(t.cause)
        } : void 0);
        return Error.stackTraceLimit = n, r.message === "" && (r.message = "An error has occurred"), Error.stackTraceLimit = n, r.name = t instanceof Error ? t.name : "Error", e && (j0 in t && (r.span = t[j0]), Object.keys(t).forEach((s)=>{
            s in r || (r[s] = t[s]);
        })), r.stack = y5e(`${r.name}: ${r.message}`, t instanceof Error && t.stack ? t.stack : "", r.span), r;
    }, b5e = (t)=>{
        if (typeof t == "string") return t;
        if (typeof t == "object" && t !== null && t instanceof Error) return t.message;
        try {
            if (Ft(t, "toString") && mg(t.toString) && t.toString !== Object.prototype.toString && t.toString !== globalThis.Array.prototype.toString) return t.toString();
        } catch  {}
        return LH(t);
    }, m5e = /\((.*)\)/g, N2 = Xt("effect/Tracer/spanToTrace", ()=>new WeakMap), y5e = (t, e, n)=>{
        const r = [
            t
        ], s = e.startsWith(t) ? e.slice(t.length).split(`
`) : e.split(`
`);
        for(let i = 1; i < s.length; i++){
            if (s[i].includes(" at new BaseEffectError") || s[i].includes(" at new YieldableError")) {
                i++;
                continue;
            }
            if (s[i].includes("Generator.next") || s[i].includes("effect_internal_function")) break;
            r.push(s[i].replace(/at .*effect_instruction_i.*\((.*)\)/, "at $1").replace(/EffectPrimitive\.\w+/, "<anonymous>"));
        }
        if (n) {
            let i = n, o = 0;
            for(; i && i._tag === "Span" && o < 10;){
                const a = N2.get(i);
                if (typeof a == "function") {
                    const c = a();
                    if (typeof c == "string") {
                        const l = c.matchAll(m5e);
                        let u = !1;
                        for (const [, d] of l)u = !0, r.push(`    at ${i.name} (${d})`);
                        u || r.push(`    at ${i.name} (${c.replace(/^at /, "")})`);
                    } else r.push(`    at ${i.name}`);
                } else r.push(`    at ${i.name}`);
                i = _c(i.parent), o++;
            }
        }
        return r.join(`
`);
    }, j0 = Symbol.for("effect/SpanAnnotation"), jq = (t)=>$C(t, void 0, {
            emptyCase: ()=>[],
            dieCase: (e, n)=>[
                    M6(n)
                ],
            failCase: (e, n)=>[
                    M6(n)
                ],
            interruptCase: ()=>[],
            parallelCase: (e, n, r)=>[
                    ...n,
                    ...r
                ],
            sequentialCase: (e, n, r)=>[
                    ...n,
                    ...r
                ]
        }), i1 = "Pending", Ov = "Done", w5e = "effect/Deferred", _5e = Symbol.for(w5e), x5e = {
        _E: (t)=>t,
        _A: (t)=>t
    }, v5e = (t)=>({
            _tag: i1,
            joiners: t
        }), qq = (t)=>({
            _tag: Ov,
            effect: t
        });
    class o1 {
        self;
        called = !1;
        constructor(e){
            this.self = e;
        }
        next(e) {
            return this.called ? {
                value: e,
                done: !0
            } : (this.called = !0, {
                value: this.self,
                done: !1
            });
        }
        return(e) {
            return {
                value: e,
                done: !0
            };
        }
        throw(e) {
            throw e;
        }
        [Symbol.iterator]() {
            return new o1(this.self);
        }
    }
    const Wq = (t, e)=>{
        const n = new ps("Blocked");
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }, S5e = (t)=>{
        const e = new ps("RunBlocked");
        return e.effect_instruction_i0 = t, e;
    }, q0 = Symbol.for("effect/Effect");
    class k5e {
        patch;
        op;
        _op = nC;
        constructor(e, n){
            this.patch = e, this.op = n;
        }
    }
    class ps {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [q0] = A0;
        constructor(e){
            this._op = e;
        }
        [$t](e) {
            return this === e;
        }
        [Jt]() {
            return ur(this, QT(this));
        }
        pipe() {
            return St(this, arguments);
        }
        toJSON() {
            return {
                _id: "Effect",
                _op: this._op,
                effect_instruction_i0: Ir(this.effect_instruction_i0),
                effect_instruction_i1: Ir(this.effect_instruction_i1),
                effect_instruction_i2: Ir(this.effect_instruction_i2)
            };
        }
        toString() {
            return Mr(this.toJSON());
        }
        [Bn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new o1(new jy(this));
        }
    }
    class Kq {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [q0] = A0;
        constructor(e){
            this._op = e, this._tag = e;
        }
        [$t](e) {
            return Uv(e) && e._op === "Failure" && jt(this.effect_instruction_i0, e.effect_instruction_i0);
        }
        [Jt]() {
            return V(qr(this._tag), bn(At(this.effect_instruction_i0)), ur(this));
        }
        get cause() {
            return this.effect_instruction_i0;
        }
        pipe() {
            return St(this, arguments);
        }
        toJSON() {
            return {
                _id: "Exit",
                _tag: this._op,
                cause: this.cause.toJSON()
            };
        }
        toString() {
            return Mr(this.toJSON());
        }
        [Bn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new o1(new jy(this));
        }
    }
    class $q {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [q0] = A0;
        constructor(e){
            this._op = e, this._tag = e;
        }
        [$t](e) {
            return Uv(e) && e._op === "Success" && jt(this.effect_instruction_i0, e.effect_instruction_i0);
        }
        [Jt]() {
            return V(qr(this._tag), bn(At(this.effect_instruction_i0)), ur(this));
        }
        get value() {
            return this.effect_instruction_i0;
        }
        pipe() {
            return St(this, arguments);
        }
        toJSON() {
            return {
                _id: "Exit",
                _tag: this._op,
                value: Ir(this.value)
            };
        }
        toString() {
            return Mr(this.toJSON());
        }
        [Bn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new o1(new jy(this));
        }
    }
    const Kc = (t)=>Ft(t, q0), fn = (t)=>{
        const e = new ps(HH);
        return e.effect_instruction_i0 = t, e;
    }, Xq = j(3, (t, e, n)=>Eo((r)=>Me(t, (s)=>Me(Oc(Rt(()=>r(e(s)))), (i)=>Rt(()=>n(s, i)).pipe(Ii({
                        onFailure: (o)=>{
                            switch(i._tag){
                                case Is:
                                    return kr(xs(i.effect_instruction_i0, o));
                                case As:
                                    return kr(o);
                            }
                        },
                        onSuccess: ()=>i
                    })))))), vs = j(2, (t, e)=>Me(t, ()=>Ke(e))), Mi = (t)=>vs(t, void 0), Gq = function() {
        const t = new ps(iv);
        switch(arguments.length){
            case 2:
                {
                    t.effect_instruction_i0 = arguments[0], t.commit = arguments[1];
                    break;
                }
            case 3:
                {
                    t.effect_instruction_i0 = arguments[0], t.effect_instruction_i1 = arguments[1], t.commit = arguments[2];
                    break;
                }
            case 4:
                {
                    t.effect_instruction_i0 = arguments[0], t.effect_instruction_i1 = arguments[1], t.effect_instruction_i2 = arguments[2], t.commit = arguments[3];
                    break;
                }
            default:
                throw new Error(tv("you're not supposed to end up here"));
        }
        return t;
    }, ey = (t, e = B0)=>{
        const n = new ps(bm);
        let r;
        return n.effect_instruction_i0 = (s)=>{
            r = t(s);
        }, n.effect_instruction_i1 = e, zp(n, (s)=>Kc(r) ? r : mn);
    }, XC = (t, e = B0)=>Rt(()=>ey(t, e)), za = (t, e = B0)=>Gq(t, function() {
            let n, r;
            function s(c) {
                n ? n(c) : r === void 0 && (r = c);
            }
            const i = new ps(bm);
            i.effect_instruction_i0 = (c)=>{
                n = c, r && c(r);
            }, i.effect_instruction_i1 = e;
            let o, a;
            return this.effect_instruction_i0.length !== 1 ? (a = new AbortController, o = js(()=>this.effect_instruction_i0(s, a.signal))) : o = js(()=>this.effect_instruction_i0(s)), o || a ? zp(i, (c)=>(a && a.abort(), o ?? mn)) : i;
        }), Mv = j(2, (t, e)=>{
        const n = new ps(S_);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }), W0 = j(2, (t, e)=>Lc(t, {
            onFailure: e,
            onSuccess: Ke
        })), T5e = j(3, (t, e, n)=>Mv(t, (r)=>{
            const s = KC(r);
            switch(s._tag){
                case "Left":
                    return e(s.left) ? n(s.left) : kr(r);
                case "Right":
                    return kr(s.right);
            }
        })), TR = Symbol.for("effect/OriginalAnnotation"), GC = (t, e)=>gr(e) ? new Proxy(t, {
            has (n, r) {
                return r === j0 || r === TR || r in n;
            },
            get (n, r) {
                return r === j0 ? e.value : r === TR ? t : n[r];
            }
        }) : t, Ol = (t)=>qc(t) && !(j0 in t) ? fn((e)=>kr(Ti(GC(t, oE(e))))) : kr(Ti(t)), Zq = (t)=>ZC(()=>Ti(new i8e(t))), K0 = (t)=>Lc(t, {
            onFailure: (e)=>Ke(st(e)),
            onSuccess: (e)=>Ke(mt(e))
        }), Oc = (t)=>Jq(t, {
            onFailure: Jn,
            onSuccess: Nr
        }), Tr = (t)=>qc(t) && !(j0 in t) ? fn((e)=>kr(Sd(GC(t, oE(e))))) : kr(Sd(t)), Rg = (t)=>Me($e(t), Tr), kr = (t)=>{
        const e = new Kq(Is);
        return e.effect_instruction_i0 = t, e;
    }, ZC = (t)=>Me($e(t), kr), a1 = fn((t)=>Ke(t.id())), Ng = (t)=>fn((e)=>t(e.id())), Me = j(2, (t, e)=>{
        const n = new ps(w2);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }), C5e = j(2, (t, e)=>Me(t, (n)=>{
            const r = typeof e == "function" ? e(n) : e;
            return Kc(r) ? r : MH(r) ? ey((s)=>{
                r.then((i)=>s(Ke(i)), (i)=>s(Tr(new zv(i, "An unknown error occurred in Effect.andThen"))));
            }) : Ke(r);
        })), E5e = (t)=>{
        const e = new ps("OnStep");
        return e.effect_instruction_i0 = t, e;
    }, Vg = (t)=>Me(t, Ht), Jq = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>Ke(e.onFailure(n)),
            onSuccess: (n)=>Ke(e.onSuccess(n))
        })), Ii = j(2, (t, e)=>{
        const n = new ps(_2);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e.onFailure, n.effect_instruction_i2 = e.onSuccess, n;
    }), Lc = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>{
                if (qC(n).length > 0) return kr(u5e(n));
                const s = o5e(n);
                return s.length > 0 ? e.onFailure(TC(s)) : kr(n);
            },
            onSuccess: e.onSuccess
        })), Ml = j(2, (t, e)=>Rt(()=>{
            const n = Un(t), r = lv(n.length);
            let s = 0;
            return vs(tE({
                while: ()=>s < n.length,
                body: ()=>e(n[s], s),
                step: (i)=>{
                    r[s++] = i;
                }
            }), r);
        })), Rv = j(2, (t, e)=>Rt(()=>{
            const n = Un(t);
            let r = 0;
            return tE({
                while: ()=>r < n.length,
                body: ()=>e(n[r], r),
                step: ()=>{
                    r++;
                }
            });
        })), os = Me(a1, (t)=>Yq(t)), Yq = (t)=>kr(Go(t)), c1 = (t)=>{
        const e = new ps(wg);
        return e.effect_instruction_i0 = z9e(Fp), e.effect_instruction_i1 = ()=>t, e;
    }, JC = j(2, (t, e)=>Eo((n)=>Me(Oc(n(t)), (r)=>_8e(e, r)))), Pt = j(2, (t, e)=>Me(t, (n)=>$e(()=>e(n)))), YC = j(2, (t, e)=>Lc(t, {
            onFailure: (n)=>Rg(()=>e.onFailure(n)),
            onSuccess: (n)=>$e(()=>e.onSuccess(n))
        })), Nv = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>{
                const r = KC(n);
                switch(r._tag){
                    case "Left":
                        return Rg(()=>e(r.left));
                    case "Right":
                        return kr(r.right);
                }
            },
            onSuccess: Ke
        })), kd = j(2, (t, e)=>Eo((n)=>Ii(n(t), {
                onFailure: (r)=>{
                    const s = Jn(r);
                    return Ii(e(s), {
                        onFailure: (i)=>Jn(xs(r, i)),
                        onSuccess: ()=>s
                    });
                },
                onSuccess: (r)=>{
                    const s = Nr(r);
                    return Wr(e(s), s);
                }
            }))), zp = j(2, (t, e)=>kd(t, Hv({
            onFailure: (n)=>Av(n) ? Mi(e(WC(n))) : mn,
            onSuccess: ()=>mn
        }))), QC = j(2, (t, e)=>O5e(t, e, Ke)), eE = (t)=>I5e(t, Ht), I5e = j(2, (t, e)=>Lc(t, {
            onFailure: (n)=>Ol(e(n)),
            onSuccess: Ke
        })), A5e = fn((t, e)=>Ke(e.runtimeFlags)), Ke = (t)=>{
        const e = new $q(As);
        return e.effect_instruction_i0 = t, e;
    }, Rt = (t)=>{
        const e = new ps(iv);
        return e.commit = t, e;
    }, $e = (t)=>{
        const e = new ps(UH);
        return e.effect_instruction_i0 = t, e;
    }, $0 = j((t)=>t.length === 3 || t.length === 2 && !(qc(t[1]) && "onlyEffect" in t[1]), (t, e)=>Me(t, (n)=>{
            const r = typeof e == "function" ? e(n) : e;
            return Kc(r) ? vs(r, n) : MH(r) ? ey((s)=>{
                r.then((i)=>s(Ke(n)), (i)=>s(Tr(new zv(i, "An unknown error occurred in Effect.tap"))));
            }) : Ke(n);
        })), P5e = (t)=>fn((e)=>{
            const n = e.getFiberRef(V6), r = V(n, Pr(()=>e.scope()));
            return t(Dg(V6, ze(r)));
        }), O5e = j(3, (t, e, n)=>Ii(t, {
            onFailure: (r)=>qC(r).length > 0 ? kr(w_e(l5e(r))) : e(),
            onSuccess: n
        })), Up = (t)=>{
        const e = new ps(wg);
        return e.effect_instruction_i0 = Mq(Fp), e.effect_instruction_i1 = ()=>t, e;
    }, Eo = (t)=>Gq(t, function() {
            const e = new ps(wg);
            return e.effect_instruction_i0 = Mq(Fp), e.effect_instruction_i1 = (n)=>Pq(n) ? js(()=>this.effect_instruction_i0(c1)) : js(()=>this.effect_instruction_i0(Up)), e;
        }), mn = Ke(void 0), Qq = (t)=>{
        const e = new ps(wg);
        return e.effect_instruction_i0 = t, e.effect_instruction_i1 = void 0, e;
    }, l1 = j(2, (t, e)=>Me(e, (n)=>n ? V(t, Pt(ze)) : Ke(Fe()))), tE = (t)=>{
        const e = new ps(x2);
        return e.effect_instruction_i0 = t.while, e.effect_instruction_i1 = t.body, e.effect_instruction_i2 = t.step, e;
    }, R6 = (t)=>Rt(()=>{
            const e = new ps(mm);
            return e.effect_instruction_i0 = t(), e;
        }), eW = function() {
        const t = arguments.length === 1 ? arguments[0] : arguments[1].bind(arguments[0]);
        return R6(()=>t(V));
    }, M5e = (t, ...e)=>Object.defineProperty(e.length === 0 ? function(...n) {
            return R6(()=>t.apply(this, n));
        } : function(...n) {
            let r = R6(()=>t.apply(this, n));
            for (const s of e)r = s(r, ...n);
            return r;
        }, "length", {
            value: t.length,
            configurable: !0
        }), R5e = j(2, (t, e)=>{
        const n = new ps(wg);
        return n.effect_instruction_i0 = e, n.effect_instruction_i1 = ()=>t, n;
    }), Vv = (t)=>{
        const e = new ps(k_);
        return typeof t?.priority < "u" ? Z5e(e, t.priority) : e;
    }, Dv = j(2, (t, e)=>Me(t, (n)=>Pt(e, (r)=>[
                    n,
                    r
                ]))), Bv = j(2, (t, e)=>Me(t, (n)=>vs(e, n))), Wr = j(2, (t, e)=>Me(t, ()=>e)), tW = j(3, (t, e, n)=>Me(t, (r)=>Pt(e, (s)=>n(r, s)))), Fv = (t)=>Me(a1, (e)=>V(t, Rl(e))), Rl = j(2, (t, e)=>Me(t.interruptAsFork(e), ()=>t.await)), N5e = {
        _tag: "All",
        syslog: 0,
        label: "ALL",
        ordinal: Number.MIN_SAFE_INTEGER,
        pipe () {
            return St(this, arguments);
        }
    }, V5e = {
        _tag: "Fatal",
        syslog: 2,
        label: "FATAL",
        ordinal: 5e4,
        pipe () {
            return St(this, arguments);
        }
    }, D5e = {
        _tag: "Error",
        syslog: 3,
        label: "ERROR",
        ordinal: 4e4,
        pipe () {
            return St(this, arguments);
        }
    }, nW = {
        _tag: "Warning",
        syslog: 4,
        label: "WARN",
        ordinal: 3e4,
        pipe () {
            return St(this, arguments);
        }
    }, rW = {
        _tag: "Info",
        syslog: 6,
        label: "INFO",
        ordinal: 2e4,
        pipe () {
            return St(this, arguments);
        }
    }, sW = {
        _tag: "Debug",
        syslog: 7,
        label: "DEBUG",
        ordinal: 1e4,
        pipe () {
            return St(this, arguments);
        }
    }, B5e = {
        _tag: "Trace",
        syslog: 7,
        label: "TRACE",
        ordinal: 0,
        pipe () {
            return St(this, arguments);
        }
    }, F5e = {
        _tag: "None",
        syslog: 7,
        label: "OFF",
        ordinal: Number.MAX_SAFE_INTEGER,
        pipe () {
            return St(this, arguments);
        }
    }, L5e = "effect/FiberRef", z5e = Symbol.for(L5e), U5e = {
        _A: (t)=>t
    }, nE = (t)=>fn((e)=>Nr(e.getFiberRef(t))), u1 = j(2, (t, e)=>Me(nE(t), e)), CR = j(2, (t, e)=>H5e(t, ()=>[
                void 0,
                e
            ])), H5e = j(2, (t, e)=>fn((n)=>{
            const [r, s] = e(n.getFiberRef(t));
            return n.setFiberRef(t, s), Ke(r);
        })), Dg = j(3, (t, e, n)=>Xq(Bv(nE(e), CR(e, n)), ()=>t, (r)=>CR(e, r))), j5e = j(3, (t, e, n)=>u1(e, (r)=>Dg(t, e, n(r)))), Ss = (t, e)=>Bg(t, {
            differ: Cq(),
            fork: e?.fork ?? Ht,
            join: e?.join
        }), q5e = (t)=>{
        const e = k9e();
        return Bg(t, {
            differ: e,
            fork: e.empty
        });
    }, W5e = (t)=>{
        const e = T9e(Cq());
        return Bg(t, {
            differ: e,
            fork: e.empty
        });
    }, iW = (t)=>{
        const e = S9e();
        return Bg(t, {
            differ: e,
            fork: e.empty
        });
    }, Bg = (t, e)=>({
            ...$y,
            [z5e]: U5e,
            initial: t,
            commit () {
                return nE(this);
            },
            diff: (r, s)=>e.differ.diff(r, s),
            combine: (r, s)=>e.differ.combine(r, s),
            patch: (r)=>(s)=>e.differ.patch(r, s),
            fork: e.fork,
            join: e.join ?? ((r, s)=>s)
        }), K5e = (t)=>Bg(t, {
            differ: _R,
            fork: _R.empty
        }), ba = Xt(Symbol.for("effect/FiberRef/currentContext"), ()=>iW(Xm())), Fg = Xt(Symbol.for("effect/FiberRef/currentSchedulingPriority"), ()=>Ss(0)), oW = Xt(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"), ()=>Ss(2048)), $5e = Xt(Symbol.for("effect/FiberRef/currentLogAnnotation"), ()=>Ss(F0())), X5e = Xt(Symbol.for("effect/FiberRef/currentLogLevel"), ()=>Ss(rW)), G5e = Xt(Symbol.for("effect/FiberRef/currentLogSpan"), ()=>Ss(L0())), Z5e = j(2, (t, e)=>Dg(t, Fg, e)), J5e = Xt(Symbol.for("effect/FiberRef/currentConcurrency"), ()=>Ss("unbounded")), Y5e = Xt(Symbol.for("effect/FiberRef/currentRequestBatching"), ()=>Ss(!0)), Q5e = Xt(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"), ()=>Ss(ze(sW))), e8e = Xt(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"), ()=>Ss(ze(nW))), N6 = Xt(Symbol.for("effect/FiberRef/currentMetricLabels"), ()=>W5e(tu())), V6 = Xt(Symbol.for("effect/FiberRef/currentForkScopeOverride"), ()=>Ss(Fe(), {
            fork: ()=>Fe(),
            join: (t, e)=>t
        })), Lw = Xt(Symbol.for("effect/FiberRef/currentInterruptedCause"), ()=>Ss(su, {
            fork: ()=>su,
            join: (t, e)=>t
        })), aW = Xt(Symbol.for("effect/FiberRef/currentTracerEnabled"), ()=>Ss(!0)), cW = Xt(Symbol.for("effect/FiberRef/currentTracerTiming"), ()=>Ss(!0)), t8e = Xt(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"), ()=>Ss(F0())), n8e = Xt(Symbol.for("effect/FiberRef/currentTracerSpanLinks"), ()=>Ss(En())), ER = Symbol.for("effect/Scope"), IR = Symbol.for("effect/CloseableScope"), lW = (t, e)=>t.addFinalizer(()=>Mi(e)), V2 = (t, e)=>t.addFinalizer(e), X0 = (t, e)=>t.close(e), Cl = (t, e)=>t.fork(e), r8e = (t)=>s8e(Ht)(t), s8e = j(2, (t, e)=>{
        const n = V(t, zq, Ac(e));
        switch(n._tag){
            case "None":
                return V(qC(t), wv, dn({
                    onNone: ()=>{
                        const r = Un(WC(t)).flatMap((s)=>Un(m3e(s)).map((i)=>`#${i}`));
                        return new o8e(r ? `Interrupted by fibers: ${r.join(", ")}` : void 0);
                    },
                    onSome: Ht
                }));
            case "Some":
                return n.value;
        }
    }), rE = (function() {
        class t extends globalThis.Error {
            commit() {
                return Tr(this);
            }
            toJSON() {
                const n = {
                    ...this
                };
                return this.message && (n.message = this.message), this.cause && (n.cause = this.cause), n;
            }
            [Bn]() {
                return this.toString !== globalThis.Error.prototype.toString ? this.stack ? `${this.toString()}
${this.stack.split(`
`).slice(1).join(`
`)}` : this.toString() : "Bun" in globalThis ? Mg(Sd(this), {
                    renderErrorCause: !0
                }) : this;
            }
        }
        return Object.assign(t.prototype, Jwe), t;
    })(), Lg = (t, e)=>{
        class n extends rE {
            _tag = e;
        }
        return Object.assign(n.prototype, t), n.prototype.name = e, n;
    }, AR = Symbol.for("effect/Cause/errors/RuntimeException"), i8e = Lg({
        [AR]: AR
    }, "RuntimeException"), D6 = Symbol.for("effect/Cause/errors/InterruptedException"), o8e = Lg({
        [D6]: D6
    }, "InterruptedException"), a8e = (t)=>Ft(t, D6), PR = Symbol.for("effect/Cause/errors/IllegalArgument"), c8e = Lg({
        [PR]: PR
    }, "IllegalArgumentException"), OR = Symbol.for("effect/Cause/errors/NoSuchElement"), Lv = Lg({
        [OR]: OR
    }, "NoSuchElementException"), MR = Symbol.for("effect/Cause/errors/InvalidPubSubCapacityException"), l8e = Lg({
        [MR]: MR
    }, "InvalidPubSubCapacityException"), RR = Symbol.for("effect/Cause/errors/Timeout"), u8e = Lg({
        [RR]: RR
    }, "TimeoutException"), d8e = (t)=>new u8e(`Operation timed out after '${rq(t)}'`), NR = Symbol.for("effect/Cause/errors/UnknownException"), zv = (function() {
        class t extends rE {
            _tag = "UnknownException";
            error;
            constructor(n, r){
                super(r ?? "An unknown error occurred", {
                    cause: n
                }), this.error = n;
            }
        }
        return Object.assign(t.prototype, {
            [NR]: NR,
            name: "UnknownException"
        }), t;
    })(), Uv = (t)=>Kc(t) && "_tag" in t && (t._tag === "Success" || t._tag === "Failure"), uW = (t)=>t._tag === "Failure", f8e = (t)=>t._tag === "Success", p8e = j(2, (t, e)=>{
        switch(t._tag){
            case Is:
                return Jn(t.effect_instruction_i0);
            case As:
                return Nr(e);
        }
    }), M8 = (t)=>p8e(t, void 0), Xh = (t, e)=>m8e(t, e?.parallel ? iu : xs), dW = (t)=>Jn(Ti(t)), B6 = (t)=>Jn(Sd(t)), Jn = (t)=>{
        const e = new Kq(Is);
        return e.effect_instruction_i0 = t, e;
    }, fW = (t)=>Jn(Go(t)), I_ = j(2, (t, e)=>{
        switch(t._tag){
            case Is:
                return Jn(t.effect_instruction_i0);
            case As:
                return Nr(e(t.effect_instruction_i0));
        }
    }), h8e = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Is:
                return Jn(V(t.effect_instruction_i0, Uq(e)));
            case As:
                return Nr(n(t.effect_instruction_i0));
        }
    }), Hv = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Is:
                return e(t.effect_instruction_i0);
            case As:
                return n(t.effect_instruction_i0);
        }
    }), F6 = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Is:
                return e(t.effect_instruction_i0);
            case As:
                return n(t.effect_instruction_i0);
        }
    }), Nr = (t)=>{
        const e = new $q(As);
        return e.effect_instruction_i0 = t, e;
    }, ei = Nr(void 0), g8e = j(2, (t, e)=>sE(t, e, {
            onSuccess: (n, r)=>[
                    n,
                    r
                ],
            onFailure: xs
        })), b8e = j(2, (t, e)=>sE(t, e, {
            onSuccess: (n, r)=>r,
            onFailure: xs
        })), sE = j(3, (t, e, { onFailure: n, onSuccess: r })=>{
        switch(t._tag){
            case Is:
                switch(e._tag){
                    case As:
                        return Jn(t.effect_instruction_i0);
                    case Is:
                        return Jn(n(t.effect_instruction_i0, e.effect_instruction_i0));
                }
            case As:
                switch(e._tag){
                    case As:
                        return Nr(r(t.effect_instruction_i0, e.effect_instruction_i0));
                    case Is:
                        return Jn(e.effect_instruction_i0);
                }
        }
    }), m8e = (t, e)=>{
        const n = Co(t);
        return ca(n) ? V(Pl(n), nu(V(Cc(n), I_(Mn)), (r, s)=>V(r, sE(s, {
                onSuccess: (i, o)=>V(i, Rs(o)),
                onFailure: e
            }))), I_(ru), I_((r)=>_o(r)), ze) : Fe();
    }, zg = (t)=>({
            ...$y,
            [_5e]: x5e,
            state: Dp(v5e([])),
            commit () {
                return la(this);
            },
            blockingOn: t
        }), Ug = ()=>Me(a1, (t)=>y8e(t)), y8e = (t)=>$e(()=>zg(t)), la = (t)=>XC((e)=>{
            const n = Tn(t.state);
            switch(n._tag){
                case Ov:
                    return e(n.effect);
                case i1:
                    return n.joiners.push(e), v8e(t, e);
            }
        }, t.blockingOn), w8e = j(2, (t, e)=>JC(e, t)), jv = j(2, (t, e)=>$e(()=>{
            const n = Tn(t.state);
            switch(n._tag){
                case Ov:
                    return !1;
                case i1:
                    {
                        Bp(t.state, qq(e));
                        for(let r = 0, s = n.joiners.length; r < s; r++)n.joiners[r](e);
                        return !0;
                    }
            }
        })), _8e = j(2, (t, e)=>jv(t, e)), pW = j(2, (t, e)=>jv(t, kr(e))), qv = j(2, (t, e)=>jv(t, Yq(e))), x8e = (t)=>$e(()=>Tn(t.state)._tag === Ov), d1 = j(2, (t, e)=>jv(t, Ke(e))), Wv = (t, e)=>{
        const n = Tn(t.state);
        if (n._tag === i1) {
            Bp(t.state, qq(e));
            for(let r = 0, s = n.joiners.length; r < s; r++)n.joiners[r](e);
        }
    }, v8e = (t, e)=>$e(()=>{
            const n = Tn(t.state);
            if (n._tag === i1) {
                const r = n.joiners.indexOf(e);
                r >= 0 && n.joiners.splice(r, 1);
            }
        }), S8e = fn((t)=>Nr(t.currentContext)), Kv = ()=>S8e, Hp = (t)=>Me(Kv(), t), $v = j(2, (t, e)=>Dg(ba, e)(t)), iE = j(2, (t, e)=>j5e(ba, (n)=>Tg(n, e))(t)), hW = j(2, (t, e)=>Hp((n)=>$v(t, e(n)))), oE = (t)=>{
        const e = t.currentSpan;
        return e !== void 0 && e._tag === "Span" ? ze(e) : Fe();
    }, k8e = {
        _tag: "Span",
        spanId: "noop",
        traceId: "noop",
        sampled: !1,
        status: {
            _tag: "Ended",
            startTime: BigInt(0),
            endTime: BigInt(0),
            exit: ei
        },
        attributes: new Map,
        links: [],
        kind: "internal",
        attribute () {},
        event () {},
        end () {},
        addLinks () {}
    }, T8e = (t)=>Object.assign(Object.create(k8e), t), ti = Ug, Vr = la, C8e = w8e, gW = pW, L6 = x8e, ta = d1, aE = uW, z6 = f8e, E8e = Xh, I8e = dW, bW = B6, na = Jn, A8e = I_, P8e = h8e, Ec = Hv, po = Nr, Xv = ei, VR = g8e, ty = b8e, DR = Symbol.for("effect/MutableHashMap"), O8e = {
        [DR]: DR,
        [Symbol.iterator] () {
            return new cE(this);
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableHashMap",
                values: Array.from(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    };
    class cE {
        self;
        referentialIterator;
        bucketIterator;
        constructor(e){
            this.self = e, this.referentialIterator = e.referential[Symbol.iterator]();
        }
        next() {
            if (this.bucketIterator !== void 0) return this.bucketIterator.next();
            const e = this.referentialIterator.next();
            return e.done ? (this.bucketIterator = new M8e(this.self.buckets.values()), this.next()) : e;
        }
        [Symbol.iterator]() {
            return new cE(this.self);
        }
    }
    class M8e {
        backing;
        constructor(e){
            this.backing = e;
        }
        currentBucket;
        next() {
            if (this.currentBucket === void 0) {
                const n = this.backing.next();
                if (n.done) return n;
                this.currentBucket = n.value[Symbol.iterator]();
            }
            const e = this.currentBucket.next();
            return e.done ? (this.currentBucket = void 0, this.next()) : e;
        }
    }
    const R8e = ()=>{
        const t = Object.create(O8e);
        return t.referential = new Map, t.buckets = new Map, t.bucketsSize = 0, t;
    }, mf = j(2, (t, e)=>{
        if (Wm(e) === !1) return t.referential.has(e) ? ze(t.referential.get(e)) : Fe();
        const n = e[Jt](), r = t.buckets.get(n);
        return r === void 0 ? Fe() : N8e(t, r, e);
    }), N8e = (t, e, n, r = !1)=>{
        for(let s = 0, i = e.length; s < i; s++)if (n[$t](e[s][0])) {
            const o = e[s][1];
            return r && (e.splice(s, 1), t.bucketsSize--), ze(o);
        }
        return Fe();
    }, xb = j(2, (t, e)=>gr(mf(t, e))), vb = j(3, (t, e, n)=>{
        if (Wm(e) === !1) return t.referential.set(e, n), t;
        const r = e[Jt](), s = t.buckets.get(r);
        return s === void 0 ? (t.buckets.set(r, [
            [
                e,
                n
            ]
        ]), t.bucketsSize++, t) : (V8e(t, s, e), s.push([
            e,
            n
        ]), t.bucketsSize++, t);
    }), V8e = (t, e, n)=>{
        for(let r = 0, s = e.length; r < s; r++)if (n[$t](e[r][0])) {
            e.splice(r, 1), t.bucketsSize--;
            return;
        }
    }, BR = Symbol.for("effect/MutableList"), D8e = {
        [BR]: BR,
        [Symbol.iterator] () {
            let t = !1, e = this.head;
            return {
                next () {
                    if (t) return this.return();
                    if (e == null) return t = !0, this.return();
                    const n = e.value;
                    return e = e.next, {
                        done: t,
                        value: n
                    };
                },
                return (n) {
                    return t || (t = !0), {
                        done: !0,
                        value: n
                    };
                }
            };
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableList",
                values: Array.from(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, B8e = (t)=>({
            value: t,
            removed: !1,
            prev: void 0,
            next: void 0
        }), F8e = ()=>{
        const t = Object.create(D8e);
        return t.head = void 0, t.tail = void 0, t._length = 0, t;
    }, mW = (t)=>lE(t) === 0, lE = (t)=>t._length, L8e = j(2, (t, e)=>{
        const n = B8e(e);
        return t.head === void 0 && (t.head = n), t.tail === void 0 || (t.tail.next = n, n.prev = t.tail), t.tail = n, t._length += 1, t;
    }), z8e = (t)=>{
        const e = t.head;
        if (e !== void 0) return U8e(t, e), e.value;
    }, U8e = (t, e)=>{
        e.removed || (e.removed = !0, e.prev !== void 0 && e.next !== void 0 ? (e.prev.next = e.next, e.next.prev = e.prev) : e.prev !== void 0 ? (t.tail = e.prev, e.prev.next = void 0) : e.next !== void 0 ? (t.head = e.next, e.next.prev = void 0) : (t.tail = void 0, t.head = void 0), t._length > 0 && (t._length -= 1));
    }, FR = Symbol.for("effect/MutableQueue"), Er = Symbol.for("effect/mutable/MutableQueue/Empty"), H8e = {
        [FR]: FR,
        [Symbol.iterator] () {
            return Array.from(this.queue)[Symbol.iterator]();
        },
        toString () {
            return Mr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableQueue",
                values: Array.from(this).map(Ir)
            };
        },
        [Bn] () {
            return this.toJSON();
        },
        pipe () {
            return St(this, arguments);
        }
    }, yW = (t)=>{
        const e = Object.create(H8e);
        return e.queue = F8e(), e.capacity = t, e;
    }, uE = (t)=>yW(t), f1 = ()=>yW(void 0), dE = (t)=>lE(t.queue), Hf = (t)=>mW(t.queue), j8e = (t)=>t.capacity === void 0 ? 1 / 0 : t.capacity, Td = j(2, (t, e)=>{
        const n = lE(t.queue);
        return t.capacity !== void 0 && n === t.capacity ? !1 : (L8e(e)(t.queue), !0);
    }), fE = j(2, (t, e)=>{
        const n = e[Symbol.iterator]();
        let r, s = En(), i = !0;
        for(; i && (r = n.next()) && !r.done;)i = Td(r.value)(t);
        for(; r != null && !r.done;)s = Rs(r.value)(s), r = n.next();
        return ru(s);
    }), Mc = j(2, (t, e)=>mW(t.queue) ? e : z8e(t.queue)), Gv = j(2, (t, e)=>{
        let n = En(), r = 0;
        for(; r < e;){
            const s = Mc(Er)(t);
            if (s === Er) break;
            n = Rs(s)(n), r += 1;
        }
        return ru(n);
    }), q8e = "effect/Clock", LR = Symbol.for(q8e), Hg = Wc("effect/Clock"), W8e = 2 ** 31 - 1, zR = {
        unsafeSchedule (t, e) {
            const n = ki(e);
            if (n > W8e) return qm;
            let r = !1;
            const s = setTimeout(()=>{
                r = !0, t();
            }, n);
            return ()=>(clearTimeout(s), !r);
        }
    }, UR = (function() {
        const t = BigInt(1e6);
        if (typeof performance > "u" || typeof performance.now != "function") return ()=>BigInt(Date.now()) * t;
        let e;
        return ()=>(e === void 0 && (e = BigInt(Date.now()) * t - BigInt(Math.round(performance.now() * 1e6))), e + BigInt(Math.round(performance.now() * 1e6)));
    })(), K8e = (function() {
        const t = typeof process == "object" && "hrtime" in process && typeof process.hrtime.bigint == "function" ? process.hrtime : void 0;
        if (!t) return UR;
        const e = UR() - t.bigint();
        return ()=>e + t.bigint();
    })();
    class $8e {
        [LR] = LR;
        unsafeCurrentTimeMillis() {
            return Date.now();
        }
        unsafeCurrentTimeNanos() {
            return K8e();
        }
        currentTimeMillis = $e(()=>this.unsafeCurrentTimeMillis());
        currentTimeNanos = $e(()=>this.unsafeCurrentTimeNanos());
        scheduler() {
            return Ke(zR);
        }
        sleep(e) {
            return za((n)=>{
                const r = zR.unsafeSchedule(()=>n(mn), e);
                return Mi($e(r));
            });
        }
    }
    const X8e = ()=>new $8e, wW = "And", _W = "Or", xW = "InvalidData", vW = "MissingData", SW = "SourceUnavailable", kW = "Unsupported", G8e = "effect/ConfigError", HR = Symbol.for(G8e), jg = {
        _tag: "ConfigError",
        [HR]: HR
    }, TW = (t, e)=>{
        const n = Object.create(jg);
        return n._op = wW, n.left = t, n.right = e, Object.defineProperty(n, "toString", {
            enumerable: !1,
            value () {
                return `${this.left} and ${this.right}`;
            }
        }), Object.defineProperty(n, "message", {
            enumerable: !1,
            get () {
                return this.toString();
            }
        }), n;
    }, CW = (t, e)=>{
        const n = Object.create(jg);
        return n._op = _W, n.left = t, n.right = e, Object.defineProperty(n, "toString", {
            enumerable: !1,
            value () {
                return `${this.left} or ${this.right}`;
            }
        }), Object.defineProperty(n, "message", {
            enumerable: !1,
            get () {
                return this.toString();
            }
        }), n;
    }, Z8e = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(jg);
        return r._op = xW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Invalid data at ${V(this.path, Sg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, gp = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(jg);
        return r._op = vW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Missing data at ${V(this.path, Sg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, J8e = (t, e, n, r = {
        pathDelim: "."
    })=>{
        const s = Object.create(jg);
        return s._op = SW, s.path = t, s.message = e, s.cause = n, Object.defineProperty(s, "toString", {
            enumerable: !1,
            value () {
                return `(Source unavailable at ${V(this.path, Sg(r.pathDelim))}: "${this.message}")`;
            }
        }), s;
    }, Y8e = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(jg);
        return r._op = kW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Unsupported operation at ${V(this.path, Sg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, Of = j(2, (t, e)=>{
        switch(t._op){
            case wW:
                return TW(Of(t.left, e), Of(t.right, e));
            case _W:
                return CW(Of(t.left, e), Of(t.right, e));
            case xW:
                return Z8e([
                    ...e,
                    ...t.path
                ], t.message);
            case vW:
                return gp([
                    ...e,
                    ...t.path
                ], t.message);
            case SW:
                return J8e([
                    ...e,
                    ...t.path
                ], t.message, t.cause);
            case kW:
                return Y8e([
                    ...e,
                    ...t.path
                ], t.message);
        }
    }), Q8e = {
        _tag: "Empty"
    }, R8 = j(2, (t, e)=>{
        let n = zC(e), r = t;
        for(; A3e(n);){
            const s = n.head;
            switch(s._tag){
                case "Empty":
                    {
                        n = n.tail;
                        break;
                    }
                case "AndThen":
                    {
                        n = pp(s.first, pp(s.second, n.tail));
                        break;
                    }
                case "MapName":
                    {
                        r = Ps(r, s.f), n = n.tail;
                        break;
                    }
                case "Nested":
                    {
                        r = S2(r, s.name), n = n.tail;
                        break;
                    }
                case "Unnested":
                    {
                        if (V(wm(r), S_e(s.name))) r = ap(r), n = n.tail;
                        else return st(gp(r, `Expected ${s.name} to be in path in ConfigProvider#unnested`));
                        break;
                    }
            }
        }
        return mt(r);
    }), eSe = "Constant", tSe = "Fail", nSe = "Fallback", rSe = "Described", sSe = "Lazy", iSe = "MapOrFail", oSe = "Nested", aSe = "Primitive", cSe = "Sequence", lSe = "HashMap", uSe = "ZipWith";
    var jR = {};
    const D2 = (t, e)=>[
            ...t,
            ...e
        ], dSe = "effect/ConfigProvider", qR = Symbol.for(dSe), fSe = Wc("effect/ConfigProvider"), pSe = "effect/ConfigProviderFlat", WR = Symbol.for(pSe), hSe = (t)=>({
            [qR]: qR,
            pipe () {
                return St(this, arguments);
            },
            ...t
        }), gSe = (t)=>({
            [WR]: WR,
            patch: t.patch,
            load: (e, n, r = !0)=>t.load(e, n, r),
            enumerateChildren: t.enumerateChildren
        }), bSe = (t)=>hSe({
            load: (e)=>Me(Uo(t, tu(), e, !1), (n)=>dn(wm(n), {
                        onNone: ()=>Tr(gp(tu(), `Expected a single value having structure: ${e}`)),
                        onSome: Ke
                    })),
            flattened: t
        }), mSe = (t)=>{
        const { pathDelim: e, seqDelim: n } = Object.assign({}, {
            pathDelim: "_",
            seqDelim: ","
        }, t), r = (c)=>V(c, Sg(e)), s = (c)=>c.split(e), i = ()=>typeof process < "u" && "env" in process && typeof jR == "object" ? jR : {};
        return bSe(gSe({
            load: (c, l, u = !0)=>{
                const d = r(c), f = i(), p = d in f ? ze(f[d]) : Fe();
                return V(p, Nv(()=>gp(c, `Expected ${d} to exist in the process context`)), Me((h)=>vSe(h, c, l, n, u)));
            },
            enumerateChildren: (c)=>$e(()=>{
                    const l = i(), f = Object.keys(l).map((p)=>s(p.toUpperCase())).filter((p)=>{
                        for(let h = 0; h < c.length; h++){
                            const m = V(c, rj(h)), w = p[h];
                            if (w === void 0 || m !== w) return !1;
                        }
                        return !0;
                    }).flatMap((p)=>p.slice(c.length, c.length + 1));
                    return Jb(f);
                }),
            patch: Q8e
        }));
    }, ySe = (t, e, n, r)=>{
        const s = JM(n.length, (c)=>c >= r.length ? Fe() : ze([
                t(c),
                c + 1
            ])), i = JM(r.length, (c)=>c >= n.length ? Fe() : ze([
                e(c),
                c + 1
            ])), o = D2(n, s), a = D2(r, i);
        return [
            o,
            a
        ];
    }, wSe = (t, e)=>{
        let n = e;
        if (n._tag === "Nested") {
            const r = t.slice();
            for(; n._tag === "Nested";)r.push(n.name), n = n.config;
            return r;
        }
        return t;
    }, Uo = (t, e, n, r)=>{
        const s = n;
        switch(s._tag){
            case eSe:
                return Ke(qo(s.value));
            case rSe:
                return Rt(()=>Uo(t, e, s.config, r));
            case tSe:
                return Tr(gp(e, s.message));
            case nSe:
                return V(Rt(()=>Uo(t, e, s.first, r)), W0((i)=>s.condition(i) ? V(Uo(t, e, s.second, r), W0((o)=>Tr(CW(i, o)))) : Tr(i)));
            case sSe:
                return Rt(()=>Uo(t, e, s.config(), r));
            case iSe:
                return Rt(()=>V(Uo(t, e, s.original, r), Me(Ml((i)=>V(s.mapOrFail(i), Nv(Of(wSe(e, s.original))))))));
            case oSe:
                return Rt(()=>Uo(t, D2(e, qo(s.name)), s.config, r));
            case aSe:
                return V(R8(e, t.patch), Me((i)=>V(t.load(i, s, r), Me((o)=>{
                        if (o.length === 0) {
                            const a = V(j_e(i), Pr(()=>"<n/a>"));
                            return Tr(gp([], `Expected ${s.description} with name ${a}`));
                        }
                        return Ke(o);
                    }))));
            case cSe:
                return V(R8(e, t.patch), Me((i)=>V(t.enumerateChildren(i), Me(kSe), Me((o)=>o.length === 0 ? Rt(()=>Pt(Uo(t, e, s.config, !0), qo)) : V(Ml(o, (a)=>Uo(t, $m(e, `[${a}]`), s.config, !0)), Pt((a)=>{
                            const c = Q_e(a);
                            return c.length === 0 ? qo(tu()) : qo(c);
                        }))))));
            case lSe:
                return Rt(()=>V(R8(e, t.patch), Me((i)=>V(t.enumerateChildren(i), Me((o)=>V(o, Ml((a)=>Uo(t, D2(i, qo(a)), s.valueConfig, r)), Pt((a)=>a.length === 0 ? qo(F0()) : V(SSe(a), Ps((c)=>Yb(ZM(Un(o), c)))))))))));
            case uSe:
                return Rt(()=>V(Uo(t, e, s.left, r), K0, Me((i)=>V(Uo(t, e, s.right, r), K0, Me((o)=>{
                            if (pr(i) && pr(o)) return Tr(TW(i.left, o.left));
                            if (pr(i) && Ma(o)) return Tr(i.left);
                            if (Ma(i) && pr(o)) return Tr(o.left);
                            if (Ma(i) && Ma(o)) {
                                const a = V(e, Sg(".")), c = _Se(e, a), [l, u] = ySe(c, c, V(i.right, Ps(mt)), V(o.right, Ps(mt)));
                                return V(l, ZM(u), Ml(([d, f])=>V(Dv(d, f), Pt(([p, h])=>s.zip(p, h)))));
                            }
                            throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues");
                        })))));
        }
    }, _Se = (t, e)=>(n)=>st(gp(t, `The element at index ${n} in a sequence at path "${e}" was missing`)), xSe = (t, e)=>t.split(new RegExp(`\\s*${k2(e)}\\s*`)), vSe = (t, e, n, r, s)=>s ? V(xSe(t, r), Ml((i)=>n.parse(i.trim())), Nv(Of(e))) : V(n.parse(t), YC({
            onFailure: Of(e),
            onSuccess: qo
        })), SSe = (t)=>Object.keys(t[0]).map((e)=>t.map((n)=>n[e])), kSe = (t)=>V(Ml(t, CSe), YC({
            onFailure: ()=>tu(),
            onSuccess: P0(O0)
        }), K0, Pt(c_e)), TSe = /^(\[(\d+)\])$/, CSe = (t)=>{
        const e = t.match(TSe);
        if (e !== null) {
            const n = e[2];
            return V(n !== void 0 && n.length > 0 ? ze(n) : Fe(), xg(ESe));
        }
        return Fe();
    }, ESe = (t)=>{
        const e = Number.parseInt(t);
        return Number.isNaN(e) ? Fe() : ze(e);
    }, KR = Symbol.for("effect/Console"), pE = Wc("effect/Console"), ISe = {
        [KR]: KR,
        assert (t, ...e) {
            return $e(()=>{
                console.assert(t, ...e);
            });
        },
        clear: $e(()=>{
            console.clear();
        }),
        count (t) {
            return $e(()=>{
                console.count(t);
            });
        },
        countReset (t) {
            return $e(()=>{
                console.countReset(t);
            });
        },
        debug (...t) {
            return $e(()=>{
                console.debug(...t);
            });
        },
        dir (t, e) {
            return $e(()=>{
                console.dir(t, e);
            });
        },
        dirxml (...t) {
            return $e(()=>{
                console.dirxml(...t);
            });
        },
        error (...t) {
            return $e(()=>{
                console.error(...t);
            });
        },
        group (t) {
            return t?.collapsed ? $e(()=>console.groupCollapsed(t?.label)) : $e(()=>console.group(t?.label));
        },
        groupEnd: $e(()=>{
            console.groupEnd();
        }),
        info (...t) {
            return $e(()=>{
                console.info(...t);
            });
        },
        log (...t) {
            return $e(()=>{
                [
                    ...t
                ];
            });
        },
        table (t, e) {
            return $e(()=>{
                console.table(t, e);
            });
        },
        time (t) {
            return $e(()=>console.time(t));
        },
        timeEnd (t) {
            return $e(()=>console.timeEnd(t));
        },
        timeLog (t, ...e) {
            return $e(()=>{
                console.timeLog(t, ...e);
            });
        },
        trace (...t) {
            return $e(()=>{
                console.trace(...t);
            });
        },
        warn (...t) {
            return $e(()=>{
                console.warn(...t);
            });
        },
        unsafe: console
    }, ASe = "effect/Random", $R = Symbol.for(ASe), EW = Wc("effect/Random");
    class PSe {
        seed;
        [$R] = $R;
        PRNG;
        constructor(e){
            this.seed = e, this.PRNG = new Nwe(e);
        }
        get next() {
            return $e(()=>this.PRNG.number());
        }
        get nextBoolean() {
            return Pt(this.next, (e)=>e > .5);
        }
        get nextInt() {
            return $e(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER));
        }
        nextRange(e, n) {
            return Pt(this.next, (r)=>(n - e) * r + e);
        }
        nextIntBetween(e, n) {
            return $e(()=>this.PRNG.integer(n - e) + e);
        }
        shuffle(e) {
            return OSe(e, (n)=>this.nextIntBetween(0, n));
        }
    }
    const OSe = (t, e)=>Rt(()=>V($e(()=>Array.from(t)), Me((n)=>{
                const r = [];
                for(let s = n.length; s >= 2; s = s - 1)r.push(s);
                return V(r, Rv((s)=>V(e(s), Pt((i)=>MSe(n, s - 1, i)))), vs(Co(n)));
            }))), MSe = (t, e, n)=>{
        const r = t[e];
        return t[e] = t[n], t[n] = r, t;
    }, RSe = (t)=>new PSe(At(t)), XR = Symbol.for("effect/Tracer"), NSe = (t)=>({
            [XR]: XR,
            ...t
        }), hE = Wc("effect/Tracer"), Zv = Wc("effect/ParentSpan"), GR = (function() {
        const t = "abcdef0123456789", e = t.length;
        return function(n) {
            let r = "";
            for(let s = 0; s < n; s++)r += t.charAt(Math.floor(Math.random() * e));
            return r;
        };
    })();
    class VSe {
        name;
        parent;
        context;
        startTime;
        kind;
        _tag = "Span";
        spanId;
        traceId = "native";
        sampled = !0;
        status;
        attributes;
        events = [];
        links;
        constructor(e, n, r, s, i, o){
            this.name = e, this.parent = n, this.context = r, this.startTime = i, this.kind = o, this.status = {
                _tag: "Started",
                startTime: i
            }, this.attributes = new Map, this.traceId = n._tag === "Some" ? n.value.traceId : GR(32), this.spanId = GR(16), this.links = Array.from(s);
        }
        end(e, n) {
            this.status = {
                _tag: "Ended",
                endTime: e,
                exit: n,
                startTime: this.status.startTime
            };
        }
        attribute(e, n) {
            this.attributes.set(e, n);
        }
        event(e, n, r) {
            this.events.push([
                e,
                n,
                r ?? {}
            ]);
        }
        addLinks(e) {
            this.links.push(...e);
        }
    }
    const DSe = NSe({
        span: (t, e, n, r, s, i)=>new VSe(t, e, n, r, s, i),
        context: (t)=>t()
    }), BSe = (t)=>{
        if (t?.captureStackTrace === !1) return t;
        if (t?.captureStackTrace !== void 0 && typeof t.captureStackTrace != "boolean") return t;
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 3;
        const n = new Error;
        Error.stackTraceLimit = e;
        let r = !1;
        return {
            ...t,
            captureStackTrace: ()=>{
                if (r !== !1) return r;
                if (n.stack !== void 0) {
                    const s = n.stack.split(`
`);
                    if (s[3] !== void 0) return r = s[3].trim(), r;
                }
            }
        };
    }, U6 = Cg()("effect/Tracer/DisablePropagation", {
        defaultValue: qm
    }), IW = V(Xm(), kc(Hg, X8e()), kc(pE, ISe), kc(EW, RSe(Math.random())), kc(fSe, mSe()), kc(hE, DSe)), bp = Xt(Symbol.for("effect/DefaultServices/currentServices"), ()=>iW(IW)), FSe = (t)=>{
        const e = Ei(t);
        return PW((n)=>n.sleep(e));
    }, AW = (t)=>fn((e)=>t(e.currentDefaultServices)), PW = (t)=>AW((e)=>t(e.unsafeMap.get(Hg.key))), LSe = PW((t)=>t.currentTimeMillis), zSe = (t)=>AW((e)=>t(e.unsafeMap.get(EW.key))), USe = zSe((t)=>t.next), HSe = FSe, OW = LSe, jSe = Hg;
    function qSe(t) {
        return new Cd(t);
    }
    function WSe() {
        return qSe(new Map);
    }
    const ZR = Symbol.for("effect/FiberRefs");
    class Cd {
        locals;
        [ZR] = ZR;
        constructor(e){
            this.locals = e;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const KSe = (t, e, n, r = !1)=>{
        const s = t;
        let i = e, o = n, a = r, c;
        for(; c === void 0;)if (Fr(i) && Fr(o)) {
            const l = Si(i)[0], u = ap(i), d = Si(o)[0], f = Si(o)[1], p = ap(o);
            l.startTimeMillis < d.startTimeMillis ? (o = p, a = !0) : l.startTimeMillis > d.startTimeMillis ? i = u : l.id < d.id ? (o = p, a = !0) : l.id > d.id ? i = u : c = [
                f,
                a
            ];
        } else c = [
            s.initial,
            !0
        ];
        return c;
    }, $Se = j(3, (t, e, n)=>{
        const r = new Map(t.locals);
        return n.locals.forEach((s, i)=>{
            const o = s[0][1];
            if (!s[0][0][$t](e)) {
                if (!r.has(i)) {
                    if (jt(o, i.initial)) return;
                    r.set(i, [
                        [
                            e,
                            i.join(i.initial, o)
                        ]
                    ]);
                    return;
                }
                const a = r.get(i), [c, l] = KSe(i, a, s);
                if (l) {
                    const u = i.diff(c, o), d = a[0][1], f = i.join(d, i.patch(u)(d));
                    if (!jt(d, f)) {
                        let p;
                        const h = a[0][0];
                        h[$t](e) ? p = [
                            [
                                h,
                                f
                            ],
                            ...a.slice(1)
                        ] : p = [
                            [
                                e,
                                f
                            ],
                            ...a
                        ], r.set(i, p);
                    }
                }
            }
        }), new Cd(r);
    }), XSe = j(2, (t, e)=>{
        const n = new Map;
        return MW(t, n, e), new Cd(n);
    }), MW = (t, e, n)=>{
        t.locals.forEach((r, s)=>{
            const i = r[0][1], o = s.patch(s.fork)(i);
            jt(i, o) ? e.set(s, r) : e.set(s, [
                [
                    n,
                    o
                ],
                ...r
            ]);
        });
    }, RW = j(2, (t, e)=>{
        const n = new Map(t.locals);
        return n.delete(e), new Cd(n);
    }), NW = j(2, (t, e)=>t.locals.has(e) ? ze(Si(t.locals.get(e))[1]) : Fe()), ny = j(2, (t, e)=>V(NW(t, e), Pr(()=>e.initial))), H6 = j(2, (t, { fiberId: e, fiberRef: n, value: r })=>{
        if (t.locals.size === 0) return new Cd(new Map([
            [
                n,
                [
                    [
                        e,
                        r
                    ]
                ]
            ]
        ]));
        const s = new Map(t.locals);
        return j6(s, e, n, r), new Cd(s);
    }), j6 = (t, e, n, r)=>{
        const s = t.get(n) ?? [];
        let i;
        if (Fr(s)) {
            const [o, a] = Si(s);
            if (o[$t](e)) {
                if (jt(a, r)) return;
                i = [
                    [
                        e,
                        r
                    ],
                    ...s.slice(1)
                ];
            } else i = [
                [
                    e,
                    r
                ],
                ...s
            ];
        } else i = [
            [
                e,
                r
            ]
        ];
        t.set(n, i);
    }, GSe = j(2, (t, { entries: e, forkAs: n })=>{
        if (t.locals.size === 0) return new Cd(new Map(e));
        const r = new Map(t.locals);
        return n !== void 0 && MW(t, r, n), e.forEach(([s, i])=>{
            i.length === 1 ? j6(r, i[0][0], s, i[0][1]) : i.forEach(([o, a])=>{
                j6(r, o, s, a);
            });
        }), new Cd(r);
    }), JR = NW, VW = ny, ZSe = GSe, JSe = WSe, YSe = N5e, QSe = V5e, e4e = D5e, DW = nW, t4e = rW, BW = sW, n4e = B5e, r4e = F5e, s4e = V(O0, ip((t)=>t.ordinal)), i4e = h_e(s4e), o4e = (t)=>{
        switch(t){
            case "All":
                return YSe;
            case "Debug":
                return BW;
            case "Error":
                return e4e;
            case "Fatal":
                return QSe;
            case "Info":
                return t4e;
            case "Trace":
                return n4e;
            case "None":
                return r4e;
            case "Warning":
                return DW;
        }
    }, FW = (t)=>t.replace(/[\s="]/g, "_"), a4e = (t)=>(e)=>`${FW(e.label)}=${t - e.startTime}ms`, c4e = Wy, l4e = Ywe;
    class $c extends l4e {
    }
    const Ed = Symbol.for("effect/Readable"), gE = Symbol.for("effect/Ref"), bE = {
        _A: (t)=>t
    };
    class u4e extends $c {
        ref;
        commit() {
            return this.get;
        }
        [gE] = bE;
        [Ed] = Ed;
        constructor(e){
            super(), this.ref = e, this.get = $e(()=>Tn(this.ref));
        }
        get;
        modify(e) {
            return $e(()=>{
                const n = Tn(this.ref), [r, s] = e(n);
                return n !== s && Bp(s)(this.ref), r;
            });
        }
    }
    const mE = (t)=>new u4e(Dp(t)), B2 = (t)=>$e(()=>mE(t)), xo = (t)=>t.get, jf = j(2, (t, e)=>t.modify(()=>[
                void 0,
                e
            ])), d4e = j(2, (t, e)=>t.modify((n)=>[
                n,
                e
            ])), LW = j(2, (t, e)=>t.modify(e)), F2 = j(2, (t, e)=>t.modify((n)=>[
                void 0,
                e(n)
            ])), f4e = gE, Nl = B2, Zo = xo, zW = d4e, kf = LW, ao = jf, UW = F2, HW = "Empty", jW = "Add", qW = "Remove", WW = "Update", KW = "AndThen", p4e = {
        _tag: HW
    }, yE = (t, e)=>{
        const n = new Map(t.locals);
        let r = p4e;
        for (const [s, i] of e.locals.entries()){
            const o = Si(i)[1], a = n.get(s);
            if (a !== void 0) {
                const c = Si(a)[1];
                jt(c, o) || (r = N8({
                    _tag: WW,
                    fiberRef: s,
                    patch: s.diff(c, o)
                })(r));
            } else r = N8({
                _tag: jW,
                fiberRef: s,
                value: o
            })(r);
            n.delete(s);
        }
        for (const [s] of n.entries())r = N8({
            _tag: qW,
            fiberRef: s
        })(r);
        return r;
    }, N8 = j(2, (t, e)=>({
            _tag: KW,
            first: t,
            second: e
        })), $W = j(3, (t, e, n)=>{
        let r = n, s = qo(t);
        for(; Fr(s);){
            const i = Si(s), o = ap(s);
            switch(i._tag){
                case HW:
                    {
                        s = o;
                        break;
                    }
                case jW:
                    {
                        r = H6(r, {
                            fiberId: e,
                            fiberRef: i.fiberRef,
                            value: i.value
                        }), s = o;
                        break;
                    }
                case qW:
                    {
                        r = RW(r, i.fiberRef), s = o;
                        break;
                    }
                case WW:
                    {
                        const a = ny(r, i.fiberRef);
                        r = H6(r, {
                            fiberId: e,
                            fiberRef: i.fiberRef,
                            value: i.fiberRef.patch(i.patch)(a)
                        }), s = o;
                        break;
                    }
                case KW:
                    {
                        s = S2(i.first)(S2(i.second)(o));
                        break;
                    }
            }
        }
        return r;
    }), XW = "effect/MetricLabel", q6 = Symbol.for(XW);
    class h4e {
        key;
        value;
        [q6] = q6;
        _hash;
        constructor(e, n){
            this.key = e, this.value = n, this._hash = qr(XW + this.key + this.value);
        }
        [Jt]() {
            return this._hash;
        }
        [$t](e) {
            return b4e(e) && this.key === e.key && this.value === e.value;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const g4e = (t, e)=>new h4e(t, e), b4e = (t)=>Ft(t, q6), m4e = (t)=>Pt(t, ze), GW = (t)=>{
        let e, n;
        return typeof t == "function" ? e = t : (e = t.try, n = t.catch), Rt(()=>{
            try {
                return Ke(js(e));
            } catch (r) {
                return Tr(n ? js(()=>n(r)) : new zv(r, "An unknown error occurred in Effect.try"));
            }
        });
    }, y4e = j(2, (t, e)=>Mv(t, (n)=>{
            const r = Pv(n, (s)=>jC(s) ? ze(s) : Fe());
            switch(r._tag){
                case "None":
                    return kr(n);
                case "Some":
                    return e(r.value.defect);
            }
        })), w4e = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>{
                const r = e(n);
                switch(r._tag){
                    case "None":
                        return kr(n);
                    case "Some":
                        return r.value;
                }
            },
            onSuccess: Ke
        })), _4e = j(2, (t, e)=>{
        let n;
        return T5e(t, (r)=>(n ??= Object.keys(e), Ft(r, "_tag") && To(r._tag) && n.includes(r._tag)), (r)=>e[r._tag](r));
    }), x4e = (t)=>tK(t, JW, yE), v4e = (t)=>tK(t, Dv(JW, A5e), ([e, n], [r, s])=>[
                yE(e, r),
                cd(n, s)
            ]), S4e = Ke({}), W6 = ywe(Pt, Me), YR = mwe(Pt), k4e = bwe(Pt), ZW = j(2, (t, e)=>Lc(t, {
            onFailure: (n)=>Ke(e.onFailure(n)),
            onSuccess: (n)=>Ke(e.onSuccess(n))
        })), T4e = (t)=>{
        const e = Me(Me(t, ()=>Vv()), ()=>e);
        return e;
    }, JW = fn((t)=>Ke(t.getFiberRefs())), C4e = (t)=>ZW(t, {
            onFailure: m2,
            onSuccess: m2
        }), E4e = (t)=>Ii(t, {
            onFailure: (e)=>I4e(e, "An error was silently ignored because it is not anticipated to be useful"),
            onSuccess: ()=>mn
        }), YW = (t, e)=>Rt(()=>e.while(t) ? Me(e.body(t), (n)=>YW(n, e)) : Ke(t)), QW = (t)=>(...e)=>{
            const n = Mp(t);
            let r;
            for(let s = 0, i = e.length; s < i; s++){
                const o = e[s];
                Fq(o) && (r !== void 0 ? r = xs(r, o) : r = o, e = [
                    ...e.slice(0, s),
                    ...e.slice(s + 1)
                ], s--);
            }
            return r === void 0 && (r = su), fn((s)=>(s.log(e, r, n), mn));
        }, I4e = QW(BW), A4e = QW(DW), QR = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>ZC(()=>e(n)),
            onSuccess: Ke
        })), P4e = (t)=>V(Ug(), Me((e)=>V(v4e(t), JC(e), M4e, Pt((n)=>Wr(n, V(la(e), Me(([r, s])=>vs(Dv(eK(r[0]), Qq(r[1])), s)))))))), O4e = (t)=>Pt(t, (e)=>!e), M4e = (t)=>Pt(Nl(!0), (e)=>Mi(l1(t, zW(e, !1)))), R4e = j(2, (t, e)=>QC(t, ()=>Rg(e))), N4e = j(2, (t, e)=>QC(t, ()=>$e(e))), eK = (t)=>U4e((e, n)=>V(t, $W(e, n))), V4e = (t)=>t.length >= 1 ? za((e, n)=>{
            try {
                t(n).then((r)=>e(Ke(r)), (r)=>e(Ol(r)));
            } catch (r) {
                e(Ol(r));
            }
        }) : za((e)=>{
            try {
                t().then((n)=>e(Ke(n)), (n)=>e(Ol(n)));
            } catch (n) {
                e(Ol(n));
            }
        }), wE = j(3, (t, e, n)=>Hp((r)=>$v(t, kc(r, e, n)))), ry = j(3, (t, e, n)=>Hp((r)=>Me(n, (s)=>$v(t, V(r, kc(e, s)))))), D4e = j(3, (t, e, n)=>Un(t).reduce((r, s, i)=>Me(r, (o)=>n(o, s, i)), Ke(e))), _E = HSe, B4e = Ke(Fe()), tK = j(3, (t, e, n)=>Me(e, (r)=>Me(t, (s)=>Pt(e, (i)=>[
                        n(r, i),
                        s
                    ])))), F4e = j(2, (t, e)=>Ii(t, {
            onFailure: (n)=>Wr(e(n), kr(n)),
            onSuccess: Ke
        })), nK = (t)=>{
        let e, n;
        typeof t == "function" ? e = t : (e = t.try, n = t.catch);
        const r = (s)=>n ? Rg(()=>n(s)) : Tr(new zv(s, "An unknown error occurred in Effect.tryPromise"));
        return e.length >= 1 ? za((s, i)=>{
            try {
                e(i).then((o)=>s(Ke(o)), (o)=>s(r(o)));
            } catch (o) {
                s(r(o));
            }
        }) : za((s)=>{
            try {
                e().then((i)=>s(Ke(i)), (i)=>s(r(i)));
            } catch (i) {
                s(r(i));
            }
        });
    }, L4e = j(2, (t, e)=>Me(t, (n)=>GW({
                try: ()=>e.try(n),
                catch: e.catch
            }))), z4e = j(2, (t, e)=>Me(t, (n)=>nK({
                try: e.try.length >= 1 ? (r)=>e.try(n, r) : ()=>e.try(n),
                catch: e.catch
            }))), U4e = (t)=>fn((e)=>(e.setFiberRefs(t(e.id(), e.getFiberRefs())), mn)), H4e = j(2, (t, e)=>Rt(()=>e() ? Pt(t, ze) : Ke(Fe()))), j4e = (t)=>new Proxy({}, {
            get (e, n, r) {
                return (...s)=>Me(t, (i)=>i[n](...s));
            }
        }), q4e = (t)=>Pt(Kv(), Vp(t)), rK = BigInt(0), xE = xg((t)=>Pc(t.context, U6) ? t._tag === "Span" ? xE(t.parent) : Fe() : ze(t)), W4e = (t, e, n)=>{
        const r = !t.getFiberRef(aW) || n.context && Pc(n.context, U6), s = t.getFiberRef(ba), i = n.parent ? ze(n.parent) : n.root ? Fe() : xE(Vp(s, Zv));
        let o;
        if (r) o = T8e({
            name: e,
            parent: i,
            context: kc(n.context ?? Xm(), U6, !0)
        });
        else {
            const a = t.getFiberRef(bp), c = Pc(a, hE), l = Pc(a, jSe), u = t.getFiberRef(cW), d = t.getFiberRefs(), f = JR(d, t8e), p = JR(d, n8e), h = p._tag === "Some" ? n.links !== void 0 ? [
                ..._o(p.value),
                ...n.links ?? []
            ] : _o(p.value) : n.links ?? tu();
            o = c.span(e, i, n.context ?? Xm(), h, u ? l.unsafeCurrentTimeNanos() : rK, n.kind ?? "internal", n), f._tag === "Some" && S3e(f.value, (m, w)=>o.attribute(w, m)), n.attributes !== void 0 && Object.entries(n.attributes).forEach(([m, w])=>o.attribute(m, w));
        }
        return typeof n.captureStackTrace == "function" && N2.set(o, n.captureStackTrace), o;
    }, K4e = (t, e, n, r)=>$e(()=>{
            t.status._tag !== "Ended" && (uW(e) && N2.has(t) && t.attribute("code.stacktrace", N2.get(t)()), t.end(r ? n.unsafeCurrentTimeNanos() : rK, e));
        }), $4e = (t, ...e)=>{
        const n = BSe(e.length === 1 ? void 0 : e[0]), r = e[e.length - 1];
        return fn((s)=>{
            const i = W4e(s, t, n), o = s.getFiberRef(cW), a = Pc(s.getFiberRef(bp), Hg);
            return kd(r(i), (c)=>K4e(i, c, a, o));
        });
    }, X4e = j(2, (t, e)=>wE(t, Zv, e)), G4e = (t)=>t == null ? Tr(new Lv) : Ke(t), sK = "Sequential", iK = "Parallel", Z4e = "ParallelN", ld = {
        _tag: sK
    }, K6 = {
        _tag: iK
    }, J4e = (t)=>({
            _tag: Z4e,
            parallelism: t
        }), Y4e = (t)=>t._tag === sK, Q4e = (t)=>t._tag === iK, L2 = ld, $6 = K6, X6 = J4e, sy = yE, iy = $W, Jv = "effect/FiberStatus", mp = Symbol.for(Jv), z2 = "Done", eN = "Running", tN = "Suspended", e7e = qr(`${Jv}-${z2}`);
    let t7e = class {
        [mp] = mp;
        _tag = z2;
        [Jt]() {
            return e7e;
        }
        [$t](e) {
            return vE(e) && e._tag === z2;
        }
    };
    class n7e {
        runtimeFlags;
        [mp] = mp;
        _tag = eN;
        constructor(e){
            this.runtimeFlags = e;
        }
        [Jt]() {
            return V(At(Jv), bn(At(this._tag)), bn(At(this.runtimeFlags)), ur(this));
        }
        [$t](e) {
            return vE(e) && e._tag === eN && this.runtimeFlags === e.runtimeFlags;
        }
    }
    class r7e {
        runtimeFlags;
        blockingOn;
        [mp] = mp;
        _tag = tN;
        constructor(e, n){
            this.runtimeFlags = e, this.blockingOn = n;
        }
        [Jt]() {
            return V(At(Jv), bn(At(this._tag)), bn(At(this.runtimeFlags)), bn(At(this.blockingOn)), ur(this));
        }
        [$t](e) {
            return vE(e) && e._tag === tN && this.runtimeFlags === e.runtimeFlags && jt(this.blockingOn, e.blockingOn);
        }
    }
    const s7e = new t7e, i7e = (t)=>new n7e(t), o7e = (t, e)=>new r7e(t, e), vE = (t)=>Ft(t, mp), a7e = (t)=>t._tag === z2, c7e = s7e, oK = i7e, l7e = o7e, u7e = a7e, d7e = Symbol.for("effect/Micro"), U2 = Symbol.for("effect/Micro/MicroExit"), nN = Symbol.for("effect/Micro/MicroCause"), f7e = {
        _E: Ht
    };
    class aK extends globalThis.Error {
        _tag;
        traces;
        [nN];
        constructor(e, n, r){
            const s = `MicroCause.${e}`;
            let i, o, a;
            if (n instanceof globalThis.Error) {
                i = `(${s}) ${n.name}`, o = n.message;
                const c = o.split(`
`).length;
                a = n.stack ? `(${s}) ${n.stack.split(`
`).slice(0, c + 3).join(`
`)}` : `${i}: ${o}`;
            } else i = s, o = I0(n, 0), a = `${i}: ${o}`;
            r.length > 0 && (a += `
    ${r.join(`
    `)}`), super(o), this._tag = e, this.traces = r, this[nN] = f7e, this.name = i, this.stack = a;
        }
        pipe() {
            return St(this, arguments);
        }
        toString() {
            return this.stack;
        }
        [Bn]() {
            return this.stack;
        }
    }
    class p7e extends aK {
        defect;
        constructor(e, n = []){
            super("Die", e, n), this.defect = e;
        }
    }
    const h7e = (t, e = [])=>new p7e(t, e);
    class g7e extends aK {
        constructor(e = []){
            super("Interrupt", "interrupted", e);
        }
    }
    const b7e = (t = [])=>new g7e(t), m7e = (t)=>t._tag === "Interrupt", rN = Symbol.for("effect/Micro/MicroFiber"), y7e = {
        _A: Ht,
        _E: Ht
    };
    class w7e {
        context;
        interruptible;
        [rN];
        _stack = [];
        _observers = [];
        _exit;
        _children;
        currentOpCount = 0;
        constructor(e, n = !0){
            this.context = e, this.interruptible = n, this[rN] = y7e;
        }
        getRef(e) {
            return Dxe(this.context, e);
        }
        addObserver(e) {
            return this._exit ? (e(this._exit), m2) : (this._observers.push(e), ()=>{
                const n = this._observers.indexOf(e);
                n >= 0 && this._observers.splice(n, 1);
            });
        }
        _interrupted = !1;
        unsafeInterrupt() {
            this._exit || (this._interrupted = !0, this.interruptible && this.evaluate(EE));
        }
        unsafePoll() {
            return this._exit;
        }
        evaluate(e) {
            if (this._exit) return;
            if (this._yielded !== void 0) {
                const s = this._yielded;
                this._yielded = void 0, s();
            }
            const n = this.runLoop(e);
            if (n === zw) return;
            const r = sN.interruptChildren && sN.interruptChildren(this);
            if (r !== void 0) return this.evaluate(j2(r, ()=>n));
            this._exit = n;
            for(let s = 0; s < this._observers.length; s++)this._observers[s](n);
            this._observers.length = 0;
        }
        runLoop(e) {
            let n = !1, r = e;
            this.currentOpCount = 0;
            try {
                for(;;){
                    if (this.currentOpCount++, !n && this.getRef(IE).shouldYield(this)) {
                        n = !0;
                        const s = r;
                        r = j2(k7e, ()=>s);
                    }
                    if (r = r[G6](this), r === zw) {
                        const s = this._yielded;
                        return U2 in s ? (this._yielded = void 0, s) : zw;
                    }
                }
            } catch (s) {
                return Ft(r, G6) ? Z6(s) : Z6(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`);
            }
        }
        getCont(e) {
            for(;;){
                const n = this._stack.pop();
                if (!n) return;
                const r = n[H2] && n[H2](this);
                if (r) return {
                    [e]: r
                };
                if (n[e]) return n;
            }
        }
        _yielded = void 0;
        yieldWith(e) {
            return this._yielded = e, zw;
        }
        children() {
            return this._children ??= new Set;
        }
    }
    const sN = Xt("effect/Micro/fiberMiddleware", ()=>({
            interruptChildren: void 0
        })), cK = Symbol.for("effect/Micro/identifier"), ys = Symbol.for("effect/Micro/args"), G6 = Symbol.for("effect/Micro/evaluate"), G0 = Symbol.for("effect/Micro/successCont"), Gh = Symbol.for("effect/Micro/failureCont"), H2 = Symbol.for("effect/Micro/ensureCont"), zw = Symbol.for("effect/Micro/Yield"), _7e = {
        _A: Ht,
        _E: Ht,
        _R: Ht
    }, x7e = {
        ...c4e,
        _op: "Micro",
        [d7e]: _7e,
        pipe () {
            return St(this, arguments);
        },
        [Symbol.iterator] () {
            return new YT(new jy(this));
        },
        toJSON () {
            return {
                _id: "Micro",
                op: this[cK],
                ...ys in this ? {
                    args: this[ys]
                } : void 0
            };
        },
        toString () {
            return Mr(this);
        },
        [Bn] () {
            return Mr(this);
        }
    };
    function v7e(t) {
        return Z6("Micro.evaluate: Not implemented");
    }
    const Yv = (t)=>({
            ...x7e,
            [cK]: t.op,
            [G6]: t.eval ?? v7e,
            [G0]: t.contA,
            [Gh]: t.contE,
            [H2]: t.ensure
        }), SE = (t)=>{
        const e = Yv(t);
        return function() {
            const n = Object.create(e);
            return n[ys] = t.single === !1 ? arguments : arguments[0], n;
        };
    }, lK = (t)=>{
        const e = {
            ...Yv(t),
            [U2]: U2,
            _tag: t.op,
            get [t.prop] () {
                return this[ys];
            },
            toJSON () {
                return {
                    _id: "MicroExit",
                    _tag: t.op,
                    [t.prop]: this[ys]
                };
            },
            [$t] (n) {
                return E7e(n) && n._tag === t.op && jt(this[ys], n[ys]);
            },
            [Jt] () {
                return ur(this, bn(qr(t.op))(At(this[ys])));
            }
        };
        return function(n) {
            const r = Object.create(e);
            return r[ys] = n, r[G0] = void 0, r[Gh] = void 0, r[H2] = void 0, r;
        };
    }, kE = lK({
        op: "Success",
        prop: "value",
        eval (t) {
            const e = t.getCont(G0);
            return e ? e[G0](this[ys], t) : t.yieldWith(this);
        }
    }), uK = lK({
        op: "Failure",
        prop: "cause",
        eval (t) {
            let e = t.getCont(Gh);
            for(; m7e(this[ys]) && e && t.interruptible;)e = t.getCont(Gh);
            return e ? e[Gh](this[ys], t) : t.yieldWith(this);
        }
    }), S7e = SE({
        op: "Yield",
        eval (t) {
            let e = !1;
            return t.getRef(IE).scheduleTask(()=>{
                e || t.evaluate(I7e);
            }, this[ys] ?? 0), t.yieldWith(()=>{
                e = !0;
            });
        }
    }), k7e = S7e(0), T7e = kE(void 0), TE = SE({
        op: "WithMicroFiber",
        eval (t) {
            return this[ys](t);
        }
    }), j2 = j(2, (t, e)=>{
        const n = Object.create(C7e);
        return n[ys] = t, n[G0] = e, n;
    }), C7e = Yv({
        op: "OnSuccess",
        eval (t) {
            return t._stack.push(this), this[ys];
        }
    }), E7e = (t)=>Ft(t, U2), dK = kE, CE = uK, EE = CE(b7e()), Z6 = (t)=>CE(h7e(t)), I7e = dK(void 0), A7e = "setImmediate" in globalThis ? globalThis.setImmediate : (t)=>setTimeout(t, 0);
    class fK {
        tasks = [];
        running = !1;
        scheduleTask(e, n) {
            this.tasks.push(e), this.running || (this.running = !0, A7e(this.afterScheduled));
        }
        afterScheduled = ()=>{
            this.running = !1, this.runTasks();
        };
        runTasks() {
            const e = this.tasks;
            this.tasks = [];
            for(let n = 0, r = e.length; n < r; n++)e[n]();
        }
        shouldYield(e) {
            return e.currentOpCount >= e.getRef(M7e);
        }
        flush() {
            for(; this.tasks.length > 0;)this.runTasks();
        }
    }
    const P7e = j(2, (t, e)=>TE((n)=>{
            const r = n.context;
            return n.context = e(r), V7e(t, ()=>(n.context = r, T7e));
        })), O7e = j(2, (t, e)=>P7e(t, Tg(e)));
    class M7e extends Cg()("effect/Micro/currentMaxOpsBeforeYield", {
        defaultValue: ()=>2048
    }) {
    }
    class IE extends Cg()("effect/Micro/currentScheduler", {
        defaultValue: ()=>new fK
    }) {
    }
    const R7e = j(2, (t, e)=>{
        const n = Object.create(N7e);
        return n[ys] = t, n[G0] = e.onSuccess, n[Gh] = e.onFailure, n;
    }), N7e = Yv({
        op: "OnSuccessAndFailure",
        eval (t) {
            return t._stack.push(this), this[ys];
        }
    }), V7e = j(2, (t, e)=>B7e((n)=>R7e(n(t), {
                onFailure: (r)=>j2(e(CE(r)), ()=>uK(r)),
                onSuccess: (r)=>j2(e(dK(r)), ()=>kE(r))
            }))), pK = SE({
        op: "SetInterruptible",
        ensure (t) {
            if (t.interruptible = this[ys], t._interrupted && t.interruptible) return ()=>EE;
        }
    }), D7e = (t)=>TE((e)=>e.interruptible ? t : (e.interruptible = !0, e._stack.push(pK(!1)), e._interrupted ? EE : t)), B7e = (t)=>TE((e)=>e.interruptible ? (e.interruptible = !1, e._stack.push(pK(!0)), t(D7e)) : t(Ht)), F7e = (t, e)=>{
        const n = new w7e(IE.context(new fK));
        return n.evaluate(t), n;
    };
    class q2 {
        scheduleDrain;
        running = !1;
        tasks = new hK;
        constructor(e){
            this.scheduleDrain = e;
        }
        starveInternal = (e)=>{
            const n = this.tasks.buckets;
            this.tasks.buckets = [];
            for (const [r, s] of n)for(let i = 0; i < s.length; i++)s[i]();
            this.tasks.buckets.length === 0 ? this.running = !1 : this.starve(e);
        };
        starve(e = 0) {
            this.scheduleDrain(e, this.starveInternal);
        }
        scheduleTask(e, n) {
            this.tasks.scheduleTask(e, n), this.running || (this.running = !0, this.starve());
        }
        static cached(e) {
            const n = new q2(e), r = new WeakMap;
            return (s)=>{
                if (s === void 0) return n;
                let i = r.get(s);
                return i === void 0 && (i = new q2(e), r.set(s, i)), i;
            };
        }
    }
    class hK {
        buckets = [];
        scheduleTask(e, n) {
            const r = this.buckets.length;
            let s, i = 0;
            for(; i < r && this.buckets[i][0] <= n; i++)s = this.buckets[i];
            s && s[0] === n ? s[1].push(e) : i === r ? this.buckets.push([
                n,
                [
                    e
                ]
            ]) : this.buckets.splice(i, 0, [
                n,
                [
                    e
                ]
            ]);
        }
    }
    class L7e {
        maxNextTickBeforeTimer;
        getRunner = q2.cached((e, n)=>{
            e >= this.maxNextTickBeforeTimer ? setTimeout(()=>n(0), 0) : Promise.resolve(void 0).then(()=>n(e + 1));
        });
        constructor(e){
            this.maxNextTickBeforeTimer = e;
        }
        shouldYield(e) {
            return e.currentOpCount > e.getFiberRef(oW) ? e.getFiberRef(Fg) : !1;
        }
        scheduleTask(e, n, r) {
            this.getRunner(r).scheduleTask(e, n);
        }
    }
    const gK = Xt(Symbol.for("effect/Scheduler/defaultScheduler"), ()=>new L7e(2048));
    class bK {
        tasks = new hK;
        deferred = !1;
        scheduleTask(e, n, r) {
            this.deferred ? gK.scheduleTask(e, n, r) : this.tasks.scheduleTask(e, n);
        }
        shouldYield(e) {
            return e.currentOpCount > e.getFiberRef(oW) ? e.getFiberRef(Fg) : !1;
        }
        flush() {
            for(; this.tasks.buckets.length > 0;){
                const e = this.tasks.buckets;
                this.tasks.buckets = [];
                for (const [n, r] of e)for(let s = 0; s < r.length; s++)r[s]();
            }
            this.deferred = !0;
        }
    }
    const AE = Xt(Symbol.for("effect/FiberRef/currentScheduler"), ()=>Ss(gK)), mK = Xt(Symbol.for("effect/FiberRef/currentRequestMap"), ()=>Ss(new Map)), iN = (t, e, n, r)=>{
        switch(t){
            case void 0:
                return e();
            case "unbounded":
                return n();
            case "inherit":
                return u1(J5e, (s)=>s === "unbounded" ? n() : s > 1 ? r(s) : e());
            default:
                return t > 1 ? r(t) : e();
        }
    }, PE = "InterruptSignal", OE = "Stateful", ME = "Resume", RE = "YieldNow", V8 = (t)=>({
            _tag: PE,
            cause: t
        }), A_ = (t)=>({
            _tag: OE,
            onFiber: t
        }), mh = (t)=>({
            _tag: ME,
            effect: t
        }), z7e = ()=>({
            _tag: RE
        }), U7e = "effect/FiberScope", W2 = Symbol.for(U7e);
    class H7e {
        [W2] = W2;
        fiberId = B0;
        roots = new Set;
        add(e, n) {
            this.roots.add(n), n.addObserver(()=>{
                this.roots.delete(n);
            });
        }
    }
    class j7e {
        fiberId;
        parent;
        [W2] = W2;
        constructor(e, n){
            this.fiberId = e, this.parent = n;
        }
        add(e, n) {
            this.parent.tell(A_((r)=>{
                r.addChild(n), n.addObserver(()=>{
                    r.removeChild(n);
                });
            }));
        }
    }
    const q7e = (t)=>new j7e(t.id(), t), p1 = Xt(Symbol.for("effect/FiberScope/Global"), ()=>new H7e), W7e = "effect/Fiber", K7e = Symbol.for(W7e), $7e = {
        _E: (t)=>t,
        _A: (t)=>t
    }, X7e = "effect/Fiber", G7e = Symbol.for(X7e), Z7e = (t)=>t.await, J7e = (t)=>t.inheritAll, oy = (t)=>Bv(Vg(t.await), t.inheritAll);
    ({
        ...$y
    });
    const sf = "effect/FiberCurrent", Y7e = "effect/Logger", Q7e = Symbol.for(Y7e), e6e = {
        _Message: (t)=>t,
        _Output: (t)=>t
    }, NE = (t)=>({
            [Q7e]: e6e,
            log: t,
            pipe () {
                return St(this, arguments);
            }
        }), t6e = /^[^\s"=]*$/, n6e = (t, e)=>({ annotations: n, cause: r, date: s, fiberId: i, logLevel: o, message: a, spans: c })=>{
            const l = (h)=>h.match(t6e) ? h : t(h), u = (h, m)=>`${FW(h)}=${l(m)}`, d = (h, m)=>" " + u(h, m);
            let f = u("timestamp", s.toISOString());
            f += d("level", o.label), f += d("fiber", mq(i));
            const p = D_e(a);
            for(let h = 0; h < p.length; h++)f += d("message", I0(p[h], e));
            r5e(r) || (f += d("cause", Mg(r, {
                renderErrorCause: !0
            })));
            for (const h of c)f += " " + a4e(s.getTime())(h);
            for (const [h, m] of n)f += d(h, I0(m, e));
            return f;
        }, r6e = (t)=>`"${t.replace(/\\([\s\S])|(")/g, "\\$1$2")}"`, s6e = NE(n6e(r6e)), i6e = typeof process == "object" && process !== null && typeof process.stdout == "object" && process.stdout !== null;
    i6e && process.stdout.isTTY;
    const yK = "effect/MetricBoundaries", J6 = Symbol.for(yK);
    class o6e {
        values;
        [J6] = J6;
        constructor(e){
            this.values = e, this._hash = V(qr(yK), bn(yg(this.values)));
        }
        _hash;
        [Jt]() {
            return this._hash;
        }
        [$t](e) {
            return a6e(e) && jt(this.values, e.values);
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const a6e = (t)=>Ft(t, J6), c6e = (t)=>{
        const e = V(t, uv(Mn(Number.POSITIVE_INFINITY)), r2e);
        return new o6e(e);
    }, l6e = (t)=>V(V_e(t.count - 1, (e)=>t.start * Math.pow(t.factor, e)), Yi, c6e), u6e = "effect/MetricKeyType", wK = Symbol.for(u6e), _K = "effect/MetricKeyType/Counter", Y6 = Symbol.for(_K), d6e = "effect/MetricKeyType/Frequency", f6e = Symbol.for(d6e), p6e = "effect/MetricKeyType/Gauge", h6e = Symbol.for(p6e), xK = "effect/MetricKeyType/Histogram", Q6 = Symbol.for(xK), g6e = "effect/MetricKeyType/Summary", b6e = Symbol.for(g6e), vK = {
        _In: (t)=>t,
        _Out: (t)=>t
    };
    class m6e {
        incremental;
        bigint;
        [wK] = vK;
        [Y6] = Y6;
        constructor(e, n){
            this.incremental = e, this.bigint = n, this._hash = qr(_K);
        }
        _hash;
        [Jt]() {
            return this._hash;
        }
        [$t](e) {
            return SK(e);
        }
        pipe() {
            return St(this, arguments);
        }
    }
    class y6e {
        boundaries;
        [wK] = vK;
        [Q6] = Q6;
        constructor(e){
            this.boundaries = e, this._hash = V(qr(xK), bn(At(this.boundaries)));
        }
        _hash;
        [Jt]() {
            return this._hash;
        }
        [$t](e) {
            return kK(e) && jt(this.boundaries, e.boundaries);
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const w6e = (t)=>new m6e(t?.incremental ?? !1, t?.bigint ?? !1), _6e = (t)=>new y6e(t), SK = (t)=>Ft(t, Y6), x6e = (t)=>Ft(t, f6e), v6e = (t)=>Ft(t, h6e), kK = (t)=>Ft(t, Q6), S6e = (t)=>Ft(t, b6e), k6e = "effect/MetricKey", TK = Symbol.for(k6e), T6e = {
        _Type: (t)=>t
    }, C6e = Gy(jt);
    class VE {
        name;
        keyType;
        description;
        tags;
        [TK] = T6e;
        constructor(e, n, r, s = []){
            this.name = e, this.keyType = n, this.description = r, this.tags = s, this._hash = V(qr(this.name + this.description), bn(At(this.keyType)), bn(yg(this.tags)));
        }
        _hash;
        [Jt]() {
            return this._hash;
        }
        [$t](e) {
            return E6e(e) && this.name === e.name && jt(this.keyType, e.keyType) && jt(this.description, e.description) && C6e(this.tags, e.tags);
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const E6e = (t)=>Ft(t, TK), I6e = (t, e)=>new VE(t, w6e(e), Mp(e?.description)), A6e = (t, e, n)=>new VE(t, _6e(e), Mp(n)), P6e = j(2, (t, e)=>e.length === 0 ? t : new VE(t.name, t.keyType, t.description, T_(t.tags, e))), O6e = "effect/MetricState", h1 = Symbol.for(O6e), CK = "effect/MetricState/Counter", ek = Symbol.for(CK), EK = "effect/MetricState/Frequency", tk = Symbol.for(EK), IK = "effect/MetricState/Gauge", nk = Symbol.for(IK), AK = "effect/MetricState/Histogram", rk = Symbol.for(AK), PK = "effect/MetricState/Summary", sk = Symbol.for(PK), g1 = {
        _A: (t)=>t
    };
    class M6e {
        count;
        [h1] = g1;
        [ek] = ek;
        constructor(e){
            this.count = e;
        }
        [Jt]() {
            return V(At(CK), bn(At(this.count)), ur(this));
        }
        [$t](e) {
            return j6e(e) && this.count === e.count;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const R6e = Gy(jt);
    class N6e {
        occurrences;
        [h1] = g1;
        [tk] = tk;
        constructor(e){
            this.occurrences = e;
        }
        _hash;
        [Jt]() {
            return V(qr(EK), bn(yg(Un(this.occurrences.entries()))), ur(this));
        }
        [$t](e) {
            return q6e(e) && R6e(Un(this.occurrences.entries()), Un(e.occurrences.entries()));
        }
        pipe() {
            return St(this, arguments);
        }
    }
    class V6e {
        value;
        [h1] = g1;
        [nk] = nk;
        constructor(e){
            this.value = e;
        }
        [Jt]() {
            return V(At(IK), bn(At(this.value)), ur(this));
        }
        [$t](e) {
            return W6e(e) && this.value === e.value;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    class D6e {
        buckets;
        count;
        min;
        max;
        sum;
        [h1] = g1;
        [rk] = rk;
        constructor(e, n, r, s, i){
            this.buckets = e, this.count = n, this.min = r, this.max = s, this.sum = i;
        }
        [Jt]() {
            return V(At(AK), bn(At(this.buckets)), bn(At(this.count)), bn(At(this.min)), bn(At(this.max)), bn(At(this.sum)), ur(this));
        }
        [$t](e) {
            return K6e(e) && jt(this.buckets, e.buckets) && this.count === e.count && this.min === e.min && this.max === e.max && this.sum === e.sum;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    class B6e {
        error;
        quantiles;
        count;
        min;
        max;
        sum;
        [h1] = g1;
        [sk] = sk;
        constructor(e, n, r, s, i, o){
            this.error = e, this.quantiles = n, this.count = r, this.min = s, this.max = i, this.sum = o;
        }
        [Jt]() {
            return V(At(PK), bn(At(this.error)), bn(At(this.quantiles)), bn(At(this.count)), bn(At(this.min)), bn(At(this.max)), bn(At(this.sum)), ur(this));
        }
        [$t](e) {
            return $6e(e) && this.error === e.error && jt(this.quantiles, e.quantiles) && this.count === e.count && this.min === e.min && this.max === e.max && this.sum === e.sum;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const F6e = (t)=>new M6e(t), L6e = (t)=>new N6e(t), z6e = (t)=>new V6e(t), U6e = (t)=>new D6e(t.buckets, t.count, t.min, t.max, t.sum), H6e = (t)=>new B6e(t.error, t.quantiles, t.count, t.min, t.max, t.sum), j6e = (t)=>Ft(t, ek), q6e = (t)=>Ft(t, tk), W6e = (t)=>Ft(t, nk), K6e = (t)=>Ft(t, rk), $6e = (t)=>Ft(t, sk), X6e = "effect/MetricHook", G6e = Symbol.for(X6e), Z6e = {
        _In: (t)=>t,
        _Out: (t)=>t
    }, b1 = (t)=>({
            [G6e]: Z6e,
            pipe () {
                return St(this, arguments);
            },
            ...t
        }), oN = BigInt(0), J6e = (t)=>{
        let e = t.keyType.bigint ? oN : 0;
        const n = t.keyType.incremental ? t.keyType.bigint ? (s)=>s >= oN : (s)=>s >= 0 : (s)=>!0, r = (s)=>{
            n(s) && (e = e + s);
        };
        return b1({
            get: ()=>F6e(e),
            update: r,
            modify: r
        });
    }, Y6e = (t)=>{
        const e = new Map;
        for (const r of t.keyType.preregisteredWords)e.set(r, 0);
        const n = (r)=>{
            const s = e.get(r) ?? 0;
            e.set(r, s + 1);
        };
        return b1({
            get: ()=>L6e(e),
            update: n,
            modify: n
        });
    }, Q6e = (t, e)=>{
        let n = e;
        return b1({
            get: ()=>z6e(n),
            update: (r)=>{
                n = r;
            },
            modify: (r)=>{
                n = n + r;
            }
        });
    }, eke = (t)=>{
        const e = t.keyType.boundaries.values, n = e.length, r = new Uint32Array(n + 1), s = new Float64Array(n);
        let i = 0, o = 0, a = Number.MAX_VALUE, c = Number.MIN_VALUE;
        V(e, P0(O0), Ps((d, f)=>{
            s[f] = d;
        }));
        const l = (d)=>{
            let f = 0, p = n;
            for(; f !== p;){
                const h = Math.floor(f + (p - f) / 2), m = s[h];
                d <= m ? p = h : f = h, p === f + 1 && (d <= s[f] ? p = f : f = p);
            }
            r[f] = r[f] + 1, i = i + 1, o = o + d, d < a && (a = d), d > c && (c = d);
        }, u = ()=>{
            const d = lv(n);
            let f = 0;
            for(let p = 0; p < n; p++){
                const h = s[p], m = r[p];
                f = f + m, d[p] = [
                    h,
                    f
                ];
            }
            return d;
        };
        return b1({
            get: ()=>U6e({
                    buckets: u(),
                    count: i,
                    min: a,
                    max: c,
                    sum: o
                }),
            update: l,
            modify: l
        });
    }, tke = (t)=>{
        const { error: e, maxAge: n, maxSize: r, quantiles: s } = t.keyType, i = V(s, P0(O0)), o = lv(r);
        let a = 0, c = 0, l = 0, u = 0, d = 0;
        const f = (h)=>{
            const m = [];
            let w = 0;
            for(; w !== r - 1;){
                const v = o[w];
                if (v != null) {
                    const [k, _] = v, A = ls(h - k);
                    nq(A, lp) && yve(A, n) && m.push(_);
                }
                w = w + 1;
            }
            return nke(e, i, P0(m, O0));
        }, p = (h, m)=>{
            if (r > 0) {
                a = a + 1;
                const w = a % r;
                o[w] = [
                    m,
                    h
                ];
            }
            u = c === 0 ? h : Math.min(u, h), d = c === 0 ? h : Math.max(d, h), c = c + 1, l = l + h;
        };
        return b1({
            get: ()=>H6e({
                    error: e,
                    quantiles: f(Date.now()),
                    count: c,
                    min: u,
                    max: d,
                    sum: l
                }),
            update: ([h, m])=>p(h, m),
            modify: ([h, m])=>p(h, m)
        });
    }, nke = (t, e, n)=>{
        const r = n.length;
        if (!Fr(e)) return tu();
        const s = e[0], i = e.slice(1), o = aN(t, r, Fe(), 0, s, n), a = qo(o);
        return i.forEach((c)=>{
            a.push(aN(t, r, o.value, o.consumed, c, o.rest));
        }), Ps(a, (c)=>[
                c.quantile,
                c.value
            ]);
    }, aN = (t, e, n, r, s, i)=>{
        let o = t, a = e, c = n, l = r, u = s, d = i, f = t, p = e, h = n, m = r, w = s, v = i;
        for(;;){
            if (!Fr(d)) return {
                quantile: u,
                value: Fe(),
                consumed: l,
                rest: []
            };
            if (u === 1) return {
                quantile: u,
                value: ze(sj(d)),
                consumed: l + d.length,
                rest: []
            };
            const k = Si(d), _ = W_e(d, (X)=>X === k), A = u * a, P = o / 2 * A, U = l + _[0].length, K = Math.abs(U - A);
            if (U < A - P) {
                f = o, p = a, h = wm(d), m = U, w = u, v = _[1], o = f, a = p, c = h, l = m, u = w, d = v;
                continue;
            }
            if (U > A + P) {
                const X = Qr(c) ? ze(k) : c;
                return {
                    quantile: u,
                    value: X,
                    consumed: l,
                    rest: d
                };
            }
            switch(c._tag){
                case "None":
                    {
                        f = o, p = a, h = wm(d), m = U, w = u, v = _[1], o = f, a = p, c = h, l = m, u = w, d = v;
                        continue;
                    }
                case "Some":
                    {
                        const X = Math.abs(A - c.value);
                        if (K < X) {
                            f = o, p = a, h = wm(d), m = U, w = u, v = _[1], o = f, a = p, c = h, l = m, u = w, d = v;
                            continue;
                        }
                        return {
                            quantile: u,
                            value: ze(c.value),
                            consumed: l,
                            rest: d
                        };
                    }
            }
        }
        throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues");
    }, rke = "effect/MetricPair", ske = Symbol.for(rke), ike = {
        _Type: (t)=>t
    }, oke = (t, e)=>({
            [ske]: ike,
            metricKey: t,
            metricState: e,
            pipe () {
                return St(this, arguments);
            }
        }), ake = "effect/MetricRegistry", cN = Symbol.for(ake);
    class cke {
        [cN] = cN;
        map = R8e();
        snapshot() {
            const e = [];
            for (const [n, r] of this.map)e.push(oke(n, r.get()));
            return e;
        }
        get(e) {
            const n = V(this.map, mf(e), _c);
            if (n == null) {
                if (SK(e.keyType)) return this.getCounter(e);
                if (v6e(e.keyType)) return this.getGauge(e);
                if (x6e(e.keyType)) return this.getFrequency(e);
                if (kK(e.keyType)) return this.getHistogram(e);
                if (S6e(e.keyType)) return this.getSummary(e);
                throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues");
            } else return n;
        }
        getCounter(e) {
            let n = V(this.map, mf(e), _c);
            if (n == null) {
                const r = J6e(e);
                V(this.map, xb(e)) || V(this.map, vb(e, r)), n = r;
            }
            return n;
        }
        getFrequency(e) {
            let n = V(this.map, mf(e), _c);
            if (n == null) {
                const r = Y6e(e);
                V(this.map, xb(e)) || V(this.map, vb(e, r)), n = r;
            }
            return n;
        }
        getGauge(e) {
            let n = V(this.map, mf(e), _c);
            if (n == null) {
                const r = Q6e(e, e.keyType.bigint ? BigInt(0) : 0);
                V(this.map, xb(e)) || V(this.map, vb(e, r)), n = r;
            }
            return n;
        }
        getHistogram(e) {
            let n = V(this.map, mf(e), _c);
            if (n == null) {
                const r = eke(e);
                V(this.map, xb(e)) || V(this.map, vb(e, r)), n = r;
            }
            return n;
        }
        getSummary(e) {
            let n = V(this.map, mf(e), _c);
            if (n == null) {
                const r = tke(e);
                V(this.map, xb(e)) || V(this.map, vb(e, r)), n = r;
            }
            return n;
        }
    }
    const lke = ()=>new cke, uke = "effect/Metric", dke = Symbol.for(uke), fke = {
        _Type: (t)=>t,
        _In: (t)=>t,
        _Out: (t)=>t
    }, lN = Xt(Symbol.for("effect/Metric/globalMetricRegistry"), ()=>lke()), OK = function(t, e, n, r) {
        const s = Object.assign((i)=>$0(i, (o)=>bke(s, o)), {
            [dke]: fke,
            keyType: t,
            unsafeUpdate: e,
            unsafeValue: n,
            unsafeModify: r,
            register () {
                return this.unsafeValue([]), this;
            },
            pipe () {
                return St(this, arguments);
            }
        });
        return s;
    }, Qv = (t, e)=>MK(I6e(t, e)), MK = (t)=>{
        let e;
        const n = new WeakMap, r = (s)=>{
            if (s.length === 0) return e !== void 0 || (e = lN.get(t)), e;
            let i = n.get(s);
            return i !== void 0 || (i = lN.get(P6e(t, s)), n.set(s, i)), i;
        };
        return OK(t.keyType, (s, i)=>r(i).update(s), (s)=>r(s).get(), (s, i)=>r(i).modify(s));
    }, pke = (t, e, n)=>MK(A6e(t, e, n)), hke = j(3, (t, e, n)=>gke(t, [
            g4e(e, n)
        ])), gke = j(2, (t, e)=>OK(t.keyType, (n, r)=>t.unsafeUpdate(n, T_(e, r)), (n)=>t.unsafeValue(T_(e, n)), (n, r)=>t.unsafeModify(n, T_(e, r)))), bke = j(2, (t, e)=>u1(N6, (n)=>$e(()=>t.unsafeUpdate(e, n))));
    ({
        ...Ky
    });
    const mke = j(2, (t, e)=>u1(mK, (n)=>$e(()=>{
                if (n.has(t)) {
                    const r = n.get(t);
                    r.state.completed || (r.state.completed = !0, Wv(r.result, e));
                }
            }))), yke = "effect/Supervisor", e3 = Symbol.for(yke), DE = {
        _T: (t)=>t
    };
    class t3 {
        underlying;
        value0;
        [e3] = DE;
        constructor(e, n){
            this.underlying = e, this.value0 = n;
        }
        get value() {
            return this.value0;
        }
        onStart(e, n, r, s) {
            this.underlying.onStart(e, n, r, s);
        }
        onEnd(e, n) {
            this.underlying.onEnd(e, n);
        }
        onEffect(e, n) {
            this.underlying.onEffect(e, n);
        }
        onSuspend(e) {
            this.underlying.onSuspend(e);
        }
        onResume(e) {
            this.underlying.onResume(e);
        }
        map(e) {
            return new t3(this, V(this.value, Pt(e)));
        }
        zip(e) {
            return new n3(this, e);
        }
    }
    class n3 {
        left;
        right;
        _tag = "Zip";
        [e3] = DE;
        constructor(e, n){
            this.left = e, this.right = n;
        }
        get value() {
            return Dv(this.left.value, this.right.value);
        }
        onStart(e, n, r, s) {
            this.left.onStart(e, n, r, s), this.right.onStart(e, n, r, s);
        }
        onEnd(e, n) {
            this.left.onEnd(e, n), this.right.onEnd(e, n);
        }
        onEffect(e, n) {
            this.left.onEffect(e, n), this.right.onEffect(e, n);
        }
        onSuspend(e) {
            this.left.onSuspend(e), this.right.onSuspend(e);
        }
        onResume(e) {
            this.left.onResume(e), this.right.onResume(e);
        }
        map(e) {
            return new t3(this, V(this.value, Pt(e)));
        }
        zip(e) {
            return new n3(this, e);
        }
    }
    const RK = (t)=>Ft(t, e3) && JT(t, "Zip");
    class wke {
        effect;
        [e3] = DE;
        constructor(e){
            this.effect = e;
        }
        get value() {
            return this.effect;
        }
        onStart(e, n, r, s) {}
        onEnd(e, n) {}
        onEffect(e, n) {}
        onSuspend(e) {}
        onResume(e) {}
        map(e) {
            return new t3(this, V(this.value, Pt(e)));
        }
        zip(e) {
            return new n3(this, e);
        }
        onRun(e, n) {
            return e();
        }
    }
    const _ke = (t)=>new wke(t), r3 = Xt("effect/Supervisor/none", ()=>_ke(mn)), xke = Ig, NK = "Empty", VK = "AddSupervisor", DK = "RemoveSupervisor", BK = "AndThen", vm = {
        _tag: NK
    }, P_ = (t, e)=>({
            _tag: BK,
            first: t,
            second: e
        }), vke = (t, e)=>Ske(e, Mn(t)), Ske = (t, e)=>{
        let n = t, r = e;
        for(; ca(r);){
            const s = Cc(r);
            switch(s._tag){
                case NK:
                    {
                        r = Pl(r);
                        break;
                    }
                case VK:
                    {
                        n = n.zip(s.supervisor), r = Pl(r);
                        break;
                    }
                case DK:
                    {
                        n = ik(n, s.supervisor), r = Pl(r);
                        break;
                    }
                case BK:
                    {
                        r = Rs(s.first)(Rs(s.second)(Pl(r)));
                        break;
                    }
            }
        }
        return n;
    }, ik = (t, e)=>jt(t, e) ? r3 : RK(t) ? ik(t.left, e).zip(ik(t.right, e)) : t, K2 = (t)=>jt(t, r3) ? dp() : RK(t) ? V(K2(t.left), Zm(K2(t.right))) : FC(t), kke = (t, e)=>{
        if (jt(t, e)) return vm;
        const n = K2(t), r = K2(e), s = V(r, uR(n), Jm(vm, (o, a)=>P_(o, {
                _tag: VK,
                supervisor: a
            }))), i = V(n, uR(r), Jm(vm, (o, a)=>P_(o, {
                _tag: DK,
                supervisor: a
            })));
        return P_(s, i);
    }, Tke = xke({
        empty: vm,
        patch: vke,
        combine: P_,
        diff: kke
    }), Cke = Qv("effect_fiber_started", {
        incremental: !0
    }), uN = Qv("effect_fiber_active"), Eke = Qv("effect_fiber_successes", {
        incremental: !0
    }), Ike = Qv("effect_fiber_failures", {
        incremental: !0
    }), Ake = hke(pke("effect_fiber_lifetimes", l6e({
        start: .5,
        factor: 2,
        count: 35
    })), "time_unit", "milliseconds"), Sb = "Continue", Pke = "Done", dN = "Yield", Oke = {
        _E: (t)=>t,
        _A: (t)=>t
    }, Uw = (t)=>{
        throw new Error(`BUG: FiberRuntime - ${I0(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`);
    }, ll = Symbol.for("effect/internal/fiberRuntime/YieldedOp"), ul = Xt("effect/internal/fiberRuntime/yieldedOpChannel", ()=>({
            currentOp: null
        })), kb = {
        [w2]: (t, e, n)=>js(()=>e.effect_instruction_i1(n)),
        OnStep: (t, e, n)=>Nr(Nr(n)),
        [_2]: (t, e, n)=>js(()=>e.effect_instruction_i2(n)),
        [nC]: (t, e, n)=>(t.patchRuntimeFlags(t.currentRuntimeFlags, e.patch), Gu(t.currentRuntimeFlags) && t.isInterrupted() ? Jn(t.getInterruptedCause()) : Nr(n)),
        [x2]: (t, e, n)=>(js(()=>e.effect_instruction_i2(n)), js(()=>e.effect_instruction_i0()) ? (t.pushStack(e), js(()=>e.effect_instruction_i1())) : mn),
        [mm]: (t, e, n)=>{
            for(;;){
                const r = js(()=>e.effect_instruction_i0.next(n));
                if (r.done) return Nr(r.value);
                const s = NH(r.value);
                if (Uv(s)) {
                    if (s._tag === "Failure") return s;
                } else return t.pushStack(e), s;
                n = s.value;
            }
        }
    }, Mke = {
        [PE]: (t, e, n, r)=>(t.processNewInterruptSignal(r.cause), Gu(e) ? Jn(r.cause) : n),
        [ME]: (t, e, n, r)=>{
            throw new Error("It is illegal to have multiple concurrent run loops in a single fiber");
        },
        [OE]: (t, e, n, r)=>(r.onFiber(t, oK(e)), n),
        [RE]: (t, e, n, r)=>Me(Vv(), ()=>n)
    }, Rke = (t)=>Rv(U9e(t), (e)=>Ba(t5e(e), ([n, r])=>{
                const s = new Map, i = [];
                for (const a of r){
                    i.push(_o(a));
                    for (const c of a)s.set(c.request, c);
                }
                const o = i.flat();
                return Dg(tTe(n.runAll(i), o, ()=>o.forEach((a)=>{
                        a.listeners.interrupted = !0;
                    })), mK, s);
            }, !1, !1)), Nke = rC();
    class FK extends $c {
        [K7e] = $7e;
        [G7e] = Oke;
        _fiberRefs;
        _fiberId;
        _queue = new Array;
        _children = null;
        _observers = new Array;
        _running = !1;
        _stack = [];
        _asyncInterruptor = null;
        _asyncBlockingOn = null;
        _exitValue = null;
        _steps = [];
        _isYielding = !1;
        currentRuntimeFlags;
        currentOpCount = 0;
        currentSupervisor;
        currentScheduler;
        currentTracer;
        currentSpan;
        currentContext;
        currentDefaultServices;
        constructor(e, n, r){
            if (super(), this.currentRuntimeFlags = r, this._fiberId = e, this._fiberRefs = n, wR(r)) {
                const s = this.getFiberRef(N6);
                Cke.unsafeUpdate(1, s), uN.unsafeUpdate(1, s);
            }
            this.refreshRefCache();
        }
        commit() {
            return oy(this);
        }
        id() {
            return this._fiberId;
        }
        resume(e) {
            this.tell(mh(e));
        }
        get status() {
            return this.ask((e, n)=>n);
        }
        get runtimeFlags() {
            return this.ask((e, n)=>u7e(n) ? e.currentRuntimeFlags : n.runtimeFlags);
        }
        scope() {
            return q7e(this);
        }
        get children() {
            return this.ask((e)=>Array.from(e.getChildren()));
        }
        getChildren() {
            return this._children === null && (this._children = new Set), this._children;
        }
        getInterruptedCause() {
            return this.getFiberRef(Lw);
        }
        fiberRefs() {
            return this.ask((e)=>e.getFiberRefs());
        }
        ask(e) {
            return Rt(()=>{
                const n = zg(this._fiberId);
                return this.tell(A_((r, s)=>{
                    Wv(n, $e(()=>e(r, s)));
                })), la(n);
            });
        }
        tell(e) {
            this._queue.push(e), this._running || (this._running = !0, this.drainQueueLaterOnExecutor());
        }
        get await() {
            return za((e)=>{
                const n = (r)=>e(Ke(r));
                if (this._exitValue !== null) {
                    n(this._exitValue);
                    return;
                }
                return this.tell(A_((r, s)=>{
                    r._exitValue !== null ? n(this._exitValue) : r.addObserver(n);
                })), $e(()=>this.tell(A_((r, s)=>{
                        r.removeObserver(n);
                    })));
            }, this.id());
        }
        get inheritAll() {
            return fn((e, n)=>{
                const r = e.id(), s = e.getFiberRefs(), i = n.runtimeFlags, o = this.getFiberRefs(), a = $Se(s, r, o);
                e.setFiberRefs(a);
                const c = e.getFiberRef(gN), l = V(cd(i, c), xR(Fp), xR(P6));
                return Qq(l);
            });
        }
        get poll() {
            return $e(()=>Mp(this._exitValue));
        }
        unsafePoll() {
            return this._exitValue;
        }
        interruptAsFork(e) {
            return $e(()=>this.tell(V8(Go(e))));
        }
        unsafeInterruptAsFork(e) {
            this.tell(V8(Go(e)));
        }
        addObserver(e) {
            this._exitValue !== null ? e(this._exitValue) : this._observers.push(e);
        }
        removeObserver(e) {
            this._observers = this._observers.filter((n)=>n !== e);
        }
        getFiberRefs() {
            return this.setFiberRef(gN, this.currentRuntimeFlags), this._fiberRefs;
        }
        unsafeDeleteFiberRef(e) {
            this._fiberRefs = RW(this._fiberRefs, e);
        }
        getFiberRef(e) {
            return this._fiberRefs.locals.has(e) ? this._fiberRefs.locals.get(e)[0][1] : e.initial;
        }
        setFiberRef(e, n) {
            this._fiberRefs = H6(this._fiberRefs, {
                fiberId: this._fiberId,
                fiberRef: e,
                value: n
            }), this.refreshRefCache();
        }
        refreshRefCache() {
            this.currentDefaultServices = this.getFiberRef(bp), this.currentTracer = this.currentDefaultServices.unsafeMap.get(hE.key), this.currentSupervisor = this.getFiberRef(eTe), this.currentScheduler = this.getFiberRef(AE), this.currentContext = this.getFiberRef(ba), this.currentSpan = this.currentContext.unsafeMap.get(Zv.key);
        }
        setFiberRefs(e) {
            this._fiberRefs = e, this.refreshRefCache();
        }
        addChild(e) {
            this.getChildren().add(e);
        }
        removeChild(e) {
            this.getChildren().delete(e);
        }
        transferChildren(e) {
            const n = this._children;
            if (this._children = null, n !== null && n.size > 0) for (const r of n)r._exitValue === null && e.add(this.currentRuntimeFlags, r);
        }
        drainQueueOnCurrentThread() {
            let e = !0;
            for(; e;){
                let n = Sb;
                const r = globalThis[sf];
                globalThis[sf] = this;
                try {
                    for(; n === Sb;)n = this._queue.length === 0 ? Pke : this.evaluateMessageWhileSuspended(this._queue.splice(0, 1)[0]);
                } finally{
                    this._running = !1, globalThis[sf] = r;
                }
                this._queue.length > 0 && !this._running ? (this._running = !0, n === dN ? (this.drainQueueLaterOnExecutor(), e = !1) : e = !0) : e = !1;
            }
        }
        drainQueueLaterOnExecutor() {
            this.currentScheduler.scheduleTask(this.run, this.getFiberRef(Fg), this);
        }
        drainQueueWhileRunning(e, n) {
            let r = n;
            for(; this._queue.length > 0;){
                const s = this._queue.splice(0, 1)[0];
                r = Mke[s._tag](this, e, r, s);
            }
            return r;
        }
        isInterrupted() {
            return !i5e(this.getFiberRef(Lw));
        }
        addInterruptedCause(e) {
            const n = this.getFiberRef(Lw);
            this.setFiberRef(Lw, xs(n, e));
        }
        processNewInterruptSignal(e) {
            this.addInterruptedCause(e), this.sendInterruptSignalToAllChildren();
        }
        sendInterruptSignalToAllChildren() {
            if (this._children === null || this._children.size === 0) return !1;
            let e = !1;
            for (const n of this._children)n.tell(V8(Go(this.id()))), e = !0;
            return e;
        }
        interruptAllChildren() {
            if (this.sendInterruptSignalToAllChildren()) {
                const e = this._children.values();
                this._children = null;
                let n = !1;
                return tE({
                    while: ()=>!n,
                    body: ()=>{
                        const s = e.next();
                        return s.done ? $e(()=>{
                            n = !0;
                        }) : Mi(s.value.await);
                    },
                    step: ()=>{}
                });
            }
            return null;
        }
        reportExitValue(e) {
            if (wR(this.currentRuntimeFlags)) {
                const n = this.getFiberRef(N6), r = this.id().startTimeMillis, s = Date.now();
                switch(Ake.unsafeUpdate(s - r, n), uN.unsafeUpdate(-1, n), e._tag){
                    case As:
                        {
                            Eke.unsafeUpdate(1, n);
                            break;
                        }
                    case Is:
                        {
                            Ike.unsafeUpdate(1, n);
                            break;
                        }
                }
            }
            if (e._tag === "Failure") {
                const n = this.getFiberRef(Q5e);
                !Av(e.cause) && n._tag === "Some" && this.log("Fiber terminated with an unhandled error", e.cause, n);
            }
        }
        setExitValue(e) {
            this._exitValue = e, this.reportExitValue(e);
            for(let n = this._observers.length - 1; n >= 0; n--)this._observers[n](e);
            this._observers = [];
        }
        getLoggers() {
            return this.getFiberRef(Lke);
        }
        log(e, n, r) {
            const s = gr(r) ? r.value : this.getFiberRef(X5e), i = this.getFiberRef(Vke);
            if (i4e(i, s)) return;
            const o = this.getFiberRef(G5e), a = this.getFiberRef($5e), c = this.getLoggers(), l = this.getFiberRefs();
            if (Kh(c) > 0) {
                const u = Pc(this.getFiberRef(bp), Hg), d = new Date(u.unsafeCurrentTimeMillis());
                Hwe(l, ()=>{
                    for (const f of c)f.log({
                        fiberId: this.id(),
                        logLevel: s,
                        message: e,
                        cause: n,
                        context: l,
                        spans: o,
                        annotations: a,
                        date: d
                    });
                });
            }
        }
        evaluateMessageWhileSuspended(e) {
            switch(e._tag){
                case RE:
                    return dN;
                case PE:
                    return this.processNewInterruptSignal(e.cause), this._asyncInterruptor !== null && (this._asyncInterruptor(Jn(e.cause)), this._asyncInterruptor = null), Sb;
                case ME:
                    return this._asyncInterruptor = null, this._asyncBlockingOn = null, this.evaluateEffect(e.effect), Sb;
                case OE:
                    return e.onFiber(this, this._exitValue !== null ? c7e : l7e(this.currentRuntimeFlags, this._asyncBlockingOn)), Sb;
                default:
                    return Uw(e);
            }
        }
        evaluateEffect(e) {
            this.currentSupervisor.onResume(this);
            try {
                let n = Gu(this.currentRuntimeFlags) && this.isInterrupted() ? Jn(this.getInterruptedCause()) : e;
                for(; n !== null;){
                    const r = n, s = this.runLoop(r);
                    if (s === ll) {
                        const i = ul.currentOp;
                        ul.currentOp = null, i._op === k_ ? V9e(this.currentRuntimeFlags) ? (this.tell(z7e()), this.tell(mh(ei)), n = null) : n = ei : i._op === bm && (n = null);
                    } else {
                        this.currentRuntimeFlags = V(this.currentRuntimeFlags, B9e(P6));
                        const i = this.interruptAllChildren();
                        i !== null ? n = Me(i, ()=>s) : (this._queue.length === 0 ? this.setExitValue(s) : this.tell(mh(s)), n = null);
                    }
                }
            } finally{
                this.currentSupervisor.onSuspend(this);
            }
        }
        start(e) {
            if (this._running) this.tell(mh(e));
            else {
                this._running = !0;
                const n = globalThis[sf];
                globalThis[sf] = this;
                try {
                    this.evaluateEffect(e);
                } finally{
                    this._running = !1, globalThis[sf] = n, this._queue.length > 0 && this.drainQueueLaterOnExecutor();
                }
            }
        }
        startFork(e) {
            this.tell(mh(e));
        }
        patchRuntimeFlags(e, n) {
            const r = $h(e, n);
            return globalThis[sf] = this, this.currentRuntimeFlags = r, r;
        }
        initiateAsync(e, n) {
            let r = !1;
            const s = (i)=>{
                r || (r = !0, this.tell(mh(i)));
            };
            Gu(e) && (this._asyncInterruptor = s);
            try {
                n(s);
            } catch (i) {
                s(kr(Ti(i)));
            }
        }
        pushStack(e) {
            this._stack.push(e), e._op === "OnStep" && this._steps.push({
                refs: this.getFiberRefs(),
                flags: this.currentRuntimeFlags
            });
        }
        popStack() {
            const e = this._stack.pop();
            if (e) return e._op === "OnStep" && this._steps.pop(), e;
        }
        getNextSuccessCont() {
            let e = this.popStack();
            for(; e;){
                if (e._op !== S_) return e;
                e = this.popStack();
            }
        }
        getNextFailCont() {
            let e = this.popStack();
            for(; e;){
                if (e._op !== w2 && e._op !== x2 && e._op !== mm) return e;
                e = this.popStack();
            }
        }
        [jwe](e) {
            return $e(()=>Wj(this.currentContext, e));
        }
        Left(e) {
            return Tr(e.left);
        }
        None(e) {
            return Tr(new Lv);
        }
        Right(e) {
            return Nr(e.right);
        }
        Some(e) {
            return Nr(e.value);
        }
        Micro(e) {
            return ey((n)=>{
                let r = n;
                const s = F7e(O7e(e, this.currentContext));
                return s.addObserver((i)=>{
                    if (i._tag === "Success") return r(Nr(i.value));
                    switch(i.cause._tag){
                        case "Interrupt":
                            return r(Jn(Go(B0)));
                        case "Fail":
                            return r(Tr(i.cause.error));
                        case "Die":
                            return r(Ol(i.cause.defect));
                    }
                }), ey((i)=>{
                    r = (o)=>{
                        i(mn);
                    }, s.unsafeInterrupt();
                });
            });
        }
        [UH](e) {
            const n = js(()=>e.effect_instruction_i0()), r = this.getNextSuccessCont();
            return r !== void 0 ? (r._op in kb || Uw(r), kb[r._op](this, r, n)) : (ul.currentOp = Nr(n), ll);
        }
        [As](e) {
            const n = e, r = this.getNextSuccessCont();
            return r !== void 0 ? (r._op in kb || Uw(r), kb[r._op](this, r, n.effect_instruction_i0)) : (ul.currentOp = n, ll);
        }
        [Is](e) {
            const n = e.effect_instruction_i0, r = this.getNextFailCont();
            if (r !== void 0) switch(r._op){
                case S_:
                case _2:
                    return Gu(this.currentRuntimeFlags) && this.isInterrupted() ? Jn(vR(n)) : js(()=>r.effect_instruction_i1(n));
                case "OnStep":
                    return Gu(this.currentRuntimeFlags) && this.isInterrupted() ? Jn(vR(n)) : Nr(Jn(n));
                case nC:
                    return this.patchRuntimeFlags(this.currentRuntimeFlags, r.patch), Gu(this.currentRuntimeFlags) && this.isInterrupted() ? Jn(xs(n, this.getInterruptedCause())) : Jn(n);
                default:
                    Uw(r);
            }
            else return ul.currentOp = Jn(n), ll;
        }
        [HH](e) {
            return js(()=>e.effect_instruction_i0(this, oK(this.currentRuntimeFlags)));
        }
        Blocked(e) {
            const n = this.getFiberRefs(), r = this.currentRuntimeFlags;
            if (this._steps.length > 0) {
                const s = [], i = this._steps[this._steps.length - 1];
                let o = this.popStack();
                for(; o && o._op !== "OnStep";)s.push(o), o = this.popStack();
                this.setFiberRefs(i.refs), this.currentRuntimeFlags = i.flags;
                const a = sy(i.refs, n), c = cd(i.flags, r);
                return Nr(Wq(e.effect_instruction_i0, fn((l)=>{
                    for(; s.length > 0;)l.pushStack(s.pop());
                    return l.setFiberRefs(iy(l.id(), l.getFiberRefs())(a)), l.currentRuntimeFlags = $h(c)(l.currentRuntimeFlags), e.effect_instruction_i1;
                })));
            }
            return Eo((s)=>Me(LE(S5e(e.effect_instruction_i0)), ()=>s(e.effect_instruction_i1)));
        }
        RunBlocked(e) {
            return Rke(e.effect_instruction_i0);
        }
        [wg](e) {
            const n = e.effect_instruction_i0, r = this.currentRuntimeFlags, s = $h(r, n);
            if (Gu(s) && this.isInterrupted()) return Jn(this.getInterruptedCause());
            if (this.patchRuntimeFlags(this.currentRuntimeFlags, n), e.effect_instruction_i1) {
                const i = cd(s, r);
                return this.pushStack(new k5e(i, e)), js(()=>e.effect_instruction_i1(r));
            } else return ei;
        }
        [w2](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        OnStep(e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [S_](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [_2](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [bm](e) {
            return this._asyncBlockingOn = e.effect_instruction_i1, this.initiateAsync(this.currentRuntimeFlags, e.effect_instruction_i0), ul.currentOp = e, ll;
        }
        [k_](e) {
            return this._isYielding = !1, ul.currentOp = e, ll;
        }
        [x2](e) {
            const n = e.effect_instruction_i0, r = e.effect_instruction_i1;
            return n() ? (this.pushStack(e), r()) : ei;
        }
        [mm](e) {
            return kb[mm](this, e, void 0);
        }
        [iv](e) {
            return js(()=>e.commit());
        }
        runLoop(e) {
            let n = e;
            for(this.currentOpCount = 0;;){
                if ((this.currentRuntimeFlags & N9e) !== 0 && this.currentSupervisor.onEffect(this, n), this._queue.length > 0 && (n = this.drainQueueWhileRunning(this.currentRuntimeFlags, n)), !this._isYielding) {
                    this.currentOpCount += 1;
                    const r = this.currentScheduler.shouldYield(this);
                    if (r !== !1) {
                        this._isYielding = !0, this.currentOpCount = 0;
                        const s = n;
                        n = Me(Vv({
                            priority: r
                        }), ()=>s);
                    }
                }
                try {
                    if (n = this.currentTracer.context(()=>{
                        if (Nke !== n[q0]._V) {
                            const r = this.getFiberRef(e8e);
                            if (r._tag === "Some") {
                                const s = n[q0]._V;
                                this.log(`Executing an Effect versioned ${s} with a Runtime of version ${rC()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`, su, r);
                            }
                        }
                        return this[n._op](n);
                    }, this), n === ll) {
                        const r = ul.currentOp;
                        return r._op === k_ || r._op === bm ? ll : (ul.currentOp = null, r._op === As || r._op === Is ? r : Jn(Ti(r)));
                    }
                } catch (r) {
                    n !== ll && !Ft(n, "_op") || !(n._op in this) ? n = Zq(`Not a valid effect: ${I0(n)}`) : a8e(r) ? n = Jn(xs(Ti(r), Go(B0))) : n = Ol(r);
                }
            }
        }
        run = ()=>{
            this.drainQueueOnCurrentThread();
        };
    }
    const Vke = Xt("effect/FiberRef/currentMinimumLogLevel", ()=>Ss(o4e("Info"))), Dke = (t)=>NE((e)=>{
            const n = VW(e.context, bp);
            Pc(n, pE).unsafe.log(t.log(e));
        }), Bke = Xt(Symbol.for("effect/Logger/defaultLogger"), ()=>Dke(s6e)), Fke = Xt(Symbol.for("effect/Logger/tracerLogger"), ()=>NE(({ annotations: t, cause: e, context: n, fiberId: r, logLevel: s, message: i })=>{
            const o = xE(Vp(ny(n, ba), Zv));
            if (o._tag === "None" || o.value._tag === "ExternalSpan") return;
            const a = Wj(ny(n, bp), Hg), c = {};
            for (const [l, u] of t)c[l] = u;
            c["effect.fiberId"] = y3e(r), c["effect.logLevel"] = s.label, e !== null && e._tag !== "Empty" && (c["effect.cause"] = Mg(e, {
                renderErrorCause: !0
            })), o.value.event(I0(Array.isArray(i) && i.length === 1 ? i[0] : i), a.unsafeCurrentTimeNanos(), c);
        })), Lke = Xt(Symbol.for("effect/FiberRef/currentLoggers"), ()=>q5e(FC(Bke, Fke))), LK = j((t)=>Kc(t[0]), (t, e)=>Up($0(t, (n)=>zke((r)=>e(n, r))))), zke = (t)=>fn((e)=>{
            const n = e.getFiberRefs(), r = D9e(e.currentRuntimeFlags, Fp);
            return Me(HK, (s)=>V2(s, (i)=>fn((o)=>{
                        const a = o.getFiberRefs(), c = o.currentRuntimeFlags, l = sy(a, n), u = cd(c, r), d = sy(n, a);
                        return o.setFiberRefs(iy(l, o.id(), n)), J0(R5e(t(i), u), $e(()=>{
                            o.setFiberRefs(iy(d, o.id(), o.getFiberRefs()));
                        }));
                    })));
        }), Uke = (t)=>{
        if (Array.isArray(t) || OH(t)) return [
            t,
            Fe()
        ];
        const e = Object.keys(t), n = e.length;
        return [
            e.map((r)=>t[r]),
            ze((r)=>{
                const s = {};
                for(let i = 0; i < n; i++)s[e[i]] = r[i];
                return s;
            })
        ];
    }, Hke = (t, e, n)=>{
        const r = [];
        for (const s of t)r.push(K0(s));
        return Me(Z0(r, Ht, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            concurrentFinalizers: n?.concurrentFinalizers
        }), (s)=>{
            const i = Fe(), o = s.length, a = new Array(o), c = new Array(o);
            let l = !1;
            for(let u = 0; u < o; u++){
                const d = s[u];
                d._tag === "Left" ? (a[u] = ze(d.left), l = !0) : (c[u] = d.right, a[u] = i);
            }
            return l ? e._tag === "Some" ? Tr(e.value(a)) : Tr(a) : n?.discard ? mn : e._tag === "Some" ? Ke(e.value(c)) : Ke(c);
        });
    }, jke = (t, e, n)=>{
        const r = [];
        for (const s of t)r.push(K0(s));
        return n?.discard ? Z0(r, Ht, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            discard: !0,
            concurrentFinalizers: n?.concurrentFinalizers
        }) : Pt(Z0(r, Ht, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            concurrentFinalizers: n?.concurrentFinalizers
        }), (s)=>e._tag === "Some" ? e.value(s) : s);
    }, BE = (t, e)=>{
        const [n, r] = Uke(t);
        return e?.mode === "validate" ? Hke(n, r, e) : e?.mode === "either" ? jke(n, r, e) : e?.discard !== !0 && r._tag === "Some" ? Pt(Z0(n, Ht, e), r.value) : Z0(n, Ht, e);
    }, Z0 = j((t)=>OH(t[0]), (t, e, n)=>fn((r)=>{
            const s = n?.batching === !0 || n?.batching === "inherit" && r.getFiberRef(Y5e);
            return n?.discard ? iN(n.concurrency, ()=>yh(L2, n?.concurrentFinalizers)((i)=>s ? Ba(t, (o, a)=>i(e(o, a)), !0, !1, 1) : Rv(t, (o, a)=>i(e(o, a)))), ()=>yh($6, n?.concurrentFinalizers)((i)=>Ba(t, (o, a)=>i(e(o, a)), s, !1)), (i)=>yh(X6(i), n?.concurrentFinalizers)((o)=>Ba(t, (a, c)=>o(e(a, c)), s, !1, i))) : iN(n?.concurrency, ()=>yh(L2, n?.concurrentFinalizers)((i)=>s ? ok(t, 1, (o, a)=>i(e(o, a)), !0) : Ml(t, (o, a)=>i(e(o, a)))), ()=>yh($6, n?.concurrentFinalizers)((i)=>FE(t, (o, a)=>i(e(o, a)), s)), (i)=>yh(X6(i), n?.concurrentFinalizers)((o)=>ok(t, i, (a, c)=>o(e(a, c)), s)));
        })), FE = (t, e, n)=>Rt(()=>{
            const r = Un(t), s = new Array(r.length);
            return Wr(Ba(r, (o, a)=>Me(e(o, a), (c)=>$e(()=>s[a] = c)), n, !1), Ke(s));
        }), Ba = (t, e, n, r, s)=>Eo((i)=>P5e((o)=>fn((a)=>{
                    let c = Array.from(t).reverse(), l = c.length;
                    if (l === 0) return mn;
                    let u = 0, d = !1;
                    const f = s ? Math.min(c.length, s) : c.length, p = new Set, h = new Array, m = ()=>p.forEach((X)=>{
                            X.currentScheduler.scheduleTask(()=>{
                                X.unsafeInterruptAsFork(a.id());
                            }, 0, X);
                        }), w = new Array, v = new Array, k = new Array, _ = ()=>{
                        const X = h.filter(({ exit: G })=>G._tag === "Failure").sort((G, ce)=>G.index < ce.index ? -1 : G.index === ce.index ? 0 : 1).map(({ exit: G })=>G);
                        return X.length === 0 && X.push(ei), X;
                    }, A = (X, G = !1)=>{
                        const ce = Up(o(X)), ie = qke(ce, a, a.currentRuntimeFlags, p1);
                        return a.currentScheduler.scheduleTask(()=>{
                            G && ie.unsafeInterruptAsFork(a.id()), ie.resume(ce);
                        }, 0, ie), ie;
                    }, P = ()=>{
                        r || (l -= c.length, c = []), d = !0, m();
                    }, U = n ? E5e : Oc, K = A(za((X)=>{
                        const G = (ie, Y)=>{
                            ie._op === "Blocked" ? k.push(ie) : (h.push({
                                index: Y,
                                exit: ie
                            }), ie._op === "Failure" && !d && P());
                        }, ce = ()=>{
                            if (c.length > 0) {
                                const ie = c.pop();
                                let Y = u++;
                                const M = ()=>{
                                    const R = c.pop();
                                    return Y = u++, Me(Vv(), ()=>Me(U(i(e(R, Y))), g));
                                }, g = (R)=>c.length > 0 && (G(R, Y), c.length > 0) ? M() : Ke(R), y = Me(U(i(e(ie, Y))), g), C = A(y);
                                w.push(C), p.add(C), d && C.currentScheduler.scheduleTask(()=>{
                                    C.unsafeInterruptAsFork(a.id());
                                }, 0, C), C.addObserver((R)=>{
                                    let N;
                                    if (R._op === "Failure" ? N = R : N = R.effect_instruction_i0, v.push(C), p.delete(C), G(N, Y), h.length === l) X(Ke(Pr(Xh(_(), {
                                        parallel: !0
                                    }), ()=>ei)));
                                    else if (k.length + h.length === l) {
                                        const L = _(), z = k.map((B)=>B.effect_instruction_i0).reduce(Rq);
                                        X(Ke(Wq(z, Ba([
                                            Pr(Xh(L, {
                                                parallel: !0
                                            }), ()=>ei),
                                            ...k.map((B)=>B.effect_instruction_i1)
                                        ], (B)=>B, n, !0, s))));
                                    } else ce();
                                });
                            }
                        };
                        for(let ie = 0; ie < f; ie++)ce();
                    }));
                    return Mi(kd(Vg(i(oy(K))), Hv({
                        onFailure: (X)=>{
                            P();
                            const G = k.length + 1, ce = Math.min(typeof s == "number" ? s : k.length, k.length), ie = Array.from(k);
                            return za((Y)=>{
                                let M = 0, g = 0;
                                const y = (R, N)=>(L)=>{
                                        M++, M === G && Y(Nr(Jn(X))), ie.length > 0 && N && C();
                                    }, C = ()=>{
                                    A(ie.pop(), !0).addObserver(y(g, !0)), g++;
                                };
                                K.addObserver(y(g, !1)), g++;
                                for(let R = 0; R < ce; R++)C();
                            });
                        },
                        onSuccess: ()=>Ml(v, (X)=>X.inheritAll)
                    })));
                }))), ok = (t, e, n, r)=>Rt(()=>{
            const s = Un(t), i = new Array(s.length);
            return Wr(Ba(s, (a, c)=>Pt(n(a, c), (l)=>i[c] = l), r, !1, e), Ke(i));
        }), LE = (t)=>Wke(t, p1), zK = (t, e, n, r = null)=>{
        const s = $2(t, e, n, r);
        return s.resume(t), s;
    }, qke = (t, e, n, r = null)=>$2(t, e, n, r), $2 = (t, e, n, r = null)=>{
        const s = yq(), i = e.getFiberRefs(), o = XSe(i, s), a = new FK(s, o, n), c = ny(o, ba), l = a.currentSupervisor;
        return l.onStart(c, t, ze(e), a), a.addObserver((d)=>l.onEnd(d, a)), (r !== null ? r : V(e.getFiberRef(V6), Pr(()=>e.scope()))).add(n, a), a;
    }, Wke = (t, e)=>fn((n, r)=>Ke(zK(t, n, r.runtimeFlags, e))), fN = (t)=>Hp((e)=>dn(Vp(e, Ua), {
                onNone: ()=>t,
                onSome: (n)=>{
                    switch(n.strategy._tag){
                        case "Parallel":
                            return t;
                        case "Sequential":
                        case "ParallelN":
                            return Me(Cl(n, $6), (r)=>Wg(t, r));
                    }
                }
            })), pN = (t)=>(e)=>Hp((n)=>dn(Vp(n, Ua), {
                    onNone: ()=>e,
                    onSome: (r)=>r.strategy._tag === "ParallelN" && r.strategy.parallelism === t ? e : Me(Cl(r, X6(t)), (s)=>Wg(e, s))
                })), yh = (t, e)=>(n)=>Hp((r)=>dn(Vp(r, Ua), {
                    onNone: ()=>n(Ht),
                    onSome: (s)=>{
                        if (e === !0) {
                            const i = t._tag === "Parallel" ? fN : t._tag === "Sequential" ? hN : pN(t.parallelism);
                            switch(s.strategy._tag){
                                case "Parallel":
                                    return i(n(fN));
                                case "Sequential":
                                    return i(n(hN));
                                case "ParallelN":
                                    return i(n(pN(s.strategy.parallelism)));
                            }
                        } else return n(Ht);
                    }
                })), zE = (t)=>Me(Ua, t), UK = (t)=>Me(qg(), (e)=>kd(t(e), (n)=>e.close(n))), Kke = (t)=>Me(qg(), (e)=>Yke(t, e)), hN = (t)=>Hp((e)=>dn(Vp(e, Ua), {
                onNone: ()=>t,
                onSome: (n)=>{
                    switch(n.strategy._tag){
                        case "Sequential":
                            return t;
                        case "Parallel":
                        case "ParallelN":
                            return Me(Cl(n, L2), (r)=>Wg(t, r));
                    }
                }
            })), $ke = j((t)=>Kc(t[1]), (t, e, n)=>m1(t, e, (r, s)=>[
                r,
                s
            ], n)), Xke = j((t)=>Kc(t[1]), (t, e, n)=>n?.concurrent !== !0 && (n?.batching === void 0 || n.batching === !1) ? Bv(t, e) : m1(t, e, (r, s)=>r, n)), Gke = j((t)=>Kc(t[1]), (t, e, n)=>n?.concurrent !== !0 && (n?.batching === void 0 || n.batching === !1) ? Wr(t, e) : m1(t, e, (r, s)=>s, n)), m1 = j((t)=>Kc(t[1]), (t, e, n, r)=>Pt(BE([
            t,
            e
        ], {
            concurrency: r?.concurrent ? 2 : 1,
            batching: r?.batching,
            concurrentFinalizers: r?.concurrentFinalizers
        }), ([s, i])=>n(s, i))), Ua = Wc("effect/Scope"), HK = Ua, Zke = (t, e)=>{
        t.state._tag === "Open" && t.state.finalizers.set({}, e);
    }, Jke = {
        [ER]: ER,
        [IR]: IR,
        pipe () {
            return St(this, arguments);
        },
        fork (t) {
            return $e(()=>{
                const e = jK(t);
                if (this.state._tag === "Closed") return e.state = this.state, e;
                const n = {}, r = (s)=>e.close(s);
                return this.state.finalizers.set(n, r), Zke(e, (s)=>$e(()=>{
                        this.state._tag === "Open" && this.state.finalizers.delete(n);
                    })), e;
            });
        },
        close (t) {
            return Rt(()=>{
                if (this.state._tag === "Closed") return mn;
                const e = Array.from(this.state.finalizers.values()).reverse();
                return this.state = {
                    _tag: "Closed",
                    exit: t
                }, e.length === 0 ? mn : Y4e(this.strategy) ? V(Ml(e, (n)=>Oc(n(t))), Me((n)=>V(Xh(n), Ac(M8), Pr(()=>ei)))) : Q4e(this.strategy) ? V(FE(e, (n)=>Oc(n(t)), !1), Me((n)=>V(Xh(n, {
                        parallel: !0
                    }), Ac(M8), Pr(()=>ei)))) : V(ok(e, this.strategy.parallelism, (n)=>Oc(n(t)), !1), Me((n)=>V(Xh(n, {
                        parallel: !0
                    }), Ac(M8), Pr(()=>ei))));
            });
        },
        addFinalizer (t) {
            return Rt(()=>this.state._tag === "Closed" ? t(this.state.exit) : (this.state.finalizers.set({}, t), mn));
        }
    }, jK = (t = ld)=>{
        const e = Object.create(Jke);
        return e.strategy = t, e.state = {
            _tag: "Open",
            finalizers: new Map
        }, e;
    }, qg = (t = ld)=>$e(()=>jK(t)), Wg = j(2, (t, e)=>hW(t, Tg(mv(Ua, e)))), Yke = j(2, (t, e)=>V(t, Wg(e), kd((n)=>e.close(n)))), Qke = (t)=>Bg(t, {
            differ: Tke,
            fork: vm
        }), gN = K5e(F9e), eTe = Qke(r3), qK = j(3, (t, e, n)=>KK(t, e, {
            onSelfWin: (r, s)=>Me(r.await, (i)=>{
                    switch(i._tag){
                        case As:
                            return Me(r.inheritAll, ()=>n.onSelfDone(i, s));
                        case Is:
                            return n.onSelfDone(i, s);
                    }
                }),
            onOtherWin: (r, s)=>Me(r.await, (i)=>{
                    switch(i._tag){
                        case As:
                            return Me(r.inheritAll, ()=>n.onOtherDone(i, s));
                        case Is:
                            return n.onOtherDone(i, s);
                    }
                })
        })), WK = j(2, (t, e)=>Ng((n)=>qK(t, e, {
                onSelfDone: (r, s)=>F6(r, {
                        onFailure: (i)=>V(oy(s), QR((o)=>iu(i, o))),
                        onSuccess: (i)=>V(s, Rl(n), vs(i))
                    }),
                onOtherDone: (r, s)=>F6(r, {
                        onFailure: (i)=>V(oy(s), QR((o)=>iu(o, i))),
                        onSuccess: (i)=>V(s, Rl(n), vs(i))
                    })
            }))), KK = j(3, (t, e, n)=>fn((r, s)=>{
            const i = s.runtimeFlags, o = Dp(!0), a = $2(t, r, i, n.selfScope), c = $2(e, r, i, n.otherScope);
            return za((l)=>{
                a.addObserver(()=>bN(a, c, n.onSelfWin, o, l)), c.addObserver(()=>bN(c, a, n.onOtherWin, o, l)), a.startFork(t), c.startFork(e);
            }, g3e(a.id(), c.id()));
        })), bN = (t, e, n, r, s)=>{
        c3e(!0, !1)(r) && s(n(t, e));
    }, J0 = j(2, (t, e)=>Eo((n)=>Ii(n(t), {
                onFailure: (r)=>Ii(e, {
                        onFailure: (s)=>kr(xs(r, s)),
                        onSuccess: ()=>kr(r)
                    }),
                onSuccess: (r)=>vs(e, r)
            }))), tTe = (t, e, n)=>Ng((r)=>Me(Me(LE(c1(t)), (s)=>za((i)=>{
                    const o = e.map((l)=>l.listeners.count), a = ()=>{
                        o.every((l)=>l === 0) && e.every((l)=>l.result.state.current._tag === "Pending" ? !0 : !!(l.result.state.current._tag === "Done" && Uv(l.result.state.current.effect) && l.result.state.current.effect._tag === "Failure" && Lq(l.result.state.current.effect.cause))) && (c.forEach((l)=>l()), n?.(), i(Fv(s)));
                    };
                    s.addObserver((l)=>{
                        c.forEach((u)=>u()), i(l);
                    });
                    const c = e.map((l, u)=>{
                        const d = (f)=>{
                            o[u] = f, a();
                        };
                        return l.listeners.addObserver(d), ()=>l.listeners.removeObserver(d);
                    });
                    return a(), $e(()=>{
                        c.forEach((l)=>l());
                    });
                })), ()=>Rt(()=>{
                    const s = e.flatMap((i)=>i.state.completed ? [] : [
                            i
                        ]);
                    return Rv(s, (i)=>mke(i.request, fW(r)));
                }))), UE = Sd, ak = Ti, nTe = Go, rTe = s5e, sTe = jC, ay = Lq, D8 = Av, iTe = WC, y1 = KC, $K = a5e, s3 = Uq, XK = r8e, oTe = c8e, aTe = Mg, cTe = "effect/ScheduleInterval", X2 = Symbol.for(cTe), GK = {
        [X2]: X2,
        startMillis: 0,
        endMillis: 0
    }, HE = (t, e)=>t > e ? GK : {
            [X2]: X2,
            startMillis: t,
            endMillis: e
        }, lTe = j(2, (t, e)=>uTe(t, e) === t), uTe = j(2, (t, e)=>t.endMillis <= e.startMillis ? t : e.endMillis <= t.startMillis ? e : t.startMillis < e.startMillis ? t : e.startMillis < t.startMillis ? e : t.endMillis <= e.endMillis ? t : e), dTe = (t)=>t.startMillis >= t.endMillis, fTe = j(2, (t, e)=>{
        const n = Math.max(t.startMillis, e.startMillis), r = Math.min(t.endMillis, e.endMillis);
        return HE(n, r);
    }), pTe = (t)=>ls(t.endMillis - t.startMillis), hTe = (t)=>HE(t, Number.POSITIVE_INFINITY), mN = HE, ZK = GK, gTe = lTe, bTe = dTe, mTe = fTe, yTe = pTe, ck = hTe, wTe = "effect/ScheduleIntervals", yN = Symbol.for(wTe), JK = (t)=>({
            [yN]: yN,
            intervals: t
        }), _Te = j(2, (t, e)=>xTe(t.intervals, e.intervals, En())), xTe = (t, e, n)=>{
        let r = t, s = e, i = n;
        for(; ca(r) && ca(s);){
            const o = V(Cc(r), mTe(Cc(s))), a = bTe(o) ? i : V(i, Rs(o));
            V(Cc(r), gTe(Cc(s))) ? r = Pl(r) : s = Pl(s), i = a;
        }
        return JK(ru(i));
    }, lk = (t)=>V(t.intervals, wv, Pr(()=>ZK)).startMillis, vTe = (t)=>V(t.intervals, wv, Pr(()=>ZK)).endMillis, STe = j(2, (t, e)=>lk(t) < lk(e)), kTe = (t)=>ca(t.intervals), TTe = JK, CTe = _Te, uk = lk, dk = vTe, ETe = STe, ITe = kTe, jE = "Continue", YK = "Done", ATe = (t)=>({
            _tag: jE,
            intervals: t
        }), PTe = (t)=>({
            _tag: jE,
            intervals: TTe(Mn(t))
        }), OTe = {
        _tag: YK
    }, MTe = (t)=>t._tag === jE, RTe = (t)=>t._tag === YK, NTe = ATe, G2 = PTe, cy = OTe, wN = MTe, ly = RTe, Ha = Ua, uy = lW, VTe = V2, Id = X0, DTe = Wg, QK = Cl, Y0 = qg;
    class BTe {
        permits;
        waiters = new Set;
        taken = 0;
        constructor(e){
            this.permits = e;
        }
        get free() {
            return this.permits - this.taken;
        }
        take = (e)=>XC((n)=>{
                if (this.free < e) {
                    const r = ()=>{
                        this.free < e || (this.waiters.delete(r), n(Rt(()=>this.free < e ? this.take(e) : (this.taken += e, Ke(e)))));
                    };
                    return this.waiters.add(r), $e(()=>{
                        this.waiters.delete(r);
                    });
                }
                n(Rt(()=>this.free < e ? this.take(e) : (this.taken += e, Ke(e))));
            });
        updateTakenUnsafe(e, n) {
            return this.taken = n(this.taken), this.waiters.size > 0 && e.getFiberRef(AE).scheduleTask(()=>{
                const r = this.waiters.values();
                let s = r.next();
                for(; s.done === !1 && this.free > 0;)s.value(), s = r.next();
            }, e.getFiberRef(Fg), e), Ke(this.free);
        }
        updateTaken(e) {
            return fn((n)=>this.updateTakenUnsafe(n, e));
        }
        resize = (e)=>Mi(fn((n)=>(this.permits = e, this.free < 0 ? mn : this.updateTakenUnsafe(n, (r)=>r))));
        release = (e)=>this.updateTaken((n)=>n - e);
        releaseAll = this.updateTaken((e)=>0);
        withPermits = (e)=>(n)=>Eo((r)=>Me(r(this.take(e)), (s)=>J0(r(n), this.release(s))));
        withPermitsIfAvailable = (e)=>(n)=>Eo((r)=>Rt(()=>this.free < e ? B4e : (this.taken += e, J0(r(m4e(n)), this.release(e)))));
    }
    const qE = (t)=>new BTe(t), FTe = (t)=>$e(()=>qE(t));
    class LTe extends $c {
        isOpen;
        waiters = [];
        scheduled = !1;
        constructor(e){
            super(), this.isOpen = e;
        }
        commit() {
            return this.await;
        }
        unsafeSchedule(e) {
            return this.scheduled || this.waiters.length === 0 || (this.scheduled = !0, e.currentScheduler.scheduleTask(this.flushWaiters, e.getFiberRef(Fg), e)), mn;
        }
        flushWaiters = ()=>{
            this.scheduled = !1;
            const e = this.waiters;
            this.waiters = [];
            for(let n = 0; n < e.length; n++)e[n](ei);
        };
        open = fn((e)=>this.isOpen ? mn : (this.isOpen = !0, this.unsafeSchedule(e)));
        unsafeOpen() {
            this.isOpen || (this.isOpen = !0, this.flushWaiters());
        }
        release = fn((e)=>this.isOpen ? mn : this.unsafeSchedule(e));
        await = XC((e)=>this.isOpen ? e(mn) : (this.waiters.push(e), $e(()=>{
                const n = this.waiters.indexOf(e);
                n !== -1 && this.waiters.splice(n, 1);
            })));
        unsafeClose() {
            this.isOpen = !1;
        }
        close = $e(()=>{
            this.isOpen = !1;
        });
        whenOpen = (e)=>Wr(this.await, e);
    }
    const zTe = (t)=>new LTe(t ?? !1), WE = j(2, (t, e)=>fn((n, r)=>{
            const s = e, i = zK(t, n, r.runtimeFlags, p1);
            if (s.state._tag === "Open") {
                const o = ()=>Ng((c)=>jt(c, i.id()) ? mn : Mi(Fv(i))), a = {};
                s.state.finalizers.set(a, o), i.addObserver(()=>{
                    s.state._tag !== "Closed" && s.state.finalizers.delete(a);
                });
            } else i.unsafeInterruptAsFork(n.id());
            return Ke(i);
        })), UTe = (t)=>zE((e)=>WE(t, e)), HTe = j(2, (t, e)=>V(Oc(t), WK(Oc(e)), (n)=>Vg(n))), jTe = j(2, (t, e)=>qTe(t, {
            onTimeout: ()=>d8e(e),
            duration: e
        })), qTe = j(2, (t, { duration: e, onTimeout: n })=>Vg(WTe(t, {
            onTimeout: ()=>Rg(n),
            onSuccess: Ke,
            duration: e
        }))), WTe = j(2, (t, { duration: e, onSuccess: n, onTimeout: r })=>Ng((s)=>Eo((i)=>KK(i(t), c1(_E(e)), {
                    onSelfWin: (o, a)=>Me(o.await, (c)=>c._tag === "Success" ? Me(o.inheritAll, ()=>vs(Rl(a, s), n(c.value))) : Me(Rl(a, s), ()=>Jn(c.cause))),
                    onOtherWin: (o, a)=>Me(o.await, (c)=>c._tag === "Success" ? Me(o.inheritAll, ()=>vs(Rl(a, s), r())) : Me(Rl(a, s), ()=>Jn(c.cause))),
                    otherScope: p1
                })))), KTe = "effect/Ref/SynchronizedRef", e$ = Symbol.for(KTe), t$ = {
        _A: (t)=>t
    };
    class $Te extends $c {
        ref;
        withLock;
        [e$] = t$;
        [gE] = bE;
        [Ed] = Ed;
        constructor(e, n){
            super(), this.ref = e, this.withLock = n, this.get = xo(this.ref);
        }
        get;
        commit() {
            return this.get;
        }
        modify(e) {
            return this.modifyEffect((n)=>Ke(e(n)));
        }
        modifyEffect(e) {
            return this.withLock(V(Me(xo(this.ref), e), Me(([n, r])=>vs(jf(this.ref, r), n))));
        }
    }
    const n$ = (t)=>$e(()=>r$(t)), r$ = (t)=>{
        const e = mE(t), n = qE(1);
        return new $Te(e, n.withPermits(1));
    }, XTe = Symbol.for("effect/ManagedRuntime"), GTe = "Fold", ZTe = "Fresh", JTe = "FromEffect", YTe = "Scoped", QTe = "Suspend", eCe = "MergeAll", tCe = "ZipWith", s$ = Z7e, _N = J7e, Rc = Fv, nCe = Rl, Tf = oy, w1 = (t)=>function() {
            if (arguments.length === 1) {
                const e = arguments[0];
                return (n, ...r)=>t(e, n, ...r);
            }
            return t.apply(this, arguments);
        }, i3 = w1((t, e, n)=>{
        const r = yq(), s = [
            [
                ba,
                [
                    [
                        r,
                        t.context
                    ]
                ]
            ]
        ];
        n?.scheduler && s.push([
            AE,
            [
                [
                    r,
                    n.scheduler
                ]
            ]
        ]);
        let i = ZSe(t.fiberRefs, {
            entries: s,
            forkAs: r
        });
        n?.updateRefs && (i = n.updateRefs(i, r));
        const o = new FK(r, i, t.runtimeFlags);
        let a = e;
        n?.scope && (a = Me(QK(n.scope, ld), (l)=>Wr(lW(l, Ng((u)=>jt(u, o.id()) ? mn : Rl(o, u))), kd(e, (u)=>Id(l, u)))));
        const c = o.currentSupervisor;
        return c !== r3 && (c.onStart(t.context, a, Fe(), o), o.addObserver((l)=>c.onEnd(l, o))), p1.add(t.runtimeFlags, o), n?.immediate === !1 ? o.resume(a) : o.start(a), o;
    }), rCe = w1((t, e)=>{
        const n = aCe(t)(e);
        if (n._tag === "Failure") throw i$(n.effect_instruction_i0);
        return n.effect_instruction_i0;
    });
    class sCe extends Error {
        fiber;
        _tag = "AsyncFiberException";
        constructor(e){
            super(`Fiber #${e.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`), this.fiber = e, this.name = this._tag, this.stack = this.message;
        }
    }
    const iCe = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 0;
        const n = new sCe(t);
        return Error.stackTraceLimit = e, n;
    }, B8 = Symbol.for("effect/Runtime/FiberFailure"), Hw = Symbol.for("effect/Runtime/FiberFailure/Cause");
    class oCe extends Error {
        [B8];
        [Hw];
        constructor(e){
            const n = jq(e)[0];
            super(n?.message || "An error has occurred"), this[B8] = B8, this[Hw] = e, this.name = n ? `(FiberFailure) ${n.name}` : "FiberFailure", n?.stack && (this.stack = n.stack);
        }
        toJSON() {
            return {
                _id: "FiberFailure",
                cause: this[Hw].toJSON()
            };
        }
        toString() {
            return "(FiberFailure) " + Mg(this[Hw], {
                renderErrorCause: !0
            });
        }
        [Bn]() {
            return this.toString();
        }
    }
    const i$ = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 0;
        const n = new oCe(t);
        return Error.stackTraceLimit = e, n;
    }, o$ = (t)=>{
        const e = t;
        switch(e._op){
            case "Failure":
            case "Success":
                return e;
            case "Left":
                return B6(e.left);
            case "Right":
                return Nr(e.right);
            case "Some":
                return Nr(e.value);
            case "None":
                return B6(new Lv);
        }
    }, aCe = w1((t, e)=>{
        const n = o$(e);
        if (n) return n;
        const r = new bK, s = i3(t)(e, {
            scheduler: r
        });
        r.flush();
        const i = s.unsafePoll();
        return i || dW(GC(iCe(s), oE(s)));
    }), cCe = w1((t, e, n)=>a$(t, e, n).then((r)=>{
            switch(r._tag){
                case As:
                    return r.effect_instruction_i0;
                case Is:
                    throw i$(r.effect_instruction_i0);
            }
        })), a$ = w1((t, e, n)=>new Promise((r)=>{
            const s = o$(e);
            s && r(s);
            const i = i3(t)(e);
            i.addObserver((o)=>{
                r(o);
            }), n?.signal !== void 0 && (n.signal.aborted ? i.unsafeInterruptAsFork(i.id()) : n.signal.addEventListener("abort", ()=>{
                i.unsafeInterruptAsFork(i.id());
            }, {
                once: !0
            }));
        }));
    class c$ {
        context;
        runtimeFlags;
        fiberRefs;
        constructor(e, n, r){
            this.context = e, this.runtimeFlags = n, this.fiberRefs = r;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const lCe = (t)=>new c$(t.context, t.runtimeFlags, t.fiberRefs), uCe = ()=>fn((t, e)=>Ke(new c$(t.getFiberRef(ba), e.runtimeFlags, t.getFiberRefs()))), dCe = Oq(Fp, Aq, Iq), dy = lCe({
        context: Xm(),
        runtimeFlags: dCe,
        fiberRefs: JSe()
    }), fCe = i3(dy), pCe = cCe(dy), hCe = rCe(dy), gCe = j(2, (t, e)=>t.modifyEffect(e)), bCe = j(2, (t, e)=>t.modifyEffect((n)=>Pt(e(n), (r)=>[
                    void 0,
                    r
                ]))), mCe = "effect/Layer", l$ = Symbol.for(mCe), yCe = {
        _RIn: (t)=>t,
        _E: (t)=>t,
        _ROut: (t)=>t
    }, Kg = {
        [l$]: yCe,
        pipe () {
            return St(this, arguments);
        }
    }, wCe = "effect/Layer/MemoMap", F8 = Symbol.for(wCe), _Ce = Cg()("effect/Layer/CurrentMemoMap", {
        defaultValue: ()=>kCe()
    }), xCe = (t)=>Ft(t, l$), vCe = (t)=>t._op_layer === ZTe;
    class u$ {
        ref;
        [F8];
        constructor(e){
            this.ref = e, this[F8] = F8;
        }
        getOrElseMemoize(e, n) {
            return V(gCe(this.ref, (r)=>{
                const s = r.get(e);
                if (s !== void 0) {
                    const [i, o] = s, a = V(i, Me(([c, l])=>V(eK(c), vs(l))), kd(Hv({
                        onFailure: ()=>mn,
                        onSuccess: ()=>V2(n, o)
                    })));
                    return Ke([
                        a,
                        r
                    ]);
                }
                return V(B2(0), Me((i)=>V(Ug(), Me((o)=>V(B2(()=>mn), Pt((a)=>{
                            const c = Eo((u)=>V(qg(), Me((d)=>V(u(Me(d$(e, d, !0), (f)=>x4e(f(this)))), Oc, Me((f)=>{
                                        switch(f._tag){
                                            case Is:
                                                return V(pW(o, f.effect_instruction_i0), Wr(X0(d, f)), Wr(kr(f.effect_instruction_i0)));
                                            case As:
                                                return V(jf(a, (p)=>V(X0(d, p), l1(LW(i, (h)=>[
                                                            h === 1,
                                                            h - 1
                                                        ])), Mi)), Wr(F2(i, (p)=>p + 1)), Wr(V2(n, (p)=>V($e(()=>r.delete(e)), Wr(xo(a)), Me((h)=>h(p))))), Wr(d1(o, f.effect_instruction_i0)), vs(f.effect_instruction_i0[1]));
                                        }
                                    }))))), l = [
                                V(la(o), kd(F6({
                                    onFailure: ()=>mn,
                                    onSuccess: ()=>F2(i, (u)=>u + 1)
                                }))),
                                (u)=>V(xo(a), Me((d)=>d(u)))
                            ];
                            return [
                                c,
                                vCe(e) ? r : r.set(e, l)
                            ];
                        }))))));
            }), Vg);
        }
    }
    const SCe = Rt(()=>Pt(n$(new Map), (t)=>new u$(t))), kCe = ()=>new u$(r$(new Map)), KE = j(2, (t, e)=>Me(SCe, (n)=>TCe(t, n, e))), TCe = j(3, (t, e, n)=>Me(d$(t, n), (r)=>wE(r(e), _Ce, e))), d$ = (t, e, n = !1)=>{
        const r = t;
        switch(r._op_layer){
            case "Locally":
                return $e(()=>(s)=>r.f(s.getOrElseMemoize(r.self, e)));
            case "ExtendScope":
                return $e(()=>(s)=>zE((i)=>s.getOrElseMemoize(r.layer, i)));
            case "Fold":
                return $e(()=>(s)=>V(s.getOrElseMemoize(r.layer, e), Ii({
                            onFailure: (i)=>s.getOrElseMemoize(r.failureK(i), e),
                            onSuccess: (i)=>s.getOrElseMemoize(r.successK(i), e)
                        })));
            case "Fresh":
                return $e(()=>(s)=>V(r.layer, KE(e)));
            case "FromEffect":
                return $e(n ? ()=>(s)=>r.effect : ()=>(s)=>s.getOrElseMemoize(t, e));
            case "Provide":
                return $e(()=>(s)=>V(s.getOrElseMemoize(r.first, e), Me((i)=>V(s.getOrElseMemoize(r.second, e), $v(i)))));
            case "Scoped":
                return $e(n ? ()=>(s)=>Wg(r.effect, e) : ()=>(s)=>s.getOrElseMemoize(t, e));
            case "Suspend":
                return $e(()=>(s)=>s.getOrElseMemoize(r.evaluate(), e));
            case "ProvideMerge":
                return $e(()=>(s)=>V(s.getOrElseMemoize(r.first, e), tW(s.getOrElseMemoize(r.second, e), r.zipK)));
            case "ZipWith":
                return eW(function*() {
                    const s = yield* Cl(e, K6), i = yield* Cl(s, ld), o = yield* Cl(s, ld);
                    return (a)=>V(a.getOrElseMemoize(r.first, i), m1(a.getOrElseMemoize(r.second, o), r.zipK, {
                            concurrent: !0
                        }));
                });
            case "MergeAll":
                {
                    const s = r.layers;
                    return Pt(Cl(e, K6), (i)=>(o)=>{
                            const a = new Array(s.length);
                            return Pt(Ba(s, M5e(function*(c, l) {
                                const u = yield* Cl(i, ld), d = yield* o.getOrElseMemoize(c, u);
                                a[l] = d;
                            }), !1, !1), ()=>Hxe(...a));
                        });
                }
        }
    }, CCe = j(2, (t, e)=>NCe(t, {
            onFailure: e,
            onSuccess: zCe
        })), ECe = ()=>$g(Kv()), ICe = (t)=>f$(UE(t)), ACe = (t)=>PCe(()=>UE(t())), f$ = (t)=>$g(kr(t)), PCe = (t)=>$g(ZC(t)), OCe = j(2, (t, e)=>{
        const n = vC(t), r = n ? t : e;
        return $g(Pt(n ? e : t, (i)=>mv(r, i)));
    });
    function $g(t) {
        const e = Object.create(Kg);
        return e._op_layer = JTe, e.effect = t, e;
    }
    const MCe = j(2, (t, e)=>CCe(t, (n)=>ACe(()=>e(n)))), RCe = j(2, (t, { onFailure: e, onSuccess: n })=>{
        const r = Object.create(Kg);
        return r._op_layer = GTe, r.layer = t, r.failureK = e, r.successK = n, r;
    }), NCe = j(2, (t, { onFailure: e, onSuccess: n })=>RCe(t, {
            onFailure: (r)=>{
                const s = y1(r);
                switch(s._tag){
                    case "Left":
                        return e(s.left);
                    case "Right":
                        return f$(s.right);
                }
            },
            onSuccess: n
        })), VCe = j(2, (t, e)=>HCe(t, e, (n, r)=>Tg(n, r))), DCe = (...t)=>{
        const e = Object.create(Kg);
        return e._op_layer = eCe, e.layers = t, e;
    }, BCe = j(2, (t, e)=>{
        const n = vC(t), r = n ? t : e;
        return FCe(Pt(n ? e : t, (i)=>mv(r, i)));
    }), FCe = (t)=>{
        const e = Object.create(Kg);
        return e._op_layer = YTe, e.effect = t, e;
    }, LCe = j(2, (t, e)=>{
        const n = vC(t);
        return $g(Ke(mv(n ? t : e, n ? e : t)));
    }), zCe = (t)=>$g(Ke(t)), UCe = (t)=>{
        const e = Object.create(Kg);
        return e._op_layer = QTe, e.evaluate = t, e;
    }, HCe = j(3, (t, e, n)=>UCe(()=>{
            const r = Object.create(Kg);
            return r._op_layer = tCe, r.first = t, r.second = e, r.zipK = n, r;
        })), xN = j(2, (t, e)=>UK((n)=>Me(KE(e, n), (r)=>iE(t, r)))), vN = j(2, (t, e)=>{
        const n = sy(dy.fiberRefs, e.fiberRefs), r = cd(dy.runtimeFlags, e.runtimeFlags);
        return Eo((s)=>fn((i)=>{
                const o = i.getFiberRef(ba), a = i.getFiberRefs(), c = iy(i.id(), a)(n), l = i.currentRuntimeFlags, u = $h(r)(l), d = sy(c, a), f = cd(u, l);
                return i.setFiberRefs(c), i.currentRuntimeFlags = u, J0(iE(s(t), Tg(o, e.context)), fn((p)=>(p.setFiberRefs(iy(p.id(), p.getFiberRefs())(d)), p.currentRuntimeFlags = $h(f)(p.currentRuntimeFlags), mn)));
            }));
    }), jCe = j(2, (t, e)=>Array.isArray(e) ? xN(t, DCe(...e)) : xCe(e) ? xN(t, e) : Uxe(e) ? iE(t, e) : XTe in e ? Me(e.runtimeEffect, (n)=>vN(t, n)) : vN(t, e)), qCe = (t)=>u1(bp, (e)=>t(Pc(e, pE))), WCe = (...t)=>qCe((e)=>e.error(...t)), p$ = B3e, KCe = (t)=>$Ce(t.slice(0)), $Ce = (t)=>Object.setPrototypeOf(t, D3e), XCe = (t)=>(e)=>{
            const n = e === void 0 ? Object.create(Ky) : p$(e);
            return n._tag = t, n;
        }, $E = ()=>new Proxy({}, {
            get (t, e, n) {
                return e === "$is" ? JT : e === "$match" ? GCe : XCe(e);
            }
        });
    function GCe() {
        if (arguments.length === 1) {
            const n = arguments[0];
            return function(r) {
                return n[r._tag](r);
            };
        }
        const t = arguments[0];
        return arguments[1][t._tag](t);
    }
    let h$, fk, g$, ZCe, JCe, YCe, o3, QCe, eEe, XE, Qb, b$, tEe, nEe, rEe, sEe, GE, ZE, iEe, oEe, aEe, Z2, cEe, lEe, uEe, dEe, SN, fEe, pEe, hEe, m$, y$, gEe, bEe, pk, fy, mEe, yEe;
    h$ = (function() {
        const t = Symbol.for("effect/Data/Error/plainArgs");
        return {
            BaseEffectError: class extends rE {
                constructor(n){
                    super(n?.message, n?.cause ? {
                        cause: n.cause
                    } : void 0), n && (Object.assign(this, n), Object.defineProperty(this, t, {
                        value: n,
                        enumerable: !1
                    }));
                }
                toJSON() {
                    return {
                        ...this[t],
                        ...this
                    };
                }
            }
        }.BaseEffectError;
    })();
    wn = (t)=>{
        const e = {
            BaseEffectError: class extends h$ {
                _tag = t;
            }
        };
        return e.BaseEffectError.prototype.name = t, e.BaseEffectError;
    };
    fk = Symbol.for("effect/DateTime");
    g$ = {
        [fk]: fk,
        pipe () {
            return St(this, arguments);
        },
        [Bn] () {
            return this.toString();
        },
        toJSON () {
            return GE(this).toJSON();
        }
    };
    ZCe = {
        ...g$,
        _tag: "Utc",
        [Jt] () {
            return ur(this, qy(this.epochMillis));
        },
        [$t] (t) {
            return o3(t) && t._tag === "Utc" && this.epochMillis === t.epochMillis;
        },
        toString () {
            return `DateTime.Utc(${GE(this).toJSON()})`;
        }
    };
    JCe = {
        ...g$,
        _tag: "Zoned",
        [Jt] () {
            return V(qy(this.epochMillis), bn(At(this.zone)), ur(this));
        },
        [$t] (t) {
            return o3(t) && t._tag === "Zoned" && this.epochMillis === t.epochMillis && jt(this.zone, t.zone);
        },
        toString () {
            return `DateTime.Zoned(${fEe(this)})`;
        }
    };
    YCe = (t, e, n)=>{
        const r = Object.create(JCe);
        return r.epochMillis = t, r.zone = e, Object.defineProperty(r, "partsUtc", {
            value: n,
            enumerable: !1,
            writable: !0
        }), Object.defineProperty(r, "adjustedEpochMillis", {
            value: void 0,
            enumerable: !1,
            writable: !0
        }), Object.defineProperty(r, "partsAdjusted", {
            value: void 0,
            enumerable: !1,
            writable: !0
        }), r;
    };
    o3 = (t)=>Ft(t, fk);
    QCe = (t)=>t._tag === "Utc";
    eEe = E0((t, e)=>t.epochMillis === e.epochMillis);
    XE = (t)=>{
        const e = Object.create(ZCe);
        return e.epochMillis = t, Object.defineProperty(e, "partsUtc", {
            value: void 0,
            enumerable: !1,
            writable: !0
        }), e;
    };
    Qb = (t)=>{
        const e = t.getTime();
        if (Number.isNaN(e)) throw new oTe("Invalid date");
        return XE(e);
    };
    b$ = (t)=>{
        if (o3(t)) return t;
        if (t instanceof Date) return Qb(t);
        if (typeof t == "object") {
            const e = new Date(0);
            return cEe(e, t), Qb(e);
        } else if (typeof t == "string" && !tEe(t)) return Qb(new Date(t + "Z"));
        return Qb(new Date(t));
    };
    tEe = (t)=>/Z|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(t);
    nEe = tj(b$);
    rEe = Pt(OW, XE);
    sEe = j(2, (t, e)=>Z2(e) - Z2(t));
    GE = (t)=>new Date(t.epochMillis);
    ZE = (t)=>{
        if (t._tag === "Utc") return new Date(t.epochMillis);
        if (t.zone._tag === "Offset") return new Date(t.epochMillis + t.zone.offset);
        if (t.adjustedEpochMillis !== void 0) return new Date(t.adjustedEpochMillis);
        const e = t.zone.format.formatToParts(t.epochMillis).filter((r)=>r.type !== "literal"), n = new Date(0);
        return n.setUTCFullYear(Number(e[2].value), Number(e[0].value) - 1, Number(e[1].value)), n.setUTCHours(Number(e[3].value), Number(e[4].value), Number(e[5].value), Number(e[6].value)), t.adjustedEpochMillis = n.getTime(), n;
    };
    iEe = (t)=>ZE(t).getTime() - Z2(t);
    oEe = (t)=>{
        const e = Math.abs(t);
        let n = Math.floor(e / (3600 * 1e3)), r = Math.round(e % (3600 * 1e3) / (60 * 1e3));
        return r === 60 && (n += 1, r = 0), `${t < 0 ? "-" : "+"}${String(n).padStart(2, "0")}:${String(r).padStart(2, "0")}`;
    };
    aEe = (t)=>oEe(iEe(t));
    Z2 = (t)=>t.epochMillis;
    cEe = (t, e)=>{
        if (e.year !== void 0 && t.setUTCFullYear(e.year), e.month !== void 0 && t.setUTCMonth(e.month - 1), e.day !== void 0 && t.setUTCDate(e.day), e.weekDay !== void 0) {
            const n = e.weekDay - t.getUTCDay();
            t.setUTCDate(t.getUTCDate() + n);
        }
        e.hours !== void 0 && t.setUTCHours(e.hours), e.minutes !== void 0 && t.setUTCMinutes(e.minutes), e.seconds !== void 0 && t.setUTCSeconds(e.seconds), e.millis !== void 0 && t.setUTCMilliseconds(e.millis);
    };
    lEe = j(2, (t, e)=>{
        const n = e(Z2(t));
        return t._tag === "Utc" ? XE(n) : YCe(n, t.zone);
    });
    uEe = j(2, (t, e)=>lEe(t, (n)=>n + ki(e)));
    dEe = (t)=>GE(t).toISOString();
    SN = (t)=>{
        const e = ZE(t);
        return t._tag === "Utc" ? e.toISOString() : `${e.toISOString().slice(0, -1)}${aEe(t)}`;
    };
    fEe = (t)=>t.zone._tag === "Offset" ? SN(t) : `${SN(t)}[${t.zone.id}]`;
    pEe = USe;
    hEe = "effect/Schedule";
    m$ = Symbol.for(hEe);
    y$ = (t)=>Ft(t, m$);
    gEe = "effect/ScheduleDriver";
    bEe = Symbol.for(gEe);
    pk = {
        start: 0,
        now: 0,
        input: void 0,
        output: void 0,
        elapsed: lp,
        elapsedSincePrevious: lp,
        recurrence: 0
    };
    fy = Cg()("effect/Schedule/CurrentIterationMetadata", {
        defaultValue: ()=>pk
    });
    mEe = {
        _Out: (t)=>t,
        _In: (t)=>t,
        _R: (t)=>t
    };
    yEe = {
        _Out: (t)=>t,
        _In: (t)=>t,
        _R: (t)=>t
    };
    class wEe {
        initial;
        step;
        [m$] = mEe;
        constructor(e, n){
            this.initial = e, this.step = n;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const kN = (t, e, n, r)=>F2(t, (s)=>s.recurrence === 0 ? {
                now: e,
                input: n,
                output: r,
                recurrence: s.recurrence + 1,
                elapsed: lp,
                elapsedSincePrevious: lp,
                start: e
            } : {
                now: e,
                input: n,
                output: r,
                recurrence: s.recurrence + 1,
                elapsed: ls(e - s.start),
                elapsedSincePrevious: ls(e - s.now),
                start: s.start
            });
    class _Ee {
        schedule;
        ref;
        [bEe] = yEe;
        constructor(e, n){
            this.schedule = e, this.ref = n;
        }
        get state() {
            return Pt(xo(this.ref), (e)=>e[1]);
        }
        get last() {
            return Me(xo(this.ref), ([e, n])=>{
                switch(e._tag){
                    case "None":
                        return Rg(()=>new Lv);
                    case "Some":
                        return Ke(e.value);
                }
            });
        }
        iterationMeta = mE(pk);
        get reset() {
            return jf(this.ref, [
                Fe(),
                this.schedule.initial
            ]).pipe(Bv(jf(this.iterationMeta, pk)));
        }
        next(e) {
            return V(Pt(xo(this.ref), (n)=>n[1]), Me((n)=>V(OW, Me((r)=>V(Rt(()=>this.schedule.step(r, e, n)), Me(([s, i, o])=>{
                        const a = jf(this.ref, [
                            ze(i),
                            s
                        ]);
                        if (ly(o)) return a.pipe(Wr(Tr(Fe())));
                        const c = uk(o.intervals) - r;
                        if (c <= 0) return a.pipe(Wr(kN(this.iterationMeta, r, e, i)), vs(i));
                        const l = ls(c);
                        return V(a, Wr(kN(this.iterationMeta, r, e, i)), Wr(_E(l)), vs(i));
                    }))))));
        }
    }
    const qd = (t, e)=>new wEe(t, e), w$ = j(2, (t, e)=>xEe(t, (n)=>$e(()=>e(n)))), xEe = j(2, (t, e)=>_$(t, (n, r)=>Pt(e(n), (s)=>mve(r, Ei(s))))), vEe = j(2, (t, e)=>JE(t, (n, r)=>$e(()=>e(n, r)))), JE = j(2, (t, e)=>qd(t.initial, (n, r, s)=>Me(t.step(n, r, s), ([i, o, a])=>ly(a) ? Ke([
                    i,
                    o,
                    cy
                ]) : Pt(e(r, o), (c)=>c ? [
                        i,
                        o,
                        a
                    ] : [
                        i,
                        o,
                        cy
                    ])))), SEe = j(2, (t, e)=>_$(t, (n, r)=>e(r))), kEe = (t)=>w$(t, (e)=>e), YE = (t)=>V(B2([
            Fe(),
            t.initial
        ]), Pt((e)=>new _Ee(t, e))), TEe = (t, e = 2)=>{
        const n = Ei(t);
        return kEe(a3(_1, (r)=>bve(n, Math.pow(e, r))));
    }, QE = j(2, (t, e)=>CEe(t, e, CTe)), CEe = j(3, (t, e, n)=>qd([
            t.initial,
            e.initial
        ], (r, s, i)=>V(tW(t.step(r, s, i[0]), e.step(r, s, i[1]), (o, a)=>[
                    o,
                    a
                ]), Me(([[o, a, c], [l, u, d]])=>wN(c) && wN(d) ? hk(t, e, s, o, a, c.intervals, l, u, d.intervals, n) : Ke([
                    [
                        o,
                        l
                    ],
                    [
                        a,
                        u
                    ],
                    cy
                ]))))), hk = (t, e, n, r, s, i, o, a, c, l)=>{
        const u = l(i, c);
        return ITe(u) ? Ke([
            [
                r,
                o
            ],
            [
                s,
                a
            ],
            NTe(u)
        ]) : V(i, ETe(c)) ? Me(t.step(dk(i), n, r), ([d, f, p])=>ly(p) ? Ke([
                [
                    d,
                    o
                ],
                [
                    f,
                    a
                ],
                cy
            ]) : hk(t, e, n, d, f, p.intervals, o, a, c, l)) : Me(e.step(dk(c), n, o), ([d, f, p])=>ly(p) ? Ke([
                [
                    r,
                    d
                ],
                [
                    s,
                    f
                ],
                cy
            ]) : hk(t, e, n, r, s, i, d, f, p.intervals, l));
    }, EEe = j(2, (t, e)=>{
        const { max: n, min: r } = Object.assign({
            min: .8,
            max: 1.2
        }, e);
        return SEe(t, (s)=>Pt(pEe, (i)=>{
                const o = ki(s), a = o * r * (1 - i) + o * n * i;
                return ls(a);
            }));
    }), a3 = j(2, (t, e)=>IEe(t, (n)=>$e(()=>e(n)))), IEe = j(2, (t, e)=>qd(t.initial, (n, r, s)=>Me(t.step(n, r, s), ([i, o, a])=>Pt(e(o), (c)=>[
                        i,
                        c,
                        a
                    ])))), _$ = j(2, (t, e)=>qd(t.initial, (n, r, s)=>Me(t.step(n, r, s), ([i, o, a])=>{
                if (ly(a)) return Ke([
                    i,
                    o,
                    a
                ]);
                const c = a.intervals, l = yTe(mN(n, uk(c)));
                return Pt(e(o, l), (u)=>{
                    const d = Ei(u), f = uk(c), p = n + ki(d), h = p - f, m = Math.max(0, dk(c) + h), w = mN(p, m);
                    return [
                        i,
                        o,
                        G2(w)
                    ];
                });
            }))), AEe = (t)=>qd(t.initial, (e, n, r)=>V(t.step(e, n, r), Pt(([s, i, o])=>[
                    s,
                    n,
                    o
                ]))), x$ = (t)=>NEe(_1, (e)=>e < t), PEe = j(2, (t, e)=>{
        const n = Ei(e);
        return V(t, QE(jEe), OEe(([, r])=>nq(r, n)), a3((r)=>r[0]));
    }), OEe = j(2, (t, e)=>qd(t.initial, (n, r, s)=>Me(t.step(n, r, s), ([i, o, a])=>e(o) ? t.step(n, r, t.initial) : Ke([
                    i,
                    o,
                    a
                ])))), MEe = (t)=>w$(_1, ()=>t), REe = (t, e)=>qd(t, (n, r, s)=>$e(()=>[
                    e(s),
                    s,
                    G2(ck(n))
                ])), v$ = j(2, (t, e)=>JE(t, (n, r)=>O4e(e(n)))), S$ = j(2, (t, e)=>JE(t, (n, r)=>e(n))), NEe = j(2, (t, e)=>vEe(t, (n, r)=>e(r))), O_ = Symbol.for("effect/Schedule/ScheduleDefect");
    class VEe {
        error;
        [O_];
        constructor(e){
            this.error = e, this[O_] = O_;
        }
    }
    let DEe, J2, BEe, k$, TN, FEe, LEe, T$, CN, zEe, UEe, HEe, C$, jEe, _1, L8, qEe, WEe, gk, Ns, vo, KEe, E$, Kn, eI, z8, $Ee, XEe, GEe, ZEe, JEe, wh, ho, YEe, em, hy, La, Zg, I$, jp, QEe, Mf, A$, eIe, bk, tI, tIe, M_, yi, x1, nIe, P$, rIe, Od, O$, sIe, M$, R$, Cf, EN, _s, N$, V$, El, U8, iIe, nI, D$, rI, oIe, aIe, mk, v1, gy, go, IN, cIe, lIe, sI, iI, uIe, Q2, ex, c3, kn, l3, dIe, fIe, oI, pIe, hIe, gIe, bIe, F$, mIe, AN, yIe, L$, wIe, z$, _Ie, aI, xIe, cI, vIe, SIe, lI, kIe, U$, uI;
    DEe = (t)=>Ft(t, O_);
    J2 = (t)=>W0(t, (e)=>Ol(new VEe(e)));
    BEe = (t)=>dn(Pv(t, (e)=>jC(e) && DEe(e.defect) ? ze(e.defect) : Fe()), {
            onNone: ()=>t,
            onSome: (e)=>Sd(e.error)
        });
    k$ = (t)=>Mv(t, (e)=>kr(BEe(e)));
    TN = j(2, (t, e)=>LEe(t, e, (n, r)=>Tr(n)));
    FEe = j(2, (t, e)=>{
        if (y$(e)) return TN(t, e);
        const n = e.schedule ?? AEe(_1), r = e.while ? S$(n, (o)=>{
            const a = e.while(o);
            return typeof a == "boolean" ? Ke(a) : J2(a);
        }) : n, s = e.until ? v$(r, (o)=>{
            const a = e.until(o);
            return typeof a == "boolean" ? Ke(a) : J2(a);
        }) : r, i = e.times ? QE(s, x$(e.times)).pipe(a3((o)=>o[0])) : s;
        return k$(TN(t, i));
    });
    LEe = j(3, (t, e, n)=>Me(YE(e), (r)=>Lc(t, {
                onFailure: (s)=>n(s, Fe()),
                onSuccess: (s)=>T$(ry(t, fy, xo(r.iterationMeta)), r, (i, o)=>ry(n(i, o), fy, xo(r.iterationMeta)), s)
            })));
    T$ = (t, e, n, r)=>Lc(e.next(r), {
            onFailure: ()=>eE(e.last),
            onSuccess: (s)=>Lc(t, {
                    onFailure: (i)=>n(i, ze(s)),
                    onSuccess: (i)=>T$(t, e, n, i)
                })
        });
    CN = j(2, (t, e)=>HEe(t, e, (n, r)=>Tr(n)));
    zEe = j(2, (t, e)=>y$(e) ? CN(t, e) : k$(CN(t, UEe(e))));
    UEe = (t)=>{
        const e = t.schedule ?? _1, n = t.while ? S$(e, (s)=>{
            const i = t.while(s);
            return typeof i == "boolean" ? Ke(i) : J2(i);
        }) : e, r = t.until ? v$(n, (s)=>{
            const i = t.until(s);
            return typeof i == "boolean" ? Ke(i) : J2(i);
        }) : n;
        return t.times !== void 0 ? QE(r, x$(t.times)) : r;
    };
    HEe = j(3, (t, e, n)=>Me(YE(e), (r)=>C$(ry(t, fy, xo(r.iterationMeta)), r, (s, i)=>ry(n(s, i), fy, xo(r.iterationMeta)))));
    C$ = (t, e, n)=>W0(t, (r)=>Lc(e.next(r), {
                onFailure: ()=>V(e.last, eE, Me((s)=>n(r, s))),
                onSuccess: ()=>C$(t, e, n)
            }));
    jEe = qd(Fe(), (t, e, n)=>{
        switch(n._tag){
            case "None":
                return Ke([
                    ze(t),
                    lp,
                    G2(ck(t))
                ]);
            case "Some":
                return Ke([
                    ze(n.value),
                    ls(t - n.value),
                    G2(ck(t))
                ]);
        }
    });
    _1 = REe(0, (t)=>t + 1);
    Xg = Kc;
    L8 = P4e;
    py = BE;
    Fa = Z0;
    qEe = D4e;
    WEe = za;
    gk = fn;
    Ns = Tr;
    vo = kr;
    KEe = Ol;
    E$ = Zq;
    or = eW;
    wl = V4e;
    Zt = Ke;
    wr = Rt;
    Kn = $e;
    ln = mn;
    Gg = W0;
    eI = Mv;
    c_t = y4e;
    z8 = w4e;
    $Ee = _4e;
    XEe = C4e;
    GEe = E4e;
    ZEe = zEe;
    Io = GW;
    JEe = L4e;
    l_t = z4e;
    ud = nK;
    wh = os;
    ho = c1;
    YEe = zp;
    em = Up;
    hy = Eo;
    La = vs;
    Zg = Mi;
    wt = Pt;
    I$ = YC;
    Ad = Nv;
    jp = LK;
    QEe = Xq;
    Mf = J0;
    A$ = HK;
    eIe = zE;
    bk = UK;
    tI = Kke;
    tIe = Ng;
    M_ = LE;
    yi = WE;
    x1 = UTe;
    nIe = jTe;
    P$ = Kv;
    rIe = hW;
    Pd = jCe;
    Od = wE;
    O$ = ry;
    sIe = j4e;
    M$ = q4e;
    R$ = S4e;
    Cf = W6;
    EN = k4e;
    yf = K0;
    _s = Oc;
    N$ = JC;
    V$ = H4e;
    nt = Me;
    Y2 = C5e;
    El = Vg;
    U8 = WK;
    iIe = HTe;
    nI = qK;
    D$ = $0;
    rI = F4e;
    oIe = T4e;
    aIe = YW;
    mk = FEe;
    v1 = ZW;
    gy = Jq;
    go = Ii;
    B$ = Lc;
    IN = A4e;
    cIe = eE;
    u_t = QC;
    d_t = R4e;
    lIe = N4e;
    sI = uCe;
    iI = FTe;
    uIe = zTe;
    Q2 = fCe;
    Cn = pCe;
    Xi = hCe;
    ex = $ke;
    c3 = Xke;
    kn = Gke;
    l3 = m1;
    dIe = $4e;
    fIe = X4e;
    f_t = G4e;
    oI = Ss;
    pIe = ba;
    hIe = aW;
    gIe = KE;
    bIe = ECe;
    F$ = OCe;
    mIe = ICe;
    AN = MCe;
    yIe = VCe;
    L$ = BCe;
    p_t = LCe;
    wIe = "effect/QueueEnqueue";
    z$ = Symbol.for(wIe);
    _Ie = "effect/QueueDequeue";
    aI = Symbol.for(_Ie);
    xIe = "effect/QueueStrategy";
    cI = Symbol.for(xIe);
    vIe = "effect/BackingQueue";
    SIe = Symbol.for(vIe);
    lI = {
        _A: (t)=>t
    };
    kIe = {
        _A: (t)=>t
    };
    U$ = {
        _In: (t)=>t
    };
    uI = {
        _Out: (t)=>t
    };
    class TIe extends $c {
        queue;
        takers;
        shutdownHook;
        shutdownFlag;
        strategy;
        [z$] = U$;
        [aI] = uI;
        constructor(e, n, r, s, i){
            super(), this.queue = e, this.takers = n, this.shutdownHook = r, this.shutdownFlag = s, this.strategy = i;
        }
        pipe() {
            return St(this, arguments);
        }
        commit() {
            return this.take;
        }
        capacity() {
            return this.queue.capacity();
        }
        get size() {
            return Rt(()=>W0(this.unsafeSize(), ()=>os));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Fe() : ze(this.queue.length() - dE(this.takers) + this.strategy.surplusSize());
        }
        get isEmpty() {
            return Pt(this.size, (e)=>e <= 0);
        }
        get isFull() {
            return Pt(this.size, (e)=>e >= this.capacity());
        }
        get shutdown() {
            return Up(fn((e)=>(V(this.shutdownFlag, Bp(!0)), V(Ba(Zh(this.takers), (n)=>qv(n, e.id()), !1, !1), Wr(this.strategy.shutdown), l1(d1(this.shutdownHook, void 0)), Mi))));
        }
        get isShutdown() {
            return $e(()=>Tn(this.shutdownFlag));
        }
        get awaitShutdown() {
            return la(this.shutdownHook);
        }
        isActive() {
            return !Tn(this.shutdownFlag);
        }
        unsafeOffer(e) {
            if (Tn(this.shutdownFlag)) return !1;
            let n;
            if (this.queue.length() === 0) {
                const s = V(this.takers, Mc(Er));
                s !== Er ? (qf(s, e), n = !0) : n = !1;
            } else n = !1;
            if (n) return !0;
            const r = this.queue.offer(e);
            return Rf(this.strategy, this.queue, this.takers), r;
        }
        offer(e) {
            return Rt(()=>{
                if (Tn(this.shutdownFlag)) return os;
                let n;
                if (this.queue.length() === 0) {
                    const s = V(this.takers, Mc(Er));
                    s !== Er ? (qf(s, e), n = !0) : n = !1;
                } else n = !1;
                if (n) return Ke(!0);
                const r = this.queue.offer(e);
                return Rf(this.strategy, this.queue, this.takers), r ? Ke(!0) : this.strategy.handleSurplus([
                    e
                ], this.queue, this.takers, this.shutdownFlag);
            });
        }
        offerAll(e) {
            return Rt(()=>{
                if (Tn(this.shutdownFlag)) return os;
                const n = Un(e), r = this.queue.length() === 0 ? Un(jIe(this.takers, n.length)) : tu, [s, i] = V(n, uC(r.length));
                for(let a = 0; a < r.length; a++){
                    const c = r[a], l = s[a];
                    qf(c, l);
                }
                if (i.length === 0) return Ke(!0);
                const o = this.queue.offerAll(i);
                return Rf(this.strategy, this.queue, this.takers), Eg(o) ? Ke(!0) : this.strategy.handleSurplus(o, this.queue, this.takers, this.shutdownFlag);
            });
        }
        get take() {
            return fn((e)=>{
                if (Tn(this.shutdownFlag)) return os;
                const n = this.queue.poll(Er);
                if (n !== Er) return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), Ke(n);
                {
                    const r = zg(e.id());
                    return V(Rt(()=>(V(this.takers, Td(r)), Rf(this.strategy, this.queue, this.takers), Tn(this.shutdownFlag) ? os : la(r))), zp(()=>$e(()=>qIe(this.takers, r))));
                }
            });
        }
        get takeAll() {
            return Rt(()=>Tn(this.shutdownFlag) ? os : $e(()=>{
                    const e = this.queue.pollUpTo(Number.POSITIVE_INFINITY);
                    return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), Co(e);
                }));
        }
        takeUpTo(e) {
            return Rt(()=>Tn(this.shutdownFlag) ? os : $e(()=>{
                    const n = this.queue.pollUpTo(e);
                    return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), Co(n);
                }));
        }
        takeBetween(e, n) {
            return Rt(()=>H$(this, e, n, En()));
        }
    }
    const H$ = (t, e, n, r)=>n < e ? Ke(r) : V(DIe(t, n), Me((s)=>{
            const i = e - s.length;
            return i === 1 ? V(yk(t), Pt((o)=>V(r, Ar(s), Gm(o)))) : i > 1 ? V(yk(t), Me((o)=>H$(t, i - 1, n - s.length - 1, V(r, Ar(s), Gm(o))))) : Ke(V(r, Ar(s)));
        })), CIe = (t)=>V($e(()=>uE(t)), Me((e)=>u3(d3(e), FIe()))), EIe = (t)=>V($e(()=>uE(t)), Me((e)=>u3(d3(e), j$()))), IIe = (t)=>V($e(()=>uE(t)), Me((e)=>u3(d3(e), LIe()))), AIe = ()=>V($e(()=>f1()), Me((t)=>u3(d3(t), j$()))), PIe = (t, e, n, r, s)=>new TIe(t, e, n, r, s), u3 = (t, e)=>V(Ug(), Pt((n)=>PIe(t, f1(), n, Dp(!1), e)));
    class OIe {
        mutable;
        [SIe] = kIe;
        constructor(e){
            this.mutable = e;
        }
        poll(e) {
            return Mc(this.mutable, e);
        }
        pollUpTo(e) {
            return Gv(this.mutable, e);
        }
        offerAll(e) {
            return fE(this.mutable, e);
        }
        offer(e) {
            return Td(this.mutable, e);
        }
        capacity() {
            return j8e(this.mutable);
        }
        length() {
            return dE(this.mutable);
        }
    }
    const d3 = (t)=>new OIe(t), MIe = (t)=>t.size, RIe = (t)=>t.isShutdown, NIe = (t)=>t.shutdown, VIe = j(2, (t, e)=>t.offer(e)), yk = (t)=>t.take, DIe = j(2, (t, e)=>t.takeUpTo(e)), BIe = j(3, (t, e, n)=>t.takeBetween(e, n)), FIe = ()=>new zIe, j$ = ()=>new UIe, LIe = ()=>new HIe;
    let zIe = class {
        [cI] = lI;
        putters = f1();
        surplusSize() {
            return dE(this.putters);
        }
        onCompleteTakersWithEmptyQueue(e) {
            for(; !Hf(this.putters) && !Hf(e);){
                const n = Mc(e, void 0), r = Mc(this.putters, void 0);
                r[2] && qf(r[1], !0), qf(n, r[0]);
            }
        }
        get shutdown() {
            return V(a1, Me((e)=>V($e(()=>Zh(this.putters)), Me((n)=>Ba(n, ([r, s, i])=>i ? V(qv(s, e), Mi) : mn, !1, !1)))));
        }
        handleSurplus(e, n, r, s) {
            return fn((i)=>{
                const o = zg(i.id());
                return V(Rt(()=>(this.unsafeOffer(e, o), this.unsafeOnQueueEmptySpace(n, r), Rf(this, n, r), Tn(s) ? os : la(o))), zp(()=>$e(()=>this.unsafeRemove(o))));
            });
        }
        unsafeOnQueueEmptySpace(e, n) {
            let r = !0;
            for(; r && (e.capacity() === Number.POSITIVE_INFINITY || e.length() < e.capacity());){
                const s = V(this.putters, Mc(Er));
                if (s === Er) r = !1;
                else {
                    const i = e.offer(s[0]);
                    i && s[2] ? qf(s[1], !0) : i || tx(this.putters, V(Zh(this.putters), Rs(s))), Rf(this, e, n);
                }
            }
        }
        unsafeOffer(e, n) {
            const r = Un(e);
            for(let s = 0; s < r.length; s++){
                const i = r[s];
                s === r.length - 1 ? V(this.putters, Td([
                    i,
                    n,
                    !0
                ])) : V(this.putters, Td([
                    i,
                    n,
                    !1
                ]));
            }
        }
        unsafeRemove(e) {
            tx(this.putters, V(Zh(this.putters), Jy(([, n])=>n !== e)));
        }
    }, UIe = class {
        [cI] = lI;
        surplusSize() {
            return 0;
        }
        get shutdown() {
            return mn;
        }
        onCompleteTakersWithEmptyQueue() {}
        handleSurplus(e, n, r, s) {
            return Ke(!1);
        }
        unsafeOnQueueEmptySpace(e, n) {}
    }, HIe = class {
        [cI] = lI;
        surplusSize() {
            return 0;
        }
        get shutdown() {
            return mn;
        }
        onCompleteTakersWithEmptyQueue() {}
        handleSurplus(e, n, r, s) {
            return $e(()=>(this.unsafeOffer(n, e), Rf(this, n, r), !0));
        }
        unsafeOnQueueEmptySpace(e, n) {}
        unsafeOffer(e, n) {
            const r = n[Symbol.iterator]();
            let s, i = !0;
            for(; !(s = r.next()).done && i;){
                if (e.capacity() === 0) return;
                e.poll(Er), i = e.offer(s.value);
            }
        }
    };
    const qf = (t, e)=>Wv(t, Ke(e)), tx = (t, e)=>V(t, fE(e)), Zh = (t)=>V(t, Gv(Number.POSITIVE_INFINITY)), jIe = (t, e)=>V(t, Gv(e)), qIe = (t, e)=>{
        tx(t, V(Zh(t), Jy((n)=>e !== n)));
    }, Rf = (t, e, n)=>{
        let r = !0;
        for(; r && e.length() !== 0;){
            const s = V(n, Mc(Er));
            if (s !== Er) {
                const i = e.poll(Er);
                i !== Er ? (qf(s, i), t.unsafeOnQueueEmptySpace(e, n)) : tx(n, V(Zh(n), Rs(s))), r = !0;
            } else r = !1;
        }
        r && e.length() === 0 && !Hf(n) && t.onCompleteTakersWithEmptyQueue(n);
    }, Dr = Symbol.for("effect/PubSub/AbsentValue"), q$ = (t, e)=>(n)=>{
            n.has(t) || n.set(t, new Set), n.get(t).add(e);
        }, WIe = (t, e)=>(n)=>{
            if (!n.has(t)) return;
            const r = n.get(t);
            r.delete(e), r.size === 0 && n.delete(t);
        }, KIe = (t)=>Rt(()=>{
            const e = dI(t);
            return f3(e, new yAe);
        }), $Ie = (t)=>Rt(()=>{
            const e = dI(t);
            return f3(e, new $$);
        }), XIe = (t)=>Rt(()=>{
            const e = dI(t);
            return f3(e, new wAe);
        }), GIe = (t)=>Rt(()=>{
            const e = QIe(t);
            return f3(e, new $$);
        }), ZIe = (t)=>t.shutdown, JIe = j(2, (t, e)=>t.publish(e)), YIe = (t)=>t.subscribe, dI = (t)=>{
        const e = typeof t == "number" ? {
            capacity: t
        } : t;
        pAe(e.capacity);
        const n = e.replay && e.replay > 0 ? new X$(Math.ceil(e.replay)) : void 0;
        return e.capacity === 1 ? new oAe(n) : b2e(e.capacity) === e.capacity ? new sAe(e.capacity, n) : new nAe(e.capacity, n);
    }, QIe = (t)=>new cAe(t?.replay ? new X$(t.replay) : void 0), eAe = (t, e, n)=>Pt(Ug(), (r)=>tAe(t, e, t.subscribe(), f1(), r, Dp(!1), n)), tAe = (t, e, n, r, s, i, o)=>new uAe(t, e, n, r, s, i, o, t.replayWindow());
    class nAe {
        capacity;
        replayBuffer;
        array;
        publisherIndex = 0;
        subscribers;
        subscriberCount = 0;
        subscribersIndex = 0;
        constructor(e, n){
            this.capacity = e, this.replayBuffer = n, this.array = Array.from({
                length: e
            }), this.subscribers = Array.from({
                length: e
            });
        }
        replayWindow() {
            return this.replayBuffer ? new p3(this.replayBuffer) : h3;
        }
        isEmpty() {
            return this.publisherIndex === this.subscribersIndex;
        }
        isFull() {
            return this.publisherIndex === this.subscribersIndex + this.capacity;
        }
        size() {
            return this.publisherIndex - this.subscribersIndex;
        }
        publish(e) {
            if (this.isFull()) return !1;
            if (this.subscriberCount !== 0) {
                const n = this.publisherIndex % this.capacity;
                this.array[n] = e, this.subscribers[n] = this.subscriberCount, this.publisherIndex += 1;
            }
            return this.replayBuffer && this.replayBuffer.offer(e), !0;
        }
        publishAll(e) {
            if (this.subscriberCount === 0) return this.replayBuffer && this.replayBuffer.offerAll(e), En();
            const n = Co(e), r = n.length, s = this.publisherIndex - this.subscribersIndex, i = this.capacity - s, o = Math.min(r, i);
            if (o === 0) return n;
            let a = 0;
            const c = this.publisherIndex + o;
            for(; this.publisherIndex !== c;){
                const l = Da(n, a++), u = this.publisherIndex % this.capacity;
                this.array[u] = l, this.subscribers[u] = this.subscriberCount, this.publisherIndex += 1, this.replayBuffer && this.replayBuffer.offer(l);
            }
            return xd(n, a);
        }
        slide() {
            if (this.subscribersIndex !== this.publisherIndex) {
                const e = this.subscribersIndex % this.capacity;
                this.array[e] = Dr, this.subscribers[e] = 0, this.subscribersIndex += 1;
            }
            this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new rAe(this, this.publisherIndex, !1);
        }
    }
    class rAe {
        self;
        subscriberIndex;
        unsubscribed;
        constructor(e, n, r){
            this.self = e, this.subscriberIndex = n, this.unsubscribed = r;
        }
        isEmpty() {
            return this.unsubscribed || this.self.publisherIndex === this.subscriberIndex || this.self.publisherIndex === this.self.subscribersIndex;
        }
        size() {
            return this.unsubscribed ? 0 : this.self.publisherIndex - Math.max(this.subscriberIndex, this.self.subscribersIndex);
        }
        poll(e) {
            if (this.unsubscribed) return e;
            if (this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex), this.subscriberIndex !== this.self.publisherIndex) {
                const n = this.subscriberIndex % this.self.capacity, r = this.self.array[n];
                return this.self.subscribers[n] -= 1, this.self.subscribers[n] === 0 && (this.self.array[n] = Dr, this.self.subscribersIndex += 1), this.subscriberIndex += 1, r;
            }
            return e;
        }
        pollUpTo(e) {
            if (this.unsubscribed) return En();
            this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex);
            const n = this.self.publisherIndex - this.subscriberIndex, r = Math.min(e, n);
            if (r <= 0) return En();
            const s = [], i = this.subscriberIndex + r;
            for(; this.subscriberIndex !== i;){
                const o = this.subscriberIndex % this.self.capacity, a = this.self.array[o];
                this.self.subscribers[o] -= 1, this.self.subscribers[o] === 0 && (this.self.array[o] = Dr, this.self.subscribersIndex += 1), s.push(a), this.subscriberIndex += 1;
            }
            return Co(s);
        }
        unsubscribe() {
            if (!this.unsubscribed) for(this.unsubscribed = !0, this.self.subscriberCount -= 1, this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex); this.subscriberIndex !== this.self.publisherIndex;){
                const e = this.subscriberIndex % this.self.capacity;
                this.self.subscribers[e] -= 1, this.self.subscribers[e] === 0 && (this.self.array[e] = Dr, this.self.subscribersIndex += 1), this.subscriberIndex += 1;
            }
        }
    }
    class sAe {
        capacity;
        replayBuffer;
        array;
        mask;
        publisherIndex = 0;
        subscribers;
        subscriberCount = 0;
        subscribersIndex = 0;
        constructor(e, n){
            this.capacity = e, this.replayBuffer = n, this.array = Array.from({
                length: e
            }), this.mask = e - 1, this.subscribers = Array.from({
                length: e
            });
        }
        replayWindow() {
            return this.replayBuffer ? new p3(this.replayBuffer) : h3;
        }
        isEmpty() {
            return this.publisherIndex === this.subscribersIndex;
        }
        isFull() {
            return this.publisherIndex === this.subscribersIndex + this.capacity;
        }
        size() {
            return this.publisherIndex - this.subscribersIndex;
        }
        publish(e) {
            if (this.isFull()) return !1;
            if (this.subscriberCount !== 0) {
                const n = this.publisherIndex & this.mask;
                this.array[n] = e, this.subscribers[n] = this.subscriberCount, this.publisherIndex += 1;
            }
            return this.replayBuffer && this.replayBuffer.offer(e), !0;
        }
        publishAll(e) {
            if (this.subscriberCount === 0) return this.replayBuffer && this.replayBuffer.offerAll(e), En();
            const n = Co(e), r = n.length, s = this.publisherIndex - this.subscribersIndex, i = this.capacity - s, o = Math.min(r, i);
            if (o === 0) return n;
            let a = 0;
            const c = this.publisherIndex + o;
            for(; this.publisherIndex !== c;){
                const l = Da(n, a++), u = this.publisherIndex & this.mask;
                this.array[u] = l, this.subscribers[u] = this.subscriberCount, this.publisherIndex += 1, this.replayBuffer && this.replayBuffer.offer(l);
            }
            return xd(n, a);
        }
        slide() {
            if (this.subscribersIndex !== this.publisherIndex) {
                const e = this.subscribersIndex & this.mask;
                this.array[e] = Dr, this.subscribers[e] = 0, this.subscribersIndex += 1;
            }
            this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new iAe(this, this.publisherIndex, !1);
        }
    }
    class iAe {
        self;
        subscriberIndex;
        unsubscribed;
        constructor(e, n, r){
            this.self = e, this.subscriberIndex = n, this.unsubscribed = r;
        }
        isEmpty() {
            return this.unsubscribed || this.self.publisherIndex === this.subscriberIndex || this.self.publisherIndex === this.self.subscribersIndex;
        }
        size() {
            return this.unsubscribed ? 0 : this.self.publisherIndex - Math.max(this.subscriberIndex, this.self.subscribersIndex);
        }
        poll(e) {
            if (this.unsubscribed) return e;
            if (this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex), this.subscriberIndex !== this.self.publisherIndex) {
                const n = this.subscriberIndex & this.self.mask, r = this.self.array[n];
                return this.self.subscribers[n] -= 1, this.self.subscribers[n] === 0 && (this.self.array[n] = Dr, this.self.subscribersIndex += 1), this.subscriberIndex += 1, r;
            }
            return e;
        }
        pollUpTo(e) {
            if (this.unsubscribed) return En();
            this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex);
            const n = this.self.publisherIndex - this.subscriberIndex, r = Math.min(e, n);
            if (r <= 0) return En();
            const s = [], i = this.subscriberIndex + r;
            for(; this.subscriberIndex !== i;){
                const o = this.subscriberIndex & this.self.mask, a = this.self.array[o];
                this.self.subscribers[o] -= 1, this.self.subscribers[o] === 0 && (this.self.array[o] = Dr, this.self.subscribersIndex += 1), s.push(a), this.subscriberIndex += 1;
            }
            return Co(s);
        }
        unsubscribe() {
            if (!this.unsubscribed) for(this.unsubscribed = !0, this.self.subscriberCount -= 1, this.subscriberIndex = Math.max(this.subscriberIndex, this.self.subscribersIndex); this.subscriberIndex !== this.self.publisherIndex;){
                const e = this.subscriberIndex & this.self.mask;
                this.self.subscribers[e] -= 1, this.self.subscribers[e] === 0 && (this.self.array[e] = Dr, this.self.subscribersIndex += 1), this.subscriberIndex += 1;
            }
        }
    }
    class oAe {
        replayBuffer;
        publisherIndex = 0;
        subscriberCount = 0;
        subscribers = 0;
        value = Dr;
        capacity = 1;
        constructor(e){
            this.replayBuffer = e;
        }
        replayWindow() {
            return this.replayBuffer ? new p3(this.replayBuffer) : h3;
        }
        pipe() {
            return St(this, arguments);
        }
        isEmpty() {
            return this.subscribers === 0;
        }
        isFull() {
            return !this.isEmpty();
        }
        size() {
            return this.isEmpty() ? 0 : 1;
        }
        publish(e) {
            return this.isFull() ? !1 : (this.subscriberCount !== 0 && (this.value = e, this.subscribers = this.subscriberCount, this.publisherIndex += 1), this.replayBuffer && this.replayBuffer.offer(e), !0);
        }
        publishAll(e) {
            if (this.subscriberCount === 0) return this.replayBuffer && this.replayBuffer.offerAll(e), En();
            const n = Co(e);
            return Eg(n) ? n : this.publish(TC(n)) ? xd(n, 1) : n;
        }
        slide() {
            this.isFull() && (this.subscribers = 0, this.value = Dr), this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new aAe(this, this.publisherIndex, !1);
        }
    }
    class aAe {
        self;
        subscriberIndex;
        unsubscribed;
        constructor(e, n, r){
            this.self = e, this.subscriberIndex = n, this.unsubscribed = r;
        }
        isEmpty() {
            return this.unsubscribed || this.self.subscribers === 0 || this.subscriberIndex === this.self.publisherIndex;
        }
        size() {
            return this.isEmpty() ? 0 : 1;
        }
        poll(e) {
            if (this.isEmpty()) return e;
            const n = this.self.value;
            return this.self.subscribers -= 1, this.self.subscribers === 0 && (this.self.value = Dr), this.subscriberIndex += 1, n;
        }
        pollUpTo(e) {
            if (this.isEmpty() || e < 1) return En();
            const n = this.self.value;
            return this.self.subscribers -= 1, this.self.subscribers === 0 && (this.self.value = Dr), this.subscriberIndex += 1, Mn(n);
        }
        unsubscribe() {
            this.unsubscribed || (this.unsubscribed = !0, this.self.subscriberCount -= 1, this.subscriberIndex !== this.self.publisherIndex && (this.self.subscribers -= 1, this.self.subscribers === 0 && (this.self.value = Dr)));
        }
    }
    class cAe {
        replayBuffer;
        publisherHead = {
            value: Dr,
            subscribers: 0,
            next: null
        };
        publisherTail = this.publisherHead;
        publisherIndex = 0;
        subscribersIndex = 0;
        capacity = Number.MAX_SAFE_INTEGER;
        constructor(e){
            this.replayBuffer = e;
        }
        replayWindow() {
            return this.replayBuffer ? new p3(this.replayBuffer) : h3;
        }
        isEmpty() {
            return this.publisherHead === this.publisherTail;
        }
        isFull() {
            return !1;
        }
        size() {
            return this.publisherIndex - this.subscribersIndex;
        }
        publish(e) {
            const n = this.publisherTail.subscribers;
            return n !== 0 && (this.publisherTail.next = {
                value: e,
                subscribers: n,
                next: null
            }, this.publisherTail = this.publisherTail.next, this.publisherIndex += 1), this.replayBuffer && this.replayBuffer.offer(e), !0;
        }
        publishAll(e) {
            if (this.publisherTail.subscribers !== 0) for (const n of e)this.publish(n);
            else this.replayBuffer && this.replayBuffer.offerAll(e);
            return En();
        }
        slide() {
            this.publisherHead !== this.publisherTail && (this.publisherHead = this.publisherHead.next, this.publisherHead.value = Dr, this.subscribersIndex += 1), this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.publisherTail.subscribers += 1, new lAe(this, this.publisherTail, this.publisherIndex, !1);
        }
    }
    class lAe {
        self;
        subscriberHead;
        subscriberIndex;
        unsubscribed;
        constructor(e, n, r, s){
            this.self = e, this.subscriberHead = n, this.subscriberIndex = r, this.unsubscribed = s;
        }
        isEmpty() {
            if (this.unsubscribed) return !0;
            let e = !0, n = !0;
            for(; n;)this.subscriberHead === this.self.publisherTail ? n = !1 : this.subscriberHead.next.value !== Dr ? (e = !1, n = !1) : (this.subscriberHead = this.subscriberHead.next, this.subscriberIndex += 1);
            return e;
        }
        size() {
            return this.unsubscribed ? 0 : this.self.publisherIndex - Math.max(this.subscriberIndex, this.self.subscribersIndex);
        }
        poll(e) {
            if (this.unsubscribed) return e;
            let n = !0, r = e;
            for(; n;)if (this.subscriberHead === this.self.publisherTail) n = !1;
            else {
                const s = this.subscriberHead.next.value;
                s !== Dr && (r = s, this.subscriberHead.subscribers -= 1, this.subscriberHead.subscribers === 0 && (this.self.publisherHead = this.self.publisherHead.next, this.self.publisherHead.value = Dr, this.self.subscribersIndex += 1), n = !1), this.subscriberHead = this.subscriberHead.next, this.subscriberIndex += 1;
            }
            return r;
        }
        pollUpTo(e) {
            const n = [], r = Dr;
            let s = 0;
            for(; s !== e;){
                const i = this.poll(r);
                i === r ? s = e : (n.push(i), s += 1);
            }
            return Co(n);
        }
        unsubscribe() {
            if (!this.unsubscribed) for(this.unsubscribed = !0, this.self.publisherTail.subscribers -= 1; this.subscriberHead !== this.self.publisherTail;)this.subscriberHead.next.value !== Dr && (this.subscriberHead.subscribers -= 1, this.subscriberHead.subscribers === 0 && (this.self.publisherHead = this.self.publisherHead.next, this.self.publisherHead.value = Dr, this.self.subscribersIndex += 1)), this.subscriberHead = this.subscriberHead.next;
        }
    }
    let uAe = class extends $c {
        pubsub;
        subscribers;
        subscription;
        pollers;
        shutdownHook;
        shutdownFlag;
        strategy;
        replayWindow;
        [aI] = uI;
        constructor(e, n, r, s, i, o, a, c){
            super(), this.pubsub = e, this.subscribers = n, this.subscription = r, this.pollers = s, this.shutdownHook = i, this.shutdownFlag = o, this.strategy = a, this.replayWindow = c;
        }
        commit() {
            return this.take;
        }
        pipe() {
            return St(this, arguments);
        }
        capacity() {
            return this.pubsub.capacity;
        }
        isActive() {
            return !Tn(this.shutdownFlag);
        }
        get size() {
            return Rt(()=>Tn(this.shutdownFlag) ? os : Ke(this.subscription.size() + this.replayWindow.remaining));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Fe() : ze(this.subscription.size() + this.replayWindow.remaining);
        }
        get isFull() {
            return Rt(()=>Tn(this.shutdownFlag) ? os : Ke(this.subscription.size() === this.capacity()));
        }
        get isEmpty() {
            return Pt(this.size, (e)=>e === 0);
        }
        get shutdown() {
            return Up(fn((e)=>(Bp(this.shutdownFlag, !0), V(FE(Jh(this.pollers), (n)=>qv(n, e.id()), !1), Wr($e(()=>{
                    this.subscribers.delete(this.subscription), this.subscription.unsubscribe(), this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers);
                })), l1(d1(this.shutdownHook, void 0)), Mi))));
        }
        get isShutdown() {
            return $e(()=>Tn(this.shutdownFlag));
        }
        get awaitShutdown() {
            return la(this.shutdownHook);
        }
        get take() {
            return fn((e)=>{
                if (Tn(this.shutdownFlag)) return os;
                if (this.replayWindow.remaining > 0) {
                    const r = this.replayWindow.take();
                    return Ke(r);
                }
                const n = Hf(this.pollers) ? this.subscription.poll(Er) : Er;
                if (n === Er) {
                    const r = zg(e.id());
                    return V(Rt(()=>(V(this.pollers, Td(r)), V(this.subscribers, q$(this.subscription, this.pollers)), this.strategy.unsafeCompletePollers(this.pubsub, this.subscribers, this.subscription, this.pollers), Tn(this.shutdownFlag) ? os : la(r))), zp(()=>$e(()=>mAe(this.pollers, r))));
                } else return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), Ke(n);
            });
        }
        get takeAll() {
            return Rt(()=>{
                if (Tn(this.shutdownFlag)) return os;
                const e = Hf(this.pollers) ? hAe(this.subscription) : En();
                return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), this.replayWindow.remaining > 0 ? Ke(Ar(this.replayWindow.takeAll(), e)) : Ke(e);
            });
        }
        takeUpTo(e) {
            return Rt(()=>{
                if (Tn(this.shutdownFlag)) return os;
                let n;
                if (this.replayWindow.remaining >= e) {
                    const s = this.replayWindow.takeN(e);
                    return Ke(s);
                } else this.replayWindow.remaining > 0 && (n = this.replayWindow.takeAll(), e = e - n.length);
                const r = Hf(this.pollers) ? gAe(this.subscription, e) : En();
                return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), Ke(n ? Ar(n, r) : r);
            });
        }
        takeBetween(e, n) {
            return Rt(()=>W$(this, e, n, En()));
        }
    };
    const W$ = (t, e, n, r)=>n < e ? Ke(r) : V(t.takeUpTo(n), Me((s)=>{
            const i = e - s.length;
            return i === 1 ? V(t.take, Pt((o)=>V(r, Ar(s), Gm(o)))) : i > 1 ? V(t.take, Me((o)=>W$(t, i - 1, n - s.length - 1, V(r, Ar(s), Gm(o))))) : Ke(V(r, Ar(s)));
        }));
    class dAe {
        pubsub;
        subscribers;
        scope;
        shutdownHook;
        shutdownFlag;
        strategy;
        [z$] = U$;
        [aI] = uI;
        constructor(e, n, r, s, i, o){
            this.pubsub = e, this.subscribers = n, this.scope = r, this.shutdownHook = s, this.shutdownFlag = i, this.strategy = o;
        }
        capacity() {
            return this.pubsub.capacity;
        }
        get size() {
            return Rt(()=>Tn(this.shutdownFlag) ? os : $e(()=>this.pubsub.size()));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Fe() : ze(this.pubsub.size());
        }
        get isFull() {
            return Pt(this.size, (e)=>e === this.capacity());
        }
        get isEmpty() {
            return Pt(this.size, (e)=>e === 0);
        }
        get awaitShutdown() {
            return la(this.shutdownHook);
        }
        get isShutdown() {
            return $e(()=>Tn(this.shutdownFlag));
        }
        get shutdown() {
            return Up(fn((e)=>(V(this.shutdownFlag, Bp(!0)), V(this.scope.close(fW(e.id())), Wr(this.strategy.shutdown), l1(d1(this.shutdownHook, void 0)), Mi))));
        }
        publish(e) {
            return Rt(()=>Tn(this.shutdownFlag) ? os : this.pubsub.publish(e) ? (this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers), Ke(!0)) : this.strategy.handleSurplus(this.pubsub, this.subscribers, Mn(e), this.shutdownFlag));
        }
        isActive() {
            return !Tn(this.shutdownFlag);
        }
        unsafeOffer(e) {
            return Tn(this.shutdownFlag) ? !1 : this.pubsub.publish(e) ? (this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers), !0) : !1;
        }
        publishAll(e) {
            return Rt(()=>{
                if (Tn(this.shutdownFlag)) return os;
                const n = bAe(this.pubsub, e);
                return this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers), Eg(n) ? Ke(!0) : this.strategy.handleSurplus(this.pubsub, this.subscribers, n, this.shutdownFlag);
            });
        }
        get subscribe() {
            const e = $0(BE([
                this.scope.fork(ld),
                eAe(this.pubsub, this.subscribers, this.strategy)
            ]), (n)=>n[0].addFinalizer(()=>n[1].shutdown));
            return Pt(LK(e, (n, r)=>n[0].close(r)), (n)=>n[1]);
        }
        offer(e) {
            return this.publish(e);
        }
        offerAll(e) {
            return this.publishAll(e);
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const f3 = (t, e)=>Me(qg(), (n)=>Pt(Ug(), (r)=>fAe(t, new Map, n, r, Dp(!1), e))), fAe = (t, e, n, r, s, i)=>new dAe(t, e, n, r, s, i), pAe = (t)=>{
        if (t <= 0) throw new l8e(`Cannot construct PubSub with capacity of ${t}`);
    }, K$ = (t, e)=>{
        Wv(t, Ke(e));
    }, nx = (t, e)=>V(t, fE(e)), Jh = (t)=>V(t, Gv(Number.POSITIVE_INFINITY)), hAe = (t)=>t.pollUpTo(Number.POSITIVE_INFINITY), gAe = (t, e)=>t.pollUpTo(e), bAe = (t, e)=>t.publishAll(e), mAe = (t, e)=>{
        nx(t, V(Jh(t), Jy((n)=>n !== e)));
    };
    class yAe {
        publishers = f1();
        get shutdown() {
            return Me(a1, (e)=>Me($e(()=>Jh(this.publishers)), (n)=>Ba(n, ([r, s, i])=>i ? V(qv(s, e), Mi) : mn, !1, !1)));
        }
        handleSurplus(e, n, r, s) {
            return fn((i)=>{
                const o = zg(i.id());
                return V(Rt(()=>(this.unsafeOffer(r, o), this.unsafeOnPubSubEmptySpace(e, n), this.unsafeCompleteSubscribers(e, n), Tn(s) ? os : la(o))), zp(()=>$e(()=>this.unsafeRemove(o))));
            });
        }
        unsafeOnPubSubEmptySpace(e, n) {
            let r = !0;
            for(; r && !e.isFull();){
                const s = V(this.publishers, Mc(Er));
                if (s === Er) r = !1;
                else {
                    const i = e.publish(s[0]);
                    i && s[2] ? K$(s[1], !0) : i || nx(this.publishers, V(Jh(this.publishers), Rs(s))), this.unsafeCompleteSubscribers(e, n);
                }
            }
        }
        unsafeCompletePollers(e, n, r, s) {
            return fI(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return pI(this, e, n);
        }
        unsafeOffer(e, n) {
            const r = e[Symbol.iterator]();
            let s = r.next();
            if (!s.done) for(;;){
                const i = s.value;
                if (s = r.next(), s.done) {
                    V(this.publishers, Td([
                        i,
                        n,
                        !0
                    ]));
                    break;
                }
                V(this.publishers, Td([
                    i,
                    n,
                    !1
                ]));
            }
        }
        unsafeRemove(e) {
            nx(this.publishers, V(Jh(this.publishers), Jy(([n, r])=>r !== e)));
        }
    }
    class $$ {
        get shutdown() {
            return mn;
        }
        handleSurplus(e, n, r, s) {
            return Ke(!1);
        }
        unsafeOnPubSubEmptySpace(e, n) {}
        unsafeCompletePollers(e, n, r, s) {
            return fI(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return pI(this, e, n);
        }
    }
    class wAe {
        get shutdown() {
            return mn;
        }
        handleSurplus(e, n, r, s) {
            return $e(()=>(this.unsafeSlidingPublish(e, r), this.unsafeCompleteSubscribers(e, n), !0));
        }
        unsafeOnPubSubEmptySpace(e, n) {}
        unsafeCompletePollers(e, n, r, s) {
            return fI(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return pI(this, e, n);
        }
        unsafeSlidingPublish(e, n) {
            const r = n[Symbol.iterator]();
            let s = r.next();
            if (!s.done && e.capacity > 0) {
                let i = s.value, o = !0;
                for(; o;){
                    e.slide();
                    const a = e.publish(i);
                    a && (s = r.next()) && !s.done ? i = s.value : a && (o = !1);
                }
            }
        }
    }
    const fI = (t, e, n, r, s)=>{
        let i = !0;
        for(; i && !r.isEmpty();){
            const o = V(s, Mc(Er));
            if (o === Er) V(n, WIe(r, s)), Hf(s) ? i = !1 : V(n, q$(r, s));
            else {
                const a = r.poll(Er);
                a === Er ? nx(s, V(Jh(s), Rs(o))) : (K$(o, a), t.unsafeOnPubSubEmptySpace(e, n));
            }
        }
    }, pI = (t, e, n)=>{
        for (const [r, s] of n)for (const i of s)t.unsafeCompletePollers(e, n, r, i);
    };
    class X$ {
        capacity;
        constructor(e){
            this.capacity = e;
        }
        head = {
            value: Dr,
            next: null
        };
        tail = this.head;
        size = 0;
        index = 0;
        slide() {
            this.index++;
        }
        offer(e) {
            this.tail.value = e, this.tail.next = {
                value: Dr,
                next: null
            }, this.tail = this.tail.next, this.size === this.capacity ? this.head = this.head.next : this.size += 1;
        }
        offerAll(e) {
            for (const n of e)this.offer(n);
        }
    }
    class p3 {
        buffer;
        head;
        index;
        remaining;
        constructor(e){
            this.buffer = e, this.index = e.index, this.remaining = e.size, this.head = e.head;
        }
        fastForward() {
            for(; this.index < this.buffer.index;)this.head = this.head.next, this.index++;
        }
        take() {
            if (this.remaining === 0) return;
            this.index < this.buffer.index && this.fastForward(), this.remaining--;
            const e = this.head.value;
            return this.head = this.head.next, e;
        }
        takeN(e) {
            if (this.remaining === 0) return En();
            this.index < this.buffer.index && this.fastForward();
            const n = Math.min(e, this.remaining), r = new Array(n);
            for(let s = 0; s < n; s++){
                const i = this.head.value;
                this.head = this.head.next, r[s] = i;
            }
            return this.remaining -= n, Yi(r);
        }
        takeAll() {
            return this.takeN(this.remaining);
        }
    }
    const h3 = {
        remaining: 0,
        take: ()=>{},
        takeN: ()=>En(),
        takeAll: ()=>En()
    }, PN = KIe, _Ae = $Ie, xAe = XIe, G$ = GIe, wk = ZIe, Z$ = JIe, ON = YIe, by = CIe, vAe = EIe, SAe = IIe, hI = AIe, kAe = MIe, TAe = RIe, yp = NIe, Ws = VIe, rx = yk, CAe = BIe, J$ = "Continue", EAe = "Close", IAe = "Yield", AAe = "effect/ChannelChildExecutorDecision", MN = Symbol.for(AAe), PAe = {
        [MN]: MN
    }, Y$ = (t)=>{
        const e = Object.create(PAe);
        return e._tag = J$, e;
    }, R_ = "ContinuationK", OAe = "ContinuationFinalizer", Q$ = Symbol.for("effect/ChannelContinuation"), eX = {
        _Env: (t)=>t,
        _InErr: (t)=>t,
        _InElem: (t)=>t,
        _InDone: (t)=>t,
        _OutErr: (t)=>t,
        _OutDone: (t)=>t,
        _OutErr2: (t)=>t,
        _OutElem: (t)=>t,
        _OutDone2: (t)=>t
    };
    class gI {
        onSuccess;
        onHalt;
        _tag = R_;
        [Q$] = eX;
        constructor(e, n){
            this.onSuccess = e, this.onHalt = n;
        }
        onExit(e) {
            return aE(e) ? this.onHalt(e.cause) : this.onSuccess(e.value);
        }
    }
    class MAe {
        finalizer;
        _tag = OAe;
        [Q$] = eX;
        constructor(e){
            this.finalizer = e;
        }
    }
    const tX = "PullAfterNext", RAe = "PullAfterAllEnqueued", NAe = "effect/ChannelUpstreamPullStrategy", VAe = Symbol.for(NAe), DAe = {
        _A: (t)=>t
    }, BAe = {
        [VAe]: DAe
    }, nX = (t)=>{
        const e = Object.create(BAe);
        return e._tag = tX, e.emitSeparator = t, e;
    }, rX = "BracketOut", sX = "Bridge", bI = "ConcatAll", iX = "Emit", oX = "Ensuring", aX = "Fail", mI = "Fold", cX = "FromEffect", lX = "PipeTo", uX = "Provide", dX = "Read", fX = "Succeed", pX = "SucceedNow", hX = "Suspend", FAe = "effect/Channel", gX = Symbol.for(FAe), LAe = {
        _Env: (t)=>t,
        _InErr: (t)=>t,
        _InElem: (t)=>t,
        _InDone: (t)=>t,
        _OutErr: (t)=>t,
        _OutElem: (t)=>t,
        _OutDone: (t)=>t
    }, ai = {
        [gX]: LAe,
        pipe () {
            return St(this, arguments);
        }
    }, bX = (t)=>Ft(t, gX) || Xg(t), zAe = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = rX, n.acquire = ()=>t, n.finalizer = e, n;
    }), yI = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = mI, n.channel = t, n.k = new gI(dd, e), n;
    }), RN = (t)=>S1(()=>{
            const e = [];
            return Kt(Xr(t, mX(e)), (n)=>g3(()=>[
                        Co(e),
                        n
                    ]));
        }), mX = (t)=>Wd({
            onInput: (e)=>Kt(g3(()=>{
                    t.push(e);
                }), ()=>mX(t)),
            onFailure: So,
            onDone: ua
        }), yX = (t, e, n)=>{
        const r = Object.create(ai);
        return r._tag = bI, r.combineInners = e, r.combineAll = n, r.onPull = ()=>nX(Fe()), r.onEmit = ()=>Y$, r.value = ()=>t, r.k = Ht, r;
    }, UAe = j(4, (t, e, n, r)=>{
        const s = Object.create(ai);
        return s._tag = bI, s.combineInners = n, s.combineAll = r, s.onPull = ()=>nX(Fe()), s.onEmit = ()=>Y$, s.value = ()=>t, s.k = e, s;
    }), wI = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = sX, n.input = e, n.channel = t, n;
    }), HAe = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = oX, n.channel = t, n.finalizer = e, n;
    }), So = (t)=>vr(UE(t)), vr = (t)=>jAe(()=>t), jAe = (t)=>{
        const e = Object.create(ai);
        return e._tag = aX, e.error = t, e;
    }, Kt = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = mI, n.channel = t, n.k = new gI(e, vr), n;
    }), er = (t)=>{
        const e = Object.create(ai);
        return e._tag = cX, e.effect = ()=>t, e;
    }, Xr = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = lX, n.left = ()=>t, n.right = ()=>e, n;
    }), wX = j(2, (t, e)=>{
        const n = Object.create(ai);
        return n._tag = uX, n.context = ()=>e, n.inner = t, n;
    }), Wd = (t)=>Ri({
            onInput: t.onInput,
            onFailure: (e)=>xr(y1(e), {
                    onLeft: t.onFailure,
                    onRight: vr
                }),
            onDone: t.onDone
        }), Ri = (t)=>{
        const e = Object.create(ai);
        return e._tag = dX, e.more = t.onInput, e.done = new gI(t.onDone, t.onFailure), e;
    }, dd = (t)=>g3(()=>t), ua = (t)=>{
        const e = Object.create(ai);
        return e._tag = pX, e.terminal = t, e;
    }, S1 = (t)=>{
        const e = Object.create(ai);
        return e._tag = hX, e.channel = t, e;
    }, g3 = (t)=>{
        const e = Object.create(ai);
        return e._tag = fX, e.evaluate = t, e;
    }, cs = ua(void 0), un = (t)=>{
        const e = Object.create(ai);
        return e._tag = iX, e.out = t, e;
    }, k1 = "Done", T1 = "Emit", Jg = "FromEffect", C1 = "Read", qAe = Symbol.for("effect/ChannelState"), WAe = {
        _E: (t)=>t,
        _R: (t)=>t
    }, b3 = {
        [qAe]: WAe
    }, _h = ()=>{
        const t = Object.create(b3);
        return t._tag = k1, t;
    }, H8 = ()=>{
        const t = Object.create(b3);
        return t._tag = T1, t;
    }, Tb = (t)=>{
        const e = Object.create(b3);
        return e._tag = Jg, e.effect = t, e;
    }, j8 = (t, e, n, r)=>{
        const s = Object.create(b3);
        return s._tag = C1, s.upstream = t, s.onEffect = e, s.onEmit = n, s.onDone = r, s;
    }, sx = (t)=>t._tag === Jg, KAe = (t)=>sx(t) ? t.effect : ln, NN = (t)=>sx(t) ? XEe(t.effect) : void 0, _X = "PullFromChild", _k = "PullFromUpstream", xk = "DrainChildExecutors", xX = "Emit";
    class jw {
        childExecutor;
        parentSubexecutor;
        onEmit;
        _tag = _X;
        constructor(e, n, r){
            this.childExecutor = e, this.parentSubexecutor = n, this.onEmit = r;
        }
        close(e) {
            const n = this.childExecutor.close(e), r = this.parentSubexecutor.close(e);
            return n !== void 0 && r !== void 0 ? l3(_s(n), _s(r), (s, i)=>V(s, ty(i))) : n !== void 0 ? n : r !== void 0 ? r : void 0;
        }
        enqueuePullFromChild(e) {
            return this;
        }
    }
    class Ef {
        upstreamExecutor;
        createChild;
        lastDone;
        activeChildExecutors;
        combineChildResults;
        combineWithChildResult;
        onPull;
        onEmit;
        _tag = _k;
        constructor(e, n, r, s, i, o, a, c){
            this.upstreamExecutor = e, this.createChild = n, this.lastDone = r, this.activeChildExecutors = s, this.combineChildResults = i, this.combineWithChildResult = o, this.onPull = a, this.onEmit = c;
        }
        close(e) {
            const n = this.upstreamExecutor.close(e), s = [
                ...this.activeChildExecutors.map((i)=>i !== void 0 ? i.childExecutor.close(e) : void 0),
                n
            ].reduce((i, o)=>i !== void 0 && o !== void 0 ? l3(i, _s(o), (a, c)=>ty(a, c)) : i !== void 0 ? i : o !== void 0 ? _s(o) : void 0, void 0);
            return s;
        }
        enqueuePullFromChild(e) {
            return new Ef(this.upstreamExecutor, this.createChild, this.lastDone, [
                ...this.activeChildExecutors,
                e
            ], this.combineChildResults, this.combineWithChildResult, this.onPull, this.onEmit);
        }
    }
    class Bh {
        upstreamExecutor;
        lastDone;
        activeChildExecutors;
        upstreamDone;
        combineChildResults;
        combineWithChildResult;
        onPull;
        _tag = xk;
        constructor(e, n, r, s, i, o, a){
            this.upstreamExecutor = e, this.lastDone = n, this.activeChildExecutors = r, this.upstreamDone = s, this.combineChildResults = i, this.combineWithChildResult = o, this.onPull = a;
        }
        close(e) {
            const n = this.upstreamExecutor.close(e), s = [
                ...this.activeChildExecutors.map((i)=>i !== void 0 ? i.childExecutor.close(e) : void 0),
                n
            ].reduce((i, o)=>i !== void 0 && o !== void 0 ? l3(i, _s(o), (a, c)=>ty(a, c)) : i !== void 0 ? i : o !== void 0 ? _s(o) : void 0, void 0);
            return s;
        }
        enqueuePullFromChild(e) {
            return new Bh(this.upstreamExecutor, this.lastDone, [
                ...this.activeChildExecutors,
                e
            ], this.upstreamDone, this.combineChildResults, this.combineWithChildResult, this.onPull);
        }
    }
    class q8 {
        value;
        next;
        _tag = xX;
        constructor(e, n){
            this.value = e, this.next = n;
        }
        close(e) {
            const n = this.next.close(e);
            return n;
        }
        enqueuePullFromChild(e) {
            return this;
        }
    }
    const $Ae = "Pulled", XAe = "NoUpstream", GAe = "effect/ChannelUpstreamPullRequest", ZAe = Symbol.for(GAe), JAe = {
        _A: (t)=>t
    }, vX = {
        [ZAe]: JAe
    }, VN = (t)=>{
        const e = Object.create(vX);
        return e._tag = $Ae, e.value = t, e;
    }, YAe = (t)=>{
        const e = Object.create(vX);
        return e._tag = XAe, e.activeDownstreamCount = t, e;
    };
    class Nf {
        _activeSubexecutor = void 0;
        _cancelled = void 0;
        _closeLastSubstream = void 0;
        _currentChannel;
        _done = void 0;
        _doneStack = [];
        _emitted = void 0;
        _executeCloseLastSubstream;
        _input = void 0;
        _inProgressFinalizer = void 0;
        _providedEnv;
        constructor(e, n, r){
            this._currentChannel = e, this._executeCloseLastSubstream = r, this._providedEnv = n;
        }
        run() {
            let e;
            for(; e === void 0;)if (this._cancelled !== void 0) e = this.processCancellation();
            else if (this._activeSubexecutor !== void 0) e = this.runSubexecutor();
            else try {
                if (this._currentChannel === void 0) e = _h();
                else switch(Xg(this._currentChannel) && (this._currentChannel = er(this._currentChannel)), this._currentChannel._tag){
                    case rX:
                        {
                            e = this.runBracketOut(this._currentChannel);
                            break;
                        }
                    case sX:
                        {
                            const n = this._currentChannel.input;
                            if (this._currentChannel = this._currentChannel.channel, this._input !== void 0) {
                                const r = this._input;
                                this._input = void 0;
                                const s = ()=>nt(n.awaitRead(), ()=>wr(()=>{
                                            const i = r.run();
                                            switch(i._tag){
                                                case k1:
                                                    return Ec(r.getDone(), {
                                                        onFailure: (o)=>n.error(o),
                                                        onSuccess: (o)=>n.done(o)
                                                    });
                                                case T1:
                                                    return nt(n.emit(r.getEmit()), ()=>s());
                                                case Jg:
                                                    return go(i.effect, {
                                                        onFailure: (o)=>n.error(o),
                                                        onSuccess: ()=>s()
                                                    });
                                                case C1:
                                                    return _I(i, ()=>s(), (o)=>n.error(o));
                                            }
                                        }));
                                e = Tb(nt(M_(ho(s())), (i)=>Kn(()=>this.addFinalizer((o)=>nt(Rc(i), ()=>wr(()=>{
                                                    const a = this.restorePipe(o, r);
                                                    return a !== void 0 ? a : ln;
                                                }))))));
                            }
                            break;
                        }
                    case bI:
                        {
                            const n = new Nf(this._currentChannel.value(), this._providedEnv, (s)=>Kn(()=>{
                                    const i = this._closeLastSubstream === void 0 ? ln : this._closeLastSubstream;
                                    this._closeLastSubstream = V(i, kn(s));
                                }));
                            n._input = this._input;
                            const r = this._currentChannel;
                            this._activeSubexecutor = new Ef(n, (s)=>r.k(s), void 0, [], (s, i)=>r.combineInners(s, i), (s, i)=>r.combineAll(s, i), (s)=>r.onPull(s), (s)=>r.onEmit(s)), this._closeLastSubstream = void 0, this._currentChannel = void 0;
                            break;
                        }
                    case iX:
                        {
                            this._emitted = this._currentChannel.out, this._currentChannel = this._activeSubexecutor !== void 0 ? void 0 : cs, e = H8();
                            break;
                        }
                    case oX:
                        {
                            this.runEnsuring(this._currentChannel);
                            break;
                        }
                    case aX:
                        {
                            e = this.doneHalt(this._currentChannel.error());
                            break;
                        }
                    case mI:
                        {
                            this._doneStack.push(this._currentChannel.k), this._currentChannel = this._currentChannel.channel;
                            break;
                        }
                    case cX:
                        {
                            const n = this._providedEnv === void 0 ? this._currentChannel.effect() : V(this._currentChannel.effect(), Pd(this._providedEnv));
                            e = Tb(go(n, {
                                onFailure: (r)=>{
                                    const s = this.doneHalt(r);
                                    return s !== void 0 && sx(s) ? s.effect : ln;
                                },
                                onSuccess: (r)=>{
                                    const s = this.doneSucceed(r);
                                    return s !== void 0 && sx(s) ? s.effect : ln;
                                }
                            }));
                            break;
                        }
                    case lX:
                        {
                            const n = this._input, r = new Nf(this._currentChannel.left(), this._providedEnv, (s)=>this._executeCloseLastSubstream(s));
                            r._input = n, this._input = r, this.addFinalizer((s)=>{
                                const i = this.restorePipe(s, n);
                                return i !== void 0 ? i : ln;
                            }), this._currentChannel = this._currentChannel.right();
                            break;
                        }
                    case uX:
                        {
                            const n = this._providedEnv;
                            this._providedEnv = this._currentChannel.context(), this._currentChannel = this._currentChannel.inner, this.addFinalizer(()=>Kn(()=>{
                                    this._providedEnv = n;
                                }));
                            break;
                        }
                    case dX:
                        {
                            const n = this._currentChannel;
                            e = j8(this._input, Ht, (r)=>{
                                try {
                                    this._currentChannel = n.more(r);
                                } catch (s) {
                                    this._currentChannel = n.done.onExit(I8e(s));
                                }
                            }, (r)=>{
                                const s = (i)=>n.done.onExit(i);
                                this._currentChannel = s(r);
                            });
                            break;
                        }
                    case fX:
                        {
                            e = this.doneSucceed(this._currentChannel.evaluate());
                            break;
                        }
                    case pX:
                        {
                            e = this.doneSucceed(this._currentChannel.terminal);
                            break;
                        }
                    case hX:
                        {
                            this._currentChannel = this._currentChannel.channel();
                            break;
                        }
                }
            } catch (n) {
                this._currentChannel = vr(ak(n));
            }
            return e;
        }
        getDone() {
            return this._done;
        }
        getEmit() {
            return this._emitted;
        }
        cancelWith(e) {
            this._cancelled = e;
        }
        clearInProgressFinalizer() {
            this._inProgressFinalizer = void 0;
        }
        storeInProgressFinalizer(e) {
            this._inProgressFinalizer = e;
        }
        popAllFinalizers(e) {
            const n = [];
            let r = this._doneStack.pop();
            for(; r;)r._tag === "ContinuationFinalizer" && n.push(r.finalizer), r = this._doneStack.pop();
            const s = n.length === 0 ? ln : K8(n, e);
            return this.storeInProgressFinalizer(s), s;
        }
        popNextFinalizers() {
            const e = [];
            for(; this._doneStack.length !== 0;){
                const n = this._doneStack[this._doneStack.length - 1];
                if (n._tag === R_) return e;
                e.push(n), this._doneStack.pop();
            }
            return e;
        }
        restorePipe(e, n) {
            const r = this._input;
            return this._input = n, r !== void 0 ? r.close(e) : ln;
        }
        close(e) {
            let n;
            const r = this._inProgressFinalizer;
            r !== void 0 && (n = V(r, Mf(Kn(()=>this.clearInProgressFinalizer()))));
            let s;
            const i = this.popAllFinalizers(e);
            i !== void 0 && (s = V(i, Mf(Kn(()=>this.clearInProgressFinalizer()))));
            const o = this._activeSubexecutor === void 0 ? void 0 : this._activeSubexecutor.close(e);
            if (!(o === void 0 && n === void 0 && s === void 0)) return V(_s(W8(o)), ex(_s(W8(n))), ex(_s(W8(s))), wt(([[a, c], l])=>V(a, ty(c), ty(l))), em, nt((a)=>wr(()=>a)));
        }
        doneSucceed(e) {
            if (this._doneStack.length === 0) return this._done = po(e), this._currentChannel = void 0, _h();
            const n = this._doneStack[this._doneStack.length - 1];
            if (n._tag === R_) {
                this._doneStack.pop(), this._currentChannel = n.onSuccess(e);
                return;
            }
            const r = this.popNextFinalizers();
            if (this._doneStack.length === 0) return this._doneStack = r.reverse(), this._done = po(e), this._currentChannel = void 0, _h();
            const s = K8(r.map((o)=>o.finalizer), po(e));
            this.storeInProgressFinalizer(s);
            const i = V(s, Mf(Kn(()=>this.clearInProgressFinalizer())), em, nt(()=>Kn(()=>this.doneSucceed(e))));
            return Tb(i);
        }
        doneHalt(e) {
            if (this._doneStack.length === 0) return this._done = na(e), this._currentChannel = void 0, _h();
            const n = this._doneStack[this._doneStack.length - 1];
            if (n._tag === R_) {
                this._doneStack.pop();
                try {
                    this._currentChannel = n.onHalt(e);
                } catch (o) {
                    this._currentChannel = vr(ak(o));
                }
                return;
            }
            const r = this.popNextFinalizers();
            if (this._doneStack.length === 0) return this._doneStack = r.reverse(), this._done = na(e), this._currentChannel = void 0, _h();
            const s = K8(r.map((o)=>o.finalizer), na(e));
            this.storeInProgressFinalizer(s);
            const i = V(s, Mf(Kn(()=>this.clearInProgressFinalizer())), em, nt(()=>Kn(()=>this.doneHalt(e))));
            return Tb(i);
        }
        processCancellation() {
            return this._currentChannel = void 0, this._done = this._cancelled, this._cancelled = void 0, _h();
        }
        runBracketOut(e) {
            const n = em(go(this.provide(e.acquire()), {
                onFailure: (r)=>Kn(()=>{
                        this._currentChannel = vr(r);
                    }),
                onSuccess: (r)=>Kn(()=>{
                        this.addFinalizer((s)=>this.provide(e.finalizer(r, s))), this._currentChannel = un(r);
                    })
            }));
            return Tb(n);
        }
        provide(e) {
            return this._providedEnv === void 0 ? e : V(e, Pd(this._providedEnv));
        }
        runEnsuring(e) {
            this.addFinalizer(e.finalizer), this._currentChannel = e.channel;
        }
        addFinalizer(e) {
            this._doneStack.push(new MAe(e));
        }
        runSubexecutor() {
            const e = this._activeSubexecutor;
            switch(e._tag){
                case _X:
                    return this.pullFromChild(e.childExecutor, e.parentSubexecutor, e.onEmit, e);
                case _k:
                    return this.pullFromUpstream(e);
                case xk:
                    return this.drainChildExecutors(e);
                case xX:
                    return this._emitted = e.value, this._activeSubexecutor = e.next, H8();
            }
        }
        replaceSubexecutor(e) {
            this._currentChannel = void 0, this._activeSubexecutor = e;
        }
        finishWithExit(e) {
            const n = Ec(e, {
                onFailure: (r)=>this.doneHalt(r),
                onSuccess: (r)=>this.doneSucceed(r)
            });
            return this._activeSubexecutor = void 0, n === void 0 ? ln : KAe(n);
        }
        finishSubexecutorWithCloseEffect(e, ...n) {
            this.addFinalizer(()=>V(n, Fa((s)=>V(Kn(()=>s(e)), nt((i)=>i !== void 0 ? i : ln)), {
                    discard: !0
                })));
            const r = V(e, Ec({
                onFailure: (s)=>this.doneHalt(s),
                onSuccess: (s)=>this.doneSucceed(s)
            }));
            return this._activeSubexecutor = void 0, r;
        }
        applyUpstreamPullStrategy(e, n, r) {
            switch(r._tag){
                case tX:
                    {
                        const s = !e || n.some((i)=>i !== void 0);
                        return [
                            r.emitSeparator,
                            s ? [
                                void 0,
                                ...n
                            ] : n
                        ];
                    }
                case RAe:
                    {
                        const s = !e || n.some((i)=>i !== void 0);
                        return [
                            r.emitSeparator,
                            s ? [
                                ...n,
                                void 0
                            ] : n
                        ];
                    }
            }
        }
        pullFromChild(e, n, r, s) {
            return j8(e, Ht, (i)=>{
                const o = r(i);
                switch(o._tag){
                    case J$:
                        break;
                    case EAe:
                        {
                            this.finishWithDoneValue(e, n, o.value);
                            break;
                        }
                    case IAe:
                        {
                            const a = n.enqueuePullFromChild(s);
                            this.replaceSubexecutor(a);
                            break;
                        }
                }
                this._activeSubexecutor = new q8(i, this._activeSubexecutor);
            }, Ec({
                onFailure: (i)=>{
                    const o = this.handleSubexecutorFailure(e, n, i);
                    return o === void 0 ? void 0 : NN(o);
                },
                onSuccess: (i)=>{
                    this.finishWithDoneValue(e, n, i);
                }
            }));
        }
        finishWithDoneValue(e, n, r) {
            const s = n;
            switch(s._tag){
                case _k:
                    {
                        const i = new Ef(s.upstreamExecutor, s.createChild, s.lastDone !== void 0 ? s.combineChildResults(s.lastDone, r) : r, s.activeChildExecutors, s.combineChildResults, s.combineWithChildResult, s.onPull, s.onEmit);
                        this._closeLastSubstream = e.close(po(r)), this.replaceSubexecutor(i);
                        break;
                    }
                case xk:
                    {
                        const i = new Bh(s.upstreamExecutor, s.lastDone !== void 0 ? s.combineChildResults(s.lastDone, r) : r, s.activeChildExecutors, s.upstreamDone, s.combineChildResults, s.combineWithChildResult, s.onPull);
                        this._closeLastSubstream = e.close(po(r)), this.replaceSubexecutor(i);
                        break;
                    }
            }
        }
        handleSubexecutorFailure(e, n, r) {
            return this.finishSubexecutorWithCloseEffect(na(r), (s)=>n.close(s), (s)=>e.close(s));
        }
        pullFromUpstream(e) {
            if (e.activeChildExecutors.length === 0) return this.performPullFromUpstream(e);
            const n = e.activeChildExecutors[0], r = new Ef(e.upstreamExecutor, e.createChild, e.lastDone, e.activeChildExecutors.slice(1), e.combineChildResults, e.combineWithChildResult, e.onPull, e.onEmit);
            if (n === void 0) return this.performPullFromUpstream(r);
            this.replaceSubexecutor(new jw(n.childExecutor, r, n.onEmit));
        }
        performPullFromUpstream(e) {
            return j8(e.upstreamExecutor, (n)=>{
                const r = this._closeLastSubstream === void 0 ? ln : this._closeLastSubstream;
                return this._closeLastSubstream = void 0, V(this._executeCloseLastSubstream(r), kn(n));
            }, (n)=>{
                if (this._closeLastSubstream !== void 0) {
                    const o = this._closeLastSubstream;
                    return this._closeLastSubstream = void 0, V(this._executeCloseLastSubstream(o), wt(()=>{
                        const a = new Nf(e.createChild(n), this._providedEnv, this._executeCloseLastSubstream);
                        a._input = this._input;
                        const [c, l] = this.applyUpstreamPullStrategy(!1, e.activeChildExecutors, e.onPull(VN(n)));
                        this._activeSubexecutor = new jw(a, new Ef(e.upstreamExecutor, e.createChild, e.lastDone, l, e.combineChildResults, e.combineWithChildResult, e.onPull, e.onEmit), e.onEmit), gr(c) && (this._activeSubexecutor = new q8(c.value, this._activeSubexecutor));
                    }));
                }
                const r = new Nf(e.createChild(n), this._providedEnv, this._executeCloseLastSubstream);
                r._input = this._input;
                const [s, i] = this.applyUpstreamPullStrategy(!1, e.activeChildExecutors, e.onPull(VN(n)));
                this._activeSubexecutor = new jw(r, new Ef(e.upstreamExecutor, e.createChild, e.lastDone, i, e.combineChildResults, e.combineWithChildResult, e.onPull, e.onEmit), e.onEmit), gr(s) && (this._activeSubexecutor = new q8(s.value, this._activeSubexecutor));
            }, (n)=>{
                if (e.activeChildExecutors.some((i)=>i !== void 0)) {
                    const i = new Bh(e.upstreamExecutor, e.lastDone, [
                        void 0,
                        ...e.activeChildExecutors
                    ], e.upstreamExecutor.getDone(), e.combineChildResults, e.combineWithChildResult, e.onPull);
                    if (this._closeLastSubstream !== void 0) {
                        const o = this._closeLastSubstream;
                        return this._closeLastSubstream = void 0, V(this._executeCloseLastSubstream(o), wt(()=>this.replaceSubexecutor(i)));
                    }
                    this.replaceSubexecutor(i);
                    return;
                }
                const r = this._closeLastSubstream, s = this.finishSubexecutorWithCloseEffect(V(n, A8e((i)=>e.combineWithChildResult(e.lastDone, i))), ()=>r, (i)=>e.upstreamExecutor.close(i));
                return s === void 0 ? void 0 : NN(s);
            });
        }
        drainChildExecutors(e) {
            if (e.activeChildExecutors.length === 0) {
                const i = this._closeLastSubstream;
                return i !== void 0 && this.addFinalizer(()=>Zt(i)), this.finishSubexecutorWithCloseEffect(e.upstreamDone, ()=>i, (o)=>e.upstreamExecutor.close(o));
            }
            const n = e.activeChildExecutors[0], r = e.activeChildExecutors.slice(1);
            if (n === void 0) {
                const [i, o] = this.applyUpstreamPullStrategy(!0, r, e.onPull(YAe(r.reduce((a, c)=>c !== void 0 ? a + 1 : a, 0))));
                return this.replaceSubexecutor(new Bh(e.upstreamExecutor, e.lastDone, o, e.upstreamDone, e.combineChildResults, e.combineWithChildResult, e.onPull)), gr(i) ? (this._emitted = i.value, H8()) : void 0;
            }
            const s = new Bh(e.upstreamExecutor, e.lastDone, r, e.upstreamDone, e.combineChildResults, e.combineWithChildResult, e.onPull);
            this.replaceSubexecutor(new jw(n.childExecutor, s, n.onEmit));
        }
    }
    const W8 = (t)=>t !== void 0 ? t : ln, K8 = (t, e)=>V(Fa(t, (n)=>_s(n(e))), wt((n)=>V(E8e(n), Pr(()=>Xv))), nt((n)=>wr(()=>n))), _I = (t, e, n)=>{
        const r = [
            t
        ], s = ()=>{
            const i = r.pop();
            if (i === void 0 || i.upstream === void 0) return E$("Unexpected end of input for channel execution");
            const o = i.upstream.run();
            switch(o._tag){
                case T1:
                    {
                        const a = i.onEmit(i.upstream.getEmit());
                        return r.length === 0 ? a === void 0 ? wr(e) : V(a, go({
                            onFailure: n,
                            onSuccess: e
                        })) : a === void 0 ? wr(()=>s()) : V(a, go({
                            onFailure: n,
                            onSuccess: ()=>s()
                        }));
                    }
                case k1:
                    {
                        const a = i.onDone(i.upstream.getDone());
                        return r.length === 0 ? a === void 0 ? wr(e) : V(a, go({
                            onFailure: n,
                            onSuccess: e
                        })) : a === void 0 ? wr(()=>s()) : V(a, go({
                            onFailure: n,
                            onSuccess: ()=>s()
                        }));
                    }
                case Jg:
                    return r.push(i), V(i.onEffect(o.effect), eI((a)=>wr(()=>{
                            const c = i.onDone(na(a));
                            return c === void 0 ? ln : c;
                        })), go({
                        onFailure: n,
                        onSuccess: ()=>s()
                    }));
                case C1:
                    return r.push(i), r.push(o), wr(()=>s());
            }
        };
        return s();
    }, xI = j(2, (t, e)=>{
        const n = (r, s, i)=>QEe(Kn(()=>new Nf(t, void 0, Ht)), (o)=>wr(()=>N_(o.run(), o).pipe(N$(r), kn(Vr(r)), c3(Vr(s)))), (o, a)=>{
                const c = o.close(a);
                return c === void 0 ? ln : rI(c, (l)=>uy(i, vo(l)));
            });
        return hy((r)=>py([
                QK(e, L2),
                ti(),
                ti()
            ]).pipe(nt(([s, i, o])=>r(n(i, o, s)).pipe(yi(e), nt((a)=>e.addFinalizer((c)=>{
                        const l = aE(c) ? iTe(c.cause) : void 0;
                        return L6(i).pipe(nt((u)=>u ? ta(o, void 0).pipe(kn(s$(a)), kn(_N(a))) : ta(o, void 0).pipe(kn(l && Kh(l) > 0 ? nCe(a, b3e(l)) : Rc(a)), kn(_N(a)))));
                    }).pipe(kn(r(Vr(i)))))))));
    }), N_ = (t, e)=>{
        const n = t;
        switch(n._tag){
            case Jg:
                return V(n.effect, nt(()=>N_(e.run(), e)));
            case T1:
                return N_(e.run(), e);
            case k1:
                return wr(()=>e.getDone());
            case C1:
                return _I(n, ()=>N_(e.run(), e), vo);
        }
    }, QAe = "Done", ePe = "Await", tPe = "effect/ChannelMergeDecision", nPe = Symbol.for(tPe), rPe = {
        [nPe]: {
            _R: (t)=>t,
            _E0: (t)=>t,
            _Z0: (t)=>t,
            _E: (t)=>t,
            _Z: (t)=>t
        }
    }, DN = (t)=>{
        const e = Object.create(rPe);
        return e._tag = ePe, e.f = t, e;
    }, SX = "BothRunning", kX = "LeftDone", TX = "RightDone", sPe = "effect/ChannelMergeState", BN = Symbol.for(sPe), vI = {
        [BN]: BN
    }, $8 = (t, e)=>{
        const n = Object.create(vI);
        return n._tag = SX, n.left = t, n.right = e, n;
    }, FN = (t)=>{
        const e = Object.create(vI);
        return e._tag = kX, e.f = t, e;
    }, LN = (t)=>{
        const e = Object.create(vI);
        return e._tag = TX, e.f = t, e;
    }, CX = "BackPressure", EX = "BufferSliding", iPe = "effect/ChannelMergeStrategy", zN = Symbol.for(iPe), IX = {
        [zN]: zN
    }, oPe = (t)=>{
        const e = Object.create(IX);
        return e._tag = CX, e;
    }, aPe = (t)=>{
        const e = Object.create(IX);
        return e._tag = EX, e;
    }, cPe = j(2, (t, { onBackPressure: e, onBufferSliding: n })=>{
        switch(t._tag){
            case CX:
                return e();
            case EX:
                return n();
        }
    }), Oh = "Empty", tm = "Emit", nm = "Error", rm = "Done", AX = (t)=>({
            _tag: Oh,
            notifyProducer: t
        }), X8 = (t)=>({
            _tag: tm,
            notifyConsumers: t
        }), lPe = (t)=>({
            _tag: nm,
            cause: t
        }), uPe = (t)=>({
            _tag: rm,
            done: t
        });
    class dPe {
        ref;
        constructor(e){
            this.ref = e;
        }
        awaitRead() {
            return El(kf(this.ref, (e)=>e._tag === Oh ? [
                    Vr(e.notifyProducer),
                    e
                ] : [
                    ln,
                    e
                ]));
        }
        get close() {
            return tIe((e)=>this.error(nTe(e)));
        }
        done(e) {
            return El(kf(this.ref, (n)=>{
                switch(n._tag){
                    case Oh:
                        return [
                            Vr(n.notifyProducer),
                            n
                        ];
                    case tm:
                        return [
                            Fa(n.notifyConsumers, (r)=>ta(r, st(e)), {
                                discard: !0
                            }),
                            uPe(e)
                        ];
                    case nm:
                        return [
                            wh,
                            n
                        ];
                    case rm:
                        return [
                            wh,
                            n
                        ];
                }
            }));
        }
        emit(e) {
            return nt(ti(), (n)=>El(kf(this.ref, (r)=>{
                    switch(r._tag){
                        case Oh:
                            return [
                                Vr(r.notifyProducer),
                                r
                            ];
                        case tm:
                            {
                                const s = r.notifyConsumers[0], i = r.notifyConsumers.slice(1);
                                if (s !== void 0) return [
                                    ta(s, mt(e)),
                                    i.length === 0 ? AX(n) : X8(i)
                                ];
                                throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues");
                            }
                        case nm:
                            return [
                                wh,
                                r
                            ];
                        case rm:
                            return [
                                wh,
                                r
                            ];
                    }
                })));
        }
        error(e) {
            return El(kf(this.ref, (n)=>{
                switch(n._tag){
                    case Oh:
                        return [
                            Vr(n.notifyProducer),
                            n
                        ];
                    case tm:
                        return [
                            Fa(n.notifyConsumers, (r)=>gW(r, e), {
                                discard: !0
                            }),
                            lPe(e)
                        ];
                    case nm:
                        return [
                            wh,
                            n
                        ];
                    case rm:
                        return [
                            wh,
                            n
                        ];
                }
            }));
        }
        get take() {
            return this.takeWith((e)=>na(s3(e, st)), (e)=>po(e), (e)=>bW(mt(e)));
        }
        takeWith(e, n, r) {
            return nt(ti(), (s)=>El(kf(this.ref, (i)=>{
                    switch(i._tag){
                        case Oh:
                            return [
                                kn(ta(i.notifyProducer, void 0), gy(Vr(s), {
                                    onFailure: e,
                                    onSuccess: xr({
                                        onLeft: r,
                                        onRight: n
                                    })
                                })),
                                X8([
                                    s
                                ])
                            ];
                        case tm:
                            return [
                                gy(Vr(s), {
                                    onFailure: e,
                                    onSuccess: xr({
                                        onLeft: r,
                                        onRight: n
                                    })
                                }),
                                X8([
                                    ...i.notifyConsumers,
                                    s
                                ])
                            ];
                        case nm:
                            return [
                                Zt(e(i.cause)),
                                i
                            ];
                        case rm:
                            return [
                                Zt(r(i.done)),
                                i
                            ];
                    }
                })));
        }
    }
    const SI = ()=>V(ti(), nt((t)=>Nl(AX(t))), wt((t)=>new dPe(t))), fPe = j(2, (t, e)=>kI(t, ()=>e)), pPe = j(2, (t, e)=>yI(t, (n)=>xr(y1(n), {
                onLeft: e,
                onRight: vr
            }))), ix = j(2, (t, e)=>UAe(t, e, ()=>{}, ()=>{})), Yg = (t)=>{
        const e = Ri({
            onInput: ()=>e,
            onFailure: vr,
            onDone: dd
        });
        return Xr(t, e);
    }, PX = j(2, (t, e)=>HAe(t, ()=>e)), hPe = (t)=>Kt(t, Ht), m3 = (t)=>Kr(t.takeWith(vr, (e)=>Kt(un(e), ()=>m3(t)), dd)), OX = ()=>Wd({
            onInput: (t)=>Kt(un(t), ()=>OX()),
            onFailure: So,
            onDone: ua
        }), kI = j(2, (t, e)=>Kt(t, (n)=>g3(()=>e(n)))), gPe = j(2, (t, e)=>bPe(t, s3(e))), bPe = j(2, (t, e)=>yI(t, (n)=>vr(e(n)))), y3 = j(2, (t, e)=>{
        const n = Wd({
            onInput: (r)=>Kt(un(e(r)), ()=>n),
            onFailure: So,
            onDone: ua
        });
        return Xr(t, n);
    }), MX = j(2, (t, e)=>{
        const n = Ri({
            onInput: (r)=>V(er(e(r)), Kt(un), Kt(()=>n)),
            onFailure: vr,
            onDone: ua
        });
        return Xr(t, n);
    }), mPe = j(3, (t, e, n)=>w3((r)=>or(function*() {
                const s = yield* SI(), i = m3(s), o = yield* by(n);
                yield* uy(r, yp(o));
                const a = yield* ti(), c = n === Number.POSITIVE_INFINITY ? (d)=>Ht : (yield* iI(n)).withPermits;
                yield* (yield* i.pipe(Xr(t), Wf(r))).pipe(go({
                    onFailure: (d)=>Ws(o, vo(d)),
                    onSuccess: xr({
                        onLeft: (d)=>kn(ho(c(n)(ln)), Zg(Ws(o, Zt(st(d))))),
                        onRight: (d)=>or(function*() {
                                const f = yield* ti(), p = yield* ti();
                                yield* Ws(o, wt(Vr(f), mt)), yield* ta(p, void 0).pipe(kn(hy((h)=>_s(h(Vr(a))).pipe(iIe(_s(h(e(d)))), nt(Ht))).pipe(rI((h)=>gW(a, h)), N$(f))), c(1), yi(r)), yield* Vr(p);
                            })
                    })
                }), oIe, ho, yi(r));
                const u = Kr(gy(El(rx(o)), {
                    onFailure: vr,
                    onSuccess: xr({
                        onLeft: ua,
                        onRight: (d)=>Kt(un(d), ()=>u)
                    })
                }));
                return wI(u, s);
            }))), yPe = (t)=>(e)=>wPe(t)(e, m2), wPe = ({ bufferSize: t = 16, concurrency: e, mergeStrategy: n = oPe() })=>(r, s)=>w3((i)=>or(function*() {
                    const o = e === "unbounded" ? Number.MAX_SAFE_INTEGER : e, a = yield* SI(), c = m3(a), l = yield* by(t);
                    yield* uy(i, yp(l));
                    const u = yield* hI();
                    yield* uy(i, yp(u));
                    const d = yield* Nl(Fe()), f = yield* ti(), p = (yield* iI(o)).withPermits, h = yield* Wf(Xr(c, r), i);
                    function m(v) {
                        return v.pipe(nt(xr({
                            onLeft: (k)=>Zt(ze(k)),
                            onRight: (k)=>La(Ws(l, Zt(mt(k))), Fe())
                        })), mk({
                            until: (k)=>gr(k)
                        }), nt((k)=>UW(d, dn({
                                onNone: ()=>ze(k.value),
                                onSome: (_)=>ze(s(_, k.value))
                            }))), eI((k)=>ay(k) ? vo(k) : Ws(l, vo(k)).pipe(kn(ta(f, void 0)), Zg)));
                    }
                    yield* h.pipe(go({
                        onFailure: (v)=>Ws(l, vo(v)).pipe(kn(Zt(!1))),
                        onSuccess: xr({
                            onLeft: (v)=>nI(ho(Vr(f)), ho(p(o)(ln)), {
                                    onSelfDone: (k, _)=>La(Rc(_), !1),
                                    onOtherDone: (k, _)=>kn(Rc(_), Zo(d).pipe(nt(dn({
                                            onNone: ()=>Ws(l, Zt(st(v))),
                                            onSome: (A)=>Ws(l, Zt(st(s(A, v))))
                                        })), La(!1)))
                                }),
                            onRight: (v)=>cPe(n, {
                                    onBackPressure: ()=>or(function*() {
                                            const k = yield* ti(), _ = bk((P)=>Wf(Xr(c, v), P).pipe(nt((U)=>U8(_s(m(U)), _s(ho(Vr(f))))), nt(Ht)));
                                            return yield* ta(k, void 0).pipe(kn(_), p(1), yi(i)), yield* Vr(k), !(yield* L6(f));
                                        }),
                                    onBufferSliding: ()=>or(function*() {
                                            const k = yield* ti(), _ = yield* ti(), A = yield* kAe(u);
                                            yield* rx(u).pipe(nt((K)=>ta(K, void 0)), V$(()=>A >= o)), yield* Ws(u, k);
                                            const P = bk((K)=>Wf(Xr(c, v), K).pipe(nt((X)=>_s(m(X)).pipe(U8(_s(ho(Vr(f)))), U8(_s(ho(Vr(k)))))), nt(Ht)));
                                            return yield* ta(_, void 0).pipe(kn(P), p(1), yi(i)), yield* Vr(_), !(yield* L6(f));
                                        })
                                })
                        })
                    }), mk({
                        while: (v)=>v
                    }), yi(i));
                    const w = V(rx(l), El, gy({
                        onFailure: vr,
                        onSuccess: xr({
                            onLeft: ua,
                            onRight: (v)=>Kt(un(v), ()=>w)
                        })
                    }), Kr);
                    return wI(w, a);
                })), RX = j(3, (t, e, n)=>yPe(n)(y3(t, e))), _Pe = j(2, (t, e)=>{
        function n(r) {
            return or(function*() {
                const s = yield* SI(), i = m3(s), o = yield* Wf(Xr(i, t), r), a = yield* Wf(Xr(i, e.other), r);
                function c(u, d, f) {
                    return (p, h, m)=>{
                        function w(v) {
                            const k = v;
                            return k._tag === QAe ? Zt(er(kn(Rc(d), k.effect))) : wt(s$(d), Ec({
                                onFailure: (_)=>er(k.f(na(_))),
                                onSuccess: xr({
                                    onLeft: (_)=>er(k.f(po(_))),
                                    onRight: (_)=>wp(un(_), l(m(k.f)))
                                })
                            }));
                        }
                        return Ec(u, {
                            onFailure: (v)=>w(p(na(v))),
                            onSuccess: xr({
                                onLeft: (v)=>w(p(po(v))),
                                onRight: (v)=>Zt(Kt(un(v), ()=>Kt(er(yi(ho(f), r)), (k)=>l(h(k, d)))))
                            })
                        });
                    };
                }
                function l(u) {
                    switch(u._tag){
                        case SX:
                            {
                                const d = ho(Tf(u.left)), f = ho(Tf(u.right));
                                return Kr(nI(d, f, {
                                    onSelfDone: (p, h)=>kn(Rc(h), c(p, u.right, o)(e.onSelfDone, $8, (m)=>FN(m))),
                                    onOtherDone: (p, h)=>kn(Rc(h), c(p, u.left, a)(e.onOtherDone, (m, w)=>$8(w, m), (m)=>LN(m)))
                                }));
                            }
                        case kX:
                            return Kr(wt(_s(a), Ec({
                                onFailure: (d)=>er(u.f(na(d))),
                                onSuccess: xr({
                                    onLeft: (d)=>er(u.f(po(d))),
                                    onRight: (d)=>Kt(un(d), ()=>l(FN(u.f)))
                                })
                            })));
                        case TX:
                            return Kr(wt(_s(o), Ec({
                                onFailure: (d)=>er(u.f(na(d))),
                                onSuccess: xr({
                                    onLeft: (d)=>er(u.f(po(d))),
                                    onRight: (d)=>Kt(un(d), ()=>l(LN(u.f)))
                                })
                            })));
                    }
                }
                return er(gk((u)=>{
                    const d = gk((h)=>(h.transferChildren(u.scope()), ln)), f = ho(o).pipe(Mf(d), yi(r)), p = ho(a).pipe(Mf(d), yi(r));
                    return l3(f, p, (h, m)=>$8(h, m));
                })).pipe(Kt(l), wI(s));
            });
        }
        return w3(n);
    }), my = j(2, (t, e)=>S1(()=>{
            let n;
            const r = Wd({
                onInput: (i)=>Kt(un(i), ()=>r),
                onFailure: (i)=>(n = TPe(i), vr(ak(n))),
                onDone: ua
            }), s = Ri({
                onInput: (i)=>V(un(i), Kt(()=>s)),
                onFailure: (i)=>sTe(i) && CPe(i.defect) && jt(i.defect, n) ? So(i.defect.error) : vr(i),
                onDone: ua
            });
            return Xr(Xr(Xr(t, r), e), s);
        })), V_ = (t)=>bk((e)=>xI(t, e)), xPe = (t)=>V_(Yg(t)), NX = (t)=>eIe((e)=>xI(t, e)), VX = (t)=>Kr(hy((e)=>wt(Y0(), (n)=>zAe(rI(e(DTe(t, n)), (r)=>Id(n, na(r))), (r, s)=>Id(n, s))))), DX = (t)=>SPe(wt(A$, (e)=>Kt(er(t(e)), un))), vPe = (t)=>nt(A$, (e)=>Wf(t, e)), Wf = j(2, (t, e)=>ex(Kn(()=>new Nf(t, void 0, Ht)), sI()).pipe(D$(([n, r])=>VTe(e, (s)=>{
                const i = n.close(s);
                return i !== void 0 ? Pd(i, r) : ln;
            })), em, wt(([n])=>wr(()=>vk(n.run(), n))))), vk = (t, e)=>{
        const n = t;
        switch(n._tag){
            case k1:
                return Ec(e.getDone(), {
                    onFailure: vo,
                    onSuccess: (r)=>Zt(st(r))
                });
            case T1:
                return Zt(mt(e.getEmit()));
            case Jg:
                return V(n.effect, nt(()=>vk(e.run(), e)));
            case C1:
                return _I(n, ()=>vk(e.run(), e), (r)=>vo(r));
        }
    }, Kr = (t)=>hPe(er(t)), SPe = (t)=>yX(VX(t), (e, n)=>e, (e, n)=>e), w3 = (t)=>yX(DX(t), (e, n)=>e, (e, n)=>e), _3 = (t)=>BX(0, t.length, t), BX = (t, e, n)=>t === e ? cs : V(un(V(n, Da(t))), Kt(()=>BX(t + 1, e, n))), kPe = j((t)=>bX(t[1]), (t, e, n)=>n?.concurrent ? _Pe(t, {
            other: e,
            onSelfDone: (r)=>DN((s)=>wr(()=>VR(r, s))),
            onOtherDone: (r)=>DN((s)=>wr(()=>VR(s, r)))
        }) : Kt(t, (r)=>kI(e, (s)=>[
                    r,
                    s
                ]))), wp = j((t)=>bX(t[1]), (t, e, n)=>n?.concurrent ? kI(kPe(t, e, {
            concurrent: !0
        }), (r)=>r[1]) : Kt(t, ()=>e)), Sk = Symbol.for("effect/Channel/ChannelException"), TPe = (t)=>({
            _tag: "ChannelException",
            [Sk]: Sk,
            error: t
        }), CPe = (t)=>Ft(t, Sk), EPe = Symbol.for("effect/Sink"), IPe = {
        _A: (t)=>t,
        _In: (t)=>t,
        _L: (t)=>t,
        _E: (t)=>t,
        _R: (t)=>t
    };
    class Kd {
        channel;
        [EPe] = IPe;
        constructor(e){
            this.channel = e;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const FX = (t)=>new Kd(S1(()=>Q0(t()))), APe = ()=>new Kd(LX(En())), LX = (t)=>Ri({
            onInput: (e)=>LX(V(t, Ar(e))),
            onFailure: vr,
            onDone: ()=>dd(t)
        }), PPe = (t)=>FX(()=>VPe(zX(t, En()))), zX = (t, e)=>Ri({
            onInput: (n)=>{
                const [r, s] = Jj(n, t);
                return r.length < t ? zX(t - r.length, Ar(e, r)) : Eg(s) ? dd(Ar(e, r)) : Kt(un(s), ()=>dd(Ar(e, r)));
            },
            onFailure: vr,
            onDone: ()=>dd(e)
        }), OPe = new Kd(Yg(OX())), MPe = (t, e, n)=>FX(()=>new Kd(UX(t, e, n))), UX = (t, e, n)=>e(t) ? Wd({
            onInput: (r)=>{
                const [s, i] = HX(t, r, e, n, 0, r.length);
                return ca(i) ? V(un(i), fPe(s)) : UX(s, e, n);
            },
            onFailure: So,
            onDone: ()=>ua(t)
        }) : ua(t), HX = (t, e, n, r, s, i)=>{
        if (s === i) return [
            t,
            En()
        ];
        const o = r(t, V(e, Da(s)));
        return n(o) ? HX(o, e, n, r, s + 1, i) : [
            o,
            V(e, xd(s + 1))
        ];
    }, RPe = (t)=>{
        const e = Ri({
            onInput: (n)=>V(er(Fa(n, (r)=>t(r), {
                    discard: !0
                })), Kt(()=>e)),
            onFailure: vr,
            onDone: ()=>cs
        });
        return new Kd(e);
    }, NPe = (t)=>{
        const e = Ri({
            onInput: (n)=>V(er(t(n)), Kt(()=>e)),
            onFailure: vr,
            onDone: ()=>cs
        });
        return new Kd(e);
    }, VPe = (t)=>new Kd(t), DPe = (t)=>new Kd(er(t)), BPe = ()=>MPe(Fe(), Qr, (t, e)=>dn(t, {
                onNone: ()=>ze(e),
                onSome: ()=>t
            })), Q0 = (t)=>Xg(t) ? Q0(DPe(t)) : t.channel, FPe = Symbol.for("effect/RcRef"), kk = {
        _tag: "Empty"
    }, LPe = {
        _tag: "Closed"
    }, zPe = {
        _A: Ht,
        _E: Ht
    };
    class UPe extends $c {
        acquire;
        context;
        scope;
        idleTimeToLive;
        [FPe] = zPe;
        [Ed] = Ed;
        state = kk;
        semaphore = qE(1);
        constructor(e, n, r, s){
            super(), this.acquire = e, this.context = n, this.scope = r, this.idleTimeToLive = s, this.get = jX(this);
        }
        get;
        commit() {
            return this.get;
        }
    }
    const HPe = (t)=>fn((e)=>{
            const n = e.getFiberRef(ba), r = Pc(n, Ua), s = new UPe(t.acquire, n, r, t.idleTimeToLive ? Ei(t.idleTimeToLive) : void 0);
            return vs(r.addFinalizer(()=>s.semaphore.withPermits(1)(Rt(()=>{
                    const i = s.state._tag === "Acquired" ? X0(s.state.scope, ei) : mn;
                    return s.state = LPe, i;
                }))), s);
        }), jX = (t)=>{
        const e = t, n = e.idleTimeToLive && !ave(e.idleTimeToLive);
        return Eo((r)=>Rt(()=>{
                switch(e.state._tag){
                    case "Closed":
                        return os;
                    case "Acquired":
                        return e.state.refCount++, e.state.fiber ? vs(Fv(e.state.fiber), e.state) : Ke(e.state);
                    case "Empty":
                        return qg().pipe(YR("scope"), W6("value", ({ scope: s })=>r(Dg(e.acquire, ba, kc(e.context, Ua, s)))), Pt(({ scope: s, value: i })=>{
                            const o = {
                                _tag: "Acquired",
                                value: i,
                                scope: s,
                                fiber: void 0,
                                refCount: 1
                            };
                            return e.state = o, o;
                        }));
                }
            })).pipe(e.semaphore.withPermits(1), YR("state"), W6("scope", ()=>Ua), $0(({ scope: r, state: s })=>r.addFinalizer(()=>Rt(()=>(s.refCount--, s.refCount > 0 || n ? mn : e.idleTimeToLive === void 0 ? (e.state = kk, X0(s.scope, ei)) : _E(e.idleTimeToLive).pipe(c1, Wr(Rt(()=>e.state._tag === "Acquired" && e.state.refCount === 0 ? (e.state = kk, X0(s.scope, ei)) : mn)), J0($e(()=>{
                        s.fiber = void 0;
                    })), WE(e.scope), $0((i)=>{
                        s.fiber = i;
                    }), e.semaphore.withPermits(1)))))), Pt(({ state: r })=>r.value));
    }, jPe = HPe, qPe = jX, WPe = i3, KPe = a$, x3 = YE, E1 = TEe, $Pe = EEe, TI = a3, XPe = PEe, I1 = MEe, qX = fy, GPe = (t)=>Object.assign(t, {
            chunk (n) {
                return this(Zt(n));
            },
            die (n) {
                return this(KEe(n));
            },
            dieMessage (n) {
                return this(E$(n));
            },
            done (n) {
                return this(wr(()=>P8e(n, {
                        onFailure: ze,
                        onSuccess: Mn
                    })));
            },
            end () {
                return this(Ns(Fe()));
            },
            fail (n) {
                return this(Ns(ze(n)));
            },
            fromEffect (n) {
                return this(I$(n, {
                    onFailure: ze,
                    onSuccess: Mn
                }));
            },
            fromEffectChunk (n) {
                return this(V(n, Ad(ze)));
            },
            halt (n) {
                return this(vo(V(n, s3(ze))));
            },
            single (n) {
                return this(Zt(Mn(n)));
            }
        }), ZPe = Symbol.for("effect/Stream/Handoff"), WX = "Empty", KX = "Full", $X = (t)=>({
            _tag: WX,
            notifyConsumer: t
        }), JPe = (t, e)=>({
            _tag: KX,
            value: t,
            notifyProducer: e
        }), XX = (t, e)=>(n)=>{
            switch(n._tag){
                case WX:
                    return t(n.notifyConsumer);
                case KX:
                    return e(n.value, n.notifyProducer);
            }
        }, YPe = {
        _A: (t)=>t
    }, QPe = ()=>V(ti(), nt((t)=>Nl($X(t))), wt((t)=>({
                [ZPe]: YPe,
                ref: t
            }))), wf = j(2, (t, e)=>nt(ti(), (n)=>El(kf(t.ref, (r)=>V(r, XX((s)=>[
                        kn(ta(s, void 0), Vr(n)),
                        JPe(e, n)
                    ], (s, i)=>[
                        nt(Vr(i), ()=>V(t, wf(e))),
                        r
                    ])))))), GX = (t)=>nt(ti(), (e)=>El(kf(t.ref, (n)=>V(n, XX((r)=>[
                        nt(Vr(r), ()=>GX(t)),
                        n
                    ], (r, s)=>[
                        La(ta(s, void 0), r),
                        $X(e)
                    ]))))), ZX = "Emit", JX = "Halt", YX = "End", eOe = (t)=>({
            _tag: ZX,
            elements: t
        }), UN = (t)=>({
            _tag: JX,
            cause: t
        }), G8 = (t)=>({
            _tag: YX,
            reason: t
        }), tOe = "effect/Take", nOe = Symbol.for(tOe), rOe = {
        _A: (t)=>t,
        _E: (t)=>t
    };
    class v3 {
        exit;
        [nOe] = rOe;
        constructor(e){
            this.exit = e;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const ox = (t)=>new v3(po(t)), sOe = (t)=>wr(()=>t.exit), ax = new v3(bW(Fe())), CI = (t)=>new v3(na(V(t, s3(ze)))), iOe = (t)=>gy(t, {
            onFailure: (e)=>dn($K(e), {
                    onNone: ()=>ax,
                    onSome: CI
                }),
            onSuccess: ox
        }), oOe = (t)=>new v3(po(Mn(t))), aOe = ()=>Ns(Fe()), cOe = (t)=>Ad(vo(t), ze), Tk = "ScheduleEnd", QX = "UpstreamEnd", Cb = {
        _tag: Tk
    }, lOe = {
        _tag: QX
    }, uOe = "effect/Stream", eG = Symbol.for(uOe), dOe = {
        _R: (t)=>t,
        _E: (t)=>t,
        _A: (t)=>t
    };
    class Yn {
        channel;
        [eG] = dOe;
        constructor(e){
            this.channel = e;
        }
        pipe() {
            return St(this, arguments);
        }
    }
    const S3 = (t)=>Ft(t, eG) || Xg(t), EI = 4096, fOe = j(3, (t, e, n)=>nG(pOe(t, e, n), (r)=>xr(r, {
                onLeft: Fe,
                onRight: ze
            }))), pOe = j(3, (t, e, n)=>{
        const r = py([
            QPe(),
            Nl(Cb),
            Nl(En()),
            x3(n),
            Nl(!1),
            Nl(!1)
        ]);
        return Za(r).pipe(wu(([s, i, o, a, c, l])=>{
            const u = Ri({
                onInput: (h)=>Kt(er(V(s, wf(eOe(h)), V$(()=>ca(h)))), ()=>u),
                onFailure: (h)=>er(wf(s, UN(h))),
                onDone: ()=>er(wf(s, G8(lOe)))
            }), d = V(zW(o, En()), nt((h)=>ca(h) ? V(ao(c, !0), kn(Zt(V(un(h), Kt(()=>d))))) : V(GX(s), wt((m)=>{
                    switch(m._tag){
                        case ZX:
                            return V(er(ao(c, !0)), wp(un(m.elements)), wp(er(Zo(l))), Kt((w)=>w ? cs : d));
                        case JX:
                            return vr(m.cause);
                        case YX:
                            return m.reason._tag === Tk ? V(Zo(c), wt((w)=>w ? er(V(ao(i, Cb), kn(ao(l, !0)))) : V(er(V(ao(i, Cb), kn(ao(l, !0)))), Kt(()=>d))), Kr) : V(ao(i, m.reason), kn(ao(l, !0)), er);
                    }
                }))), Kr), f = (h)=>a.next(h), p = (h, m, w)=>{
                const v = V(ao(c, !1), kn(ao(l, !1)), kn(V(d, my(Q0(e)), RN, V_, yi(w)))), k = (_, A, P)=>V(ao(o, Qxe(_)), kn(wt(Zo(i), (U)=>{
                        switch(U._tag){
                            case Tk:
                                return V(py([
                                    Zo(c),
                                    v,
                                    V(f(ze(A)), yi(w))
                                ]), wt(([K, X, G])=>{
                                    const ce = V(P, dn({
                                        onNone: ()=>Mn(mt(A)),
                                        onSome: (ie)=>_m(mt(A), st(ie))
                                    }));
                                    return K ? V(un(ce), Kt(()=>p(X, G, w))) : p(X, G, w);
                                }), Kr);
                            case QX:
                                return V(Zo(c), wt((K)=>K ? un(Mn(mt(A))) : cs), Kr);
                        }
                    })), Kr);
                return Kr(nI(Tf(h), Tf(m), {
                    onSelfDone: (_, A)=>V(Rc(m), kn(V(wr(()=>_), wt(([P, U])=>k(P, U, Fe()))))),
                    onOtherDone: (_, A)=>go(wr(()=>_), {
                            onFailure: (P)=>xr(y1(P), {
                                    onLeft: ()=>V(s, wf(G8(Cb)), M_, kn(V(Tf(h), wt(([U, K])=>k(U, K, Fe()))))),
                                    onRight: (U)=>V(s, wf(UN(U)), M_, kn(V(Tf(h), wt(([K, X])=>k(K, X, Fe())))))
                                }),
                            onSuccess: (P)=>V(s, wf(G8(Cb)), M_, kn(V(Tf(h), wt(([U, K])=>k(U, K, ze(P))))))
                        })
                }));
            };
            return hG((h)=>Xr(On(t), u).pipe(V_, yi(h), kn(my(d, Q0(e)).pipe(RN, V_, yi(h), nt((m)=>f(Fe()).pipe(yi(h), wt((w)=>new Yn(p(m, w, h)))))))));
        }));
    }), hOe = (t)=>{
        if (t === "unbounded") return hI();
        if (typeof t == "number" || t === void 0) return by(t ?? 16);
        switch(t.strategy){
            case "dropping":
                return vAe(t.bufferSize ?? 16);
            case "sliding":
                return SAe(t.bufferSize ?? 16);
            default:
                return by(t.bufferSize ?? 16);
        }
    }, gOe = (t, e)=>jp(hOe(e), (n)=>yp(n)).pipe(nt((n)=>sI().pipe(nt((r)=>Kn(()=>{
                    const s = KPe(r);
                    return t(GPe((o)=>iOe(o).pipe(nt((a)=>Ws(n, a)), Zg, s).then((a)=>{
                            if (aE(a) && !ay(a.cause)) throw XK(a.cause);
                        })));
                })), wt((r)=>{
                const s = rx(n).pipe(nt((i)=>sOe(i)), v1({
                    onFailure: (i)=>er(yp(n)).pipe(wp(dn(i, {
                            onNone: ()=>cs,
                            onSome: (o)=>So(o)
                        }))),
                    onSuccess: (i)=>un(i).pipe(Kt(()=>s))
                }), Kr);
                return rG(s).pipe(yy(r ?? ln));
            }))), T3), bOe = j(2, (t, e)=>wt(cMe(t, e), (n)=>PI(oG(n)))), mOe = j(2, (t, e)=>wt(jPe({
            acquire: bOe(t, e),
            idleTimeToLive: e.idleTimeToLive
        }), (n)=>T3(qPe(n)))), tG = j(2, (t, e)=>yOe(t, (n)=>xr(y1(n), {
                onLeft: e,
                onRight: kOe
            }))), yOe = j(2, (t, e)=>new Yn(V(On(t), yI((n)=>On(e(n)))))), II = j(2, (t, e)=>new Yn(V(On(t), wp(On(e))))), wOe = (t)=>new Yn(Yg(On(t))), yy = j(2, (t, e)=>new Yn(V(On(t), PX(e)))), _Oe = ()=>Za(P$()), xOe = (t)=>V(_Oe(), wu(t)), vOe = (t)=>wOe(Za(t)), SOe = (t)=>iG(Ns(ze(t))), kOe = (t)=>Za(vo(t)), TOe = j(2, (t, e)=>OI(t, Jy(e))), nG = j(2, (t, e)=>OI(t, Xj(e))), COe = j(2, (t, e)=>{
        const n = Wd({
            onInput: (r)=>dn(nve(r, e), {
                    onNone: ()=>n,
                    onSome: (s)=>un(Mn(s))
                }),
            onFailure: So,
            onDone: ()=>cs
        });
        return new Yn(V(On(t), Xr(n)));
    }), wu = j((t)=>S3(t[0]), (t, e, n)=>{
        const r = n?.bufferSize ?? 16;
        return n?.switch ? Ck(n?.concurrency, ()=>HN(t, 1, r, e), (s)=>HN(t, s, r, e)) : Ck(n?.concurrency, ()=>new Yn(ix(On(t), (s)=>V(s, Zj((i)=>On(e(i))), rve(cs, (i, o)=>V(i, wp(o)))))), (s)=>new Yn(V(On(t), ix(_3), RX((i)=>On(e(i)), n))));
    }), Ck = (t, e, n)=>{
        switch(t){
            case void 0:
                return e();
            case "unbounded":
                return n(Number.MAX_SAFE_INTEGER);
            default:
                return t > 1 ? n(t) : e();
        }
    }, HN = j(4, (t, e, n, r)=>new Yn(V(On(t), ix(_3), RX((s)=>On(r(s)), {
            concurrency: e,
            mergeStrategy: aPe(),
            bufferSize: n
        })))), AI = j((t)=>S3(t[0]), (t, e)=>wu(t, Ht, e)), EOe = (t)=>{
        const e = Ri({
            onInput: (n)=>Kt(_3(n), ()=>e),
            onFailure: vr,
            onDone: ()=>cs
        });
        return new Yn(V(On(t), Xr(e)));
    }, IOe = (t)=>{
        const e = (r, s)=>{
            const [i, o] = V(r, tve((c)=>!z6(c))), a = V(wv(o), dn({
                onNone: ()=>s,
                onSome: Ec({
                    onFailure: (c)=>dn($K(c), {
                            onNone: ()=>cs,
                            onSome: vr
                        }),
                    onSuccess: ()=>cs
                })
            }));
            return V(un(V(i, Xj((c)=>z6(c) ? ze(c.value) : Fe()))), Kt(()=>a));
        }, n = Ri({
            onInput: (r)=>e(r, n),
            onFailure: (r)=>vr(r),
            onDone: ()=>cs
        });
        return new Yn(V(On(t), Xr(n)));
    }, PI = (t)=>EOe(IOe(V(t, aG((e)=>e.exit)))), rG = (t)=>new Yn(t), On = (t)=>{
        if ("channel" in t) return t.channel;
        if (Xg(t)) return On(Za(t));
        throw new TypeError("Expected a Stream.");
    }, sG = (t)=>new Yn(Eg(t) ? cs : un(t)), Za = (t)=>V(t, Ad(ze), iG), iG = (t)=>new Yn(Kr(v1(t, {
            onFailure: dn({
                onNone: ()=>cs,
                onSome: So
            }),
            onSuccess: (e)=>un(Mn(e))
        }))), oG = (t, e)=>{
        const n = e?.maxChunkSize ?? EI;
        if (e?.scoped) {
            const s = wt(ON(t), (i)=>cx(i, {
                    maxChunkSize: n,
                    shutdown: !0
                }));
            return e.shutdown ? wt(s, yy(wk(t))) : s;
        }
        const r = wu(fG(ON(t)), (s)=>cx(s, {
                maxChunkSize: n
            }));
        return e?.shutdown ? yy(r, wk(t)) : r;
    }, AOe = (t)=>k3(()=>SC(t) ? sG(t) : POe(t[Symbol.iterator]())), POe = (t, e = EI)=>V(Kn(()=>{
            let n = [];
            const r = (s)=>V(Kn(()=>{
                    let i = s.next();
                    if (e === 1) return i.done ? cs : V(un(Mn(i.value)), Kt(()=>r(s)));
                    n = [];
                    let o = 0;
                    for(; i.done === !1 && (n.push(i.value), o = o + 1, !(o >= e));)i = s.next();
                    return o > 0 ? V(un(Yi(n)), Kt(()=>r(s))) : cs;
                }), Kr);
            return new Yn(r(t));
        }), pMe), cx = (t, e)=>V(CAe(t, 1, e?.maxChunkSize ?? EI), eI((n)=>V(TAe(t), nt((r)=>r && ay(n) ? aOe() : cOe(n)))), uG, e?.shutdown ? yy(yp(t)) : Ht), OOe = (...t)=>{
        const e = t.length === 1 ? t[0].evaluate : t[0], n = t.length === 1 ? t[0].onError : t[1], r = t.length === 1 ? t[0].releaseLockOnEnd === !0 : !1;
        return T3(wt(jp(Kn(()=>e().getReader()), (s)=>r ? Kn(()=>s.releaseLock()) : wl(()=>s.cancel())), (s)=>qOe(nt(ud({
                try: ()=>s.read(),
                catch: (i)=>ze(n(i))
            }), ({ done: i, value: o })=>i ? Ns(Fe()) : Zt(o)))));
    }, MOe = j(3, (t, e, n)=>fOe(t, PPe(e), I1(n))), ROe = (...t)=>AOe(t), aG = j(2, (t, e)=>new Yn(V(On(t), y3(Zj(e))))), NOe = j(3, (t, e, n)=>{
        const r = (s)=>Wd({
                onInput: (i)=>{
                    const [o, a] = eve(i, s, n);
                    return Kt(un(a), ()=>r(o));
                },
                onFailure: So,
                onDone: ()=>cs
            });
        return new Yn(V(On(t), Xr(r(e))));
    }), VOe = j(3, (t, e, n)=>k3(()=>{
            const r = (s)=>Wd({
                    onInput: (i)=>V(wr(()=>{
                            const o = [], a = (c)=>Kn(()=>{
                                    o.push(c);
                                });
                            return V(i, qEe(s, (c, l)=>V(n(c, l), nt(([u, d])=>V(a(d), La(u))))), v1({
                                onFailure: (c)=>o.length !== 0 ? wp(un(Yi(o)), So(c)) : So(c),
                                onSuccess: (c)=>Kt(un(Yi(o)), ()=>r(c))
                            }));
                        }), Kr),
                    onFailure: So,
                    onDone: ()=>cs
                });
            return new Yn(V(On(t), my(r(e))));
        })), OI = j(2, (t, e)=>new Yn(V(On(t), y3(e)))), DOe = j(2, (t, e)=>V(t, cG((n)=>Co(e(n))))), cG = j(2, (t, e)=>V(t, OI(Gj(e)))), BOe = j(2, (t, e)=>V(t, Ek((n)=>V(e(n), wt(Co))), cG(Ht))), Ek = j(2, (t, e)=>{
        const n = (r)=>{
            const s = r.next();
            if (s.done) return Ri({
                onInput: (i)=>n(i[Symbol.iterator]()),
                onFailure: vr,
                onDone: dd
            });
            {
                const i = s.value;
                return Kr(wt(e(i), (o)=>Kt(un(Mn(o)), ()=>n(r))));
            }
        };
        return new Yn(V(On(t), Xr(S1(()=>n(En()[Symbol.iterator]())))));
    }), FOe = j(3, (t, e, n)=>new Yn(V(On(t), ix(_3), mPe(n, e), y3(Mn)))), LOe = j(2, (t, e)=>new Yn(V(On(t), gPe(e)))), zOe = j(2, (t, e)=>new Yn(V(On(t), wX(e)))), lG = j(2, (t, e)=>new Yn(w3((n)=>gIe(e, n).pipe(wt((r)=>V(On(t), wX(r))))))), UOe = j(3, (t, e, n)=>HOe(t, e, Za(n))), HOe = j(3, (t, e, n)=>xOe((r)=>wu(n, (s)=>V(t, zOe(kc(r, e, s)))))), jOe = j(2, (t, e)=>V(t, lG(V(bIe(), yIe(e))))), uG = (t)=>pG(t, (e)=>V(wt(e, (n)=>ze([
                    n,
                    e
                ])), Gg(dn({
                onNone: ()=>Zt(Fe()),
                onSome: Ns
            })))), qOe = (t)=>uG(V(t, wt(Mn))), WOe = (t, e)=>KOe(Zt(t), e), KOe = (t, e)=>wu(Za(ex(t, x3(e))), ([n, r])=>{
            const s = O$(qX, Zo(r.iterationMeta));
            return II(sMe(n), fMe(n, (i)=>B$(r.next(i), {
                    onFailure: Zt,
                    onSuccess: ()=>wt(s(t), (o)=>ze([
                                o,
                                o
                            ]))
                })));
        }), $Oe = j(2, (t, e)=>x3(e).pipe(wt((n)=>{
            const r = UOe(qX, Zo(n.iterationMeta)), s = On(r(t)).pipe(MX((i)=>La(n.reset, i)), pPe((i)=>n.next(i).pipe(v1({
                    onFailure: ()=>So(i),
                    onSuccess: ()=>s
                }), Kr)));
            return s;
        }), Kr, rG)), MI = j(2, (t, e)=>On(t).pipe(my(Q0(e)), xPe)), XOe = (t)=>MI(t, APe()), GOe = j(2, (t, e)=>MI(t, NPe(e))), ZOe = j(2, (t, e)=>V(t, dG(RPe(e)))), JOe = (t)=>MI(t, BPe()), YOe = j(2, (t, e)=>V(t, QOe(e))), QOe = j(2, (t, e)=>{
        const n = Ri({
            onInput: (r)=>Kt(un(ox(r)), ()=>n),
            onFailure: (r)=>un(CI(r)),
            onDone: ()=>un(ax)
        });
        return V(Xr(On(t), n), MX((r)=>Ws(e, r)), Yg, NX, Zg);
    }), dG = j(2, (t, e)=>V(On(t), my(Q0(e)), Yg, NX)), eMe = j(2, (t, e)=>nG(tMe(t, e, {
            onElement: ze,
            onSchedule: Fe
        }), Ht)), tMe = j(3, (t, e, n)=>{
        const r = (s, i)=>{
            const o = i.next();
            return o.done ? Ri({
                onInput: (a)=>r(s, a[Symbol.iterator]()),
                onFailure: vr,
                onDone: ua
            }) : Kr(B$(s.next(o.value), {
                onFailure: ()=>V(s.last, cIe, wt((a)=>V(un(_m(n.onElement(o.value), n.onSchedule(a))), Kt(()=>r(s, i)))), c3(s.reset)),
                onSuccess: ()=>Zt(V(un(Mn(n.onElement(o.value))), Kt(()=>r(s, i))))
            }));
        };
        return new Yn(V(er(x3(e)), Kt((s)=>V(On(t), Xr(r(s, En()[Symbol.iterator]()))))));
    }), nMe = j(3, (t, e, n)=>new Yn(V(un(Mn(e)), Kt(()=>On(V(t, VOe(e, (r, s)=>V(n(r, s), wt((i)=>[
                        i,
                        i
                    ]))))))))), fG = (t)=>new Yn(PX(VX(V(t, wt(Mn))), ln)), rMe = (t)=>new Yn(DX((e)=>t(e).pipe(wt(Mn)))), sMe = (t)=>sG(Mn(t)), k3 = (t)=>new Yn(S1(()=>On(t()))), iMe = j(2, (t, e)=>tG(t, (n)=>Za(kn(e(n), Ns(n))))), oMe = (t)=>WOe(void 0, I1(t)), aMe = (t)=>{
        if (typeof t == "number") return PN(t);
        if (t.capacity === "unbounded") return G$({
            replay: t.replay
        });
        switch(t.strategy){
            case "dropping":
                return _Ae(t);
            case "sliding":
                return xAe(t);
            default:
                return PN(t);
        }
    }, cMe = j(2, (t, e)=>V(jp(aMe(e), (n)=>wk(n)), D$((n)=>V(t, YOe(n), x1)))), lMe = (t)=>wt(vPe(On(t)), (e)=>V(e, Ad(ze), nt(xr({
                onLeft: ()=>Ns(Fe()),
                onRight: Zt
            })))), uMe = j((t)=>S3(t[0]), (t, e)=>wt(sI(), (n)=>dMe(t, n, e))), dMe = j((t)=>S3(t[0]), (t, e, n)=>{
        const r = WPe(e);
        let s, i;
        const o = uIe(!1);
        return new ReadableStream({
            start (a) {
                i = r(GOe(t, (c)=>c.length === 0 ? ln : o.whenOpen(Kn(()=>{
                        o.unsafeClose();
                        for (const l of c)a.enqueue(l);
                        s(), s = void 0;
                    })))), i.addObserver((c)=>{
                    try {
                        c._tag === "Failure" ? a.error(XK(c.cause)) : a.close();
                    } catch  {}
                });
            },
            pull () {
                return new Promise((a)=>{
                    s = a, Xi(o.open);
                });
            },
            cancel () {
                if (i) return Cn(Zg(Rc(i)));
            }
        }, n?.strategy);
    }), pG = (t, e)=>k3(()=>{
            const n = (r)=>Kr(wt(e(r), dn({
                    onNone: ()=>cs,
                    onSome: ([s, i])=>Kt(un(s), ()=>n(i))
                })));
            return new Yn(n(t));
        }), fMe = (t, e)=>pG(t, (n)=>V(e(n), wt(Ac(([r, s])=>[
                    Mn(r),
                    s
                ])))), pMe = (t)=>AI(Za(t)), T3 = (t)=>AI(fG(t)), hG = (t)=>AI(rMe((e)=>t(e))), gG = "effect/Redacted", D_ = Xt("effect/Redacted/redactedRegistry", ()=>new WeakMap), bG = Symbol.for(gG), hMe = {
        [bG]: {
            _A: (t)=>t
        },
        pipe () {
            return St(this, arguments);
        },
        toString () {
            return "<redacted>";
        },
        toJSON () {
            return "<redacted>";
        },
        [Bn] () {
            return "<redacted>";
        },
        [Jt] () {
            return V(At(gG), bn(At(D_.get(this))), ur(this));
        },
        [$t] (t) {
            return gMe(t) && jt(D_.get(this), D_.get(t));
        }
    }, gMe = (t)=>Ft(t, bG), bMe = (t)=>{
        const e = Object.create(hMe);
        return D_.set(e, t), e;
    }, RI = WCe, mMe = o3, yMe = QCe, wMe = eEe, _Me = Qb, xMe = b$, vMe = nEe, jN = rEe, SMe = sEe, kMe = ZE, TMe = uEe, CMe = dEe, EMe = IW, qN = Symbol.for("effect/Encoding/errors/Decode"), WN = (t, e)=>{
        const n = {
            _tag: "DecodeException",
            [qN]: qN,
            input: t
        };
        return To(e) && (n.message = e), n;
    }, IMe = new TextEncoder, KN = (t)=>{
        let e = "";
        for(let n = 0; n < t.length; ++n)e += PMe[t[n]];
        return e;
    }, AMe = (t)=>{
        const e = new TextEncoder().encode(t);
        if (e.length % 2 !== 0) return st(WN(t, `Length must be a multiple of 2, but is ${e.length}`));
        try {
            const n = e.length / 2, r = new Uint8Array(n);
            for(let s = 0; s < n; s++){
                const i = $N(e[s * 2]), o = $N(e[s * 2 + 1]);
                r[s] = i << 4 | o;
            }
            return mt(r);
        } catch (n) {
            return st(WN(t, n instanceof Error ? n.message : "Invalid input"));
        }
    }, PMe = [
        "00",
        "01",
        "02",
        "03",
        "04",
        "05",
        "06",
        "07",
        "08",
        "09",
        "0a",
        "0b",
        "0c",
        "0d",
        "0e",
        "0f",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
        "19",
        "1a",
        "1b",
        "1c",
        "1d",
        "1e",
        "1f",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25",
        "26",
        "27",
        "28",
        "29",
        "2a",
        "2b",
        "2c",
        "2d",
        "2e",
        "2f",
        "30",
        "31",
        "32",
        "33",
        "34",
        "35",
        "36",
        "37",
        "38",
        "39",
        "3a",
        "3b",
        "3c",
        "3d",
        "3e",
        "3f",
        "40",
        "41",
        "42",
        "43",
        "44",
        "45",
        "46",
        "47",
        "48",
        "49",
        "4a",
        "4b",
        "4c",
        "4d",
        "4e",
        "4f",
        "50",
        "51",
        "52",
        "53",
        "54",
        "55",
        "56",
        "57",
        "58",
        "59",
        "5a",
        "5b",
        "5c",
        "5d",
        "5e",
        "5f",
        "60",
        "61",
        "62",
        "63",
        "64",
        "65",
        "66",
        "67",
        "68",
        "69",
        "6a",
        "6b",
        "6c",
        "6d",
        "6e",
        "6f",
        "70",
        "71",
        "72",
        "73",
        "74",
        "75",
        "76",
        "77",
        "78",
        "79",
        "7a",
        "7b",
        "7c",
        "7d",
        "7e",
        "7f",
        "80",
        "81",
        "82",
        "83",
        "84",
        "85",
        "86",
        "87",
        "88",
        "89",
        "8a",
        "8b",
        "8c",
        "8d",
        "8e",
        "8f",
        "90",
        "91",
        "92",
        "93",
        "94",
        "95",
        "96",
        "97",
        "98",
        "99",
        "9a",
        "9b",
        "9c",
        "9d",
        "9e",
        "9f",
        "a0",
        "a1",
        "a2",
        "a3",
        "a4",
        "a5",
        "a6",
        "a7",
        "a8",
        "a9",
        "aa",
        "ab",
        "ac",
        "ad",
        "ae",
        "af",
        "b0",
        "b1",
        "b2",
        "b3",
        "b4",
        "b5",
        "b6",
        "b7",
        "b8",
        "b9",
        "ba",
        "bb",
        "bc",
        "bd",
        "be",
        "bf",
        "c0",
        "c1",
        "c2",
        "c3",
        "c4",
        "c5",
        "c6",
        "c7",
        "c8",
        "c9",
        "ca",
        "cb",
        "cc",
        "cd",
        "ce",
        "cf",
        "d0",
        "d1",
        "d2",
        "d3",
        "d4",
        "d5",
        "d6",
        "d7",
        "d8",
        "d9",
        "da",
        "db",
        "dc",
        "dd",
        "de",
        "df",
        "e0",
        "e1",
        "e2",
        "e3",
        "e4",
        "e5",
        "e6",
        "e7",
        "e8",
        "e9",
        "ea",
        "eb",
        "ec",
        "ed",
        "ee",
        "ef",
        "f0",
        "f1",
        "f2",
        "f3",
        "f4",
        "f5",
        "f6",
        "f7",
        "f8",
        "f9",
        "fa",
        "fb",
        "fc",
        "fd",
        "fe",
        "ff"
    ], $N = (t)=>{
        if (48 <= t && t <= 57) return t - 48;
        if (97 <= t && t <= 102) return t - 97 + 10;
        if (65 <= t && t <= 70) return t - 65 + 10;
        throw new TypeError("Invalid input");
    }, OMe = (t)=>KN(typeof t == "string" ? IMe.encode(t) : t), MMe = (t)=>AMe(t), RMe = "effect/GroupBy", mG = Symbol.for(RMe), NMe = {
        _R: (t)=>t,
        _E: (t)=>t,
        _K: (t)=>t,
        _V: (t)=>t
    }, VMe = (t)=>Ft(t, mG), DMe = j((t)=>VMe(t[0]), (t, e, n)=>wu(t.grouped, ([r, s])=>e(r, PI(cx(s, {
                shutdown: !0
            }))), {
            concurrency: "unbounded",
            bufferSize: n?.bufferSize ?? 16
        })), BMe = (t)=>({
            [mG]: NMe,
            pipe () {
                return St(this, arguments);
            },
            grouped: t
        }), FMe = j((t)=>typeof t[0] != "function", (t, e, n)=>n?.key ? DMe(LMe(t, n.key, {
            bufferSize: n.bufferSize
        }), (r, s)=>Ek(s, e)) : Ck(n?.concurrency, ()=>Ek(t, e), (r)=>n?.unordered ? wu(t, (s)=>Za(e(s)), {
                concurrency: r
            }) : FOe(t, r, e))), LMe = j((t)=>typeof t[0] != "function", (t, e, n)=>{
        const r = (s, i)=>Ri({
                onInput: (o)=>Kt(er(Fa(zMe(o, e), ([a, c])=>{
                        const l = s.get(a);
                        return l === void 0 ? V(by(n?.bufferSize ?? 16), nt((u)=>V(Kn(()=>{
                                s.set(a, u);
                            }), kn(Ws(i, oOe([
                                a,
                                u
                            ]))), kn(V(Ws(u, ox(c)), z8((d)=>D8(d) ? ze(ln) : Fe())))))) : z8(Ws(l, ox(c)), (u)=>D8(u) ? ze(ln) : Fe());
                    }, {
                        discard: !0
                    })), ()=>r(s, i)),
                onFailure: (o)=>er(Ws(i, CI(o))),
                onDone: ()=>er(V(Fa(s.entries(), ([o, a])=>V(Ws(a, ax), z8((c)=>D8(c) ? ze(ln) : Fe())), {
                        discard: !0
                    }), kn(Ws(i, ax))))
            });
        return BMe(hG((s)=>or(function*() {
                const i = new Map, o = yield* hI();
                return yield* uy(s, yp(o)), yield* On(t).pipe(Xr(r(i, o)), Yg, xI(s), yi(s), La(PI(cx(o, {
                    shutdown: !0
                }))));
            })));
    }), zMe = j(2, (t, e)=>{
        const n = [], r = t[Symbol.iterator](), s = new Map;
        let i;
        for(; (i = r.next()) && !i.done;){
            const o = i.value, a = e(o);
            if (s.has(a)) s.get(a).push(o);
            else {
                const c = [
                    o
                ];
                n.push([
                    a,
                    c
                ]), s.set(a, c);
            }
        }
        return Yi(n.map((o)=>[
                o[0],
                Yi(o[1])
            ]));
    });
    class Us {
        path;
        actual;
        issue;
        _tag = "Pointer";
        constructor(e, n, r){
            this.path = e, this.actual = n, this.issue = r;
        }
    }
    class Ao {
        actual;
        message;
        _tag = "Unexpected";
        constructor(e, n){
            this.actual = e, this.message = n;
        }
    }
    class Eb {
        ast;
        message;
        _tag = "Missing";
        actual = void 0;
        constructor(e, n){
            this.ast = e, this.message = n;
        }
    }
    class Ur {
        ast;
        actual;
        issues;
        output;
        _tag = "Composite";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.issues = r, this.output = s;
        }
    }
    class Z8 {
        ast;
        actual;
        kind;
        issue;
        _tag = "Refinement";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.kind = r, this.issue = s;
        }
    }
    class J8 {
        ast;
        actual;
        kind;
        issue;
        _tag = "Transformation";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.kind = r, this.issue = s;
        }
    }
    let Yr = class {
        ast;
        actual;
        message;
        _tag = "Type";
        constructor(e, n, r){
            this.ast = e, this.actual = n, this.message = r;
        }
    };
    class XN {
        ast;
        actual;
        message;
        _tag = "Forbidden";
        constructor(e, n, r){
            this.ast = e, this.actual = n, this.message = r;
        }
    }
    const GN = Symbol.for("effect/Schema/ParseErrorTypeId");
    let UMe = class extends wn("ParseError") {
        [GN] = GN;
        get message() {
            return this.toString();
        }
        toString() {
            return B_.formatIssueSync(this.issue);
        }
        toJSON() {
            return {
                _id: "ParseError",
                message: this.toString()
            };
        }
        [Bn]() {
            return this.toJSON();
        }
    };
    const NI = (t)=>new UMe({
            issue: t
        }), _p = mt, VI = st, Ik = yo, lx = aC, bi = a_e, rd = j(2, (t, e)=>bi(t) ? xr(t, {
            onLeft: st,
            onRight: e
        }) : nt(t, e)), yc = j(2, (t, e)=>bi(t) ? Qs(t, e) : wt(t, e)), Y8 = j(2, (t, e)=>bi(t) ? Ks(t, e) : Ad(t, e)), HMe = j(2, (t, e)=>bi(t) ? YH(t, {
            onLeft: e.onFailure,
            onRight: e.onSuccess
        }) : I$(t, e)), yG = j(2, (t, e)=>bi(t) ? xr(t, {
            onLeft: e,
            onRight: mt
        }) : Gg(t, e)), C3 = (t, e)=>e === void 0 || sp(e) ? t : t === void 0 ? e : {
            ...t,
            ...e
        }, DI = (t, e, n)=>{
        const r = Cs(t, e);
        return (s, i)=>r(s, C3(n, i));
    }, BI = (t, e, n)=>{
        const r = DI(t, e, n);
        return (s, i)=>cC(r(s, i), NI);
    }, wG = (t, e, n)=>{
        const r = Cs(t, e);
        return (s, i)=>r(s, {
                ...C3(n, i),
                isEffectAllowed: !0
            });
    }, jMe = (t, e)=>BI(t.ast, !0, e), qMe = (t, e)=>DI(t.ast, !0, e), _G = (t, e)=>wG(t.ast, !0, e), WMe = (t, e)=>BI(t.ast, !1, e), KMe = (t, e)=>DI(t.ast, !1, e), xG = (t, e)=>wG(t.ast, !1, e), FI = (t, e)=>BI(ms(t.ast), !0, e), LI = (t, e)=>{
        const n = Cs(ms(t.ast), !0);
        return (r, s)=>Ma(n(r, {
                exact: !0,
                ...C3(e, s)
            }));
    }, sd = WMe, $Me = Xt(Symbol.for("effect/ParseResult/decodeMemoMap"), ()=>new WeakMap), XMe = Xt(Symbol.for("effect/ParseResult/encodeMemoMap"), ()=>new WeakMap), Cs = (t, e)=>{
        const n = e ? $Me : XMe, r = n.get(t);
        if (r) return r;
        const s = GMe(t, e), i = A2e(t), o = gr(i) ? (l, u)=>s(l, C3(u, i.value)) : s, a = P2e(t), c = e && gr(a) ? (l, u)=>im(yG(o(l, u), a.value), t, l, u) : o;
        return n.set(t, c), c;
    }, Q8 = (t)=>_c(C2e(t)), eS = (t)=>_c(E2e(t)), GMe = (t, e)=>{
        switch(t._tag){
            case "Refinement":
                if (e) {
                    const n = Cs(t.from, !0);
                    return (r, s)=>{
                        s = s ?? C8;
                        const i = s?.errors === "all", o = rd(yG(n(r, s), (a)=>{
                            const c = new Z8(t, r, "From", a);
                            return i && M2e(t) && TG(a) ? dn(t.filter(r, s, t), {
                                onNone: ()=>st(c),
                                onSome: (l)=>st(new Ur(t, r, [
                                        c,
                                        new Z8(t, r, "Predicate", l)
                                    ]))
                            }) : st(c);
                        }), (a)=>dn(t.filter(a, s, t), {
                                onNone: ()=>mt(a),
                                onSome: (c)=>st(new Z8(t, r, "Predicate", c))
                            }));
                        return im(o, t, r, s);
                    };
                } else {
                    const n = Cs(ms(t), !0), r = Cs(vG(t.from), !1);
                    return (s, i)=>im(rd(n(s, i), (o)=>r(o, i)), t, s, i);
                }
            case "Transformation":
                {
                    const n = YMe(t.transformation, e), r = e ? Cs(t.from, !0) : Cs(t.to, !1), s = e ? Cs(t.to, !0) : Cs(t.from, !1);
                    return (i, o)=>im(rd(Y8(r(i, o), (a)=>new J8(t, i, e ? "Encoded" : "Type", a)), (a)=>rd(Y8(n(a, o ?? C8, t, i), (c)=>new J8(t, i, "Transformation", c)), (c)=>Y8(s(c, o), (l)=>new J8(t, i, e ? "Type" : "Encoded", l)))), t, i, o);
                }
            case "Declaration":
                {
                    const n = e ? t.decodeUnknown(...t.typeParameters) : t.encodeUnknown(...t.typeParameters);
                    return (r, s)=>im(n(r, s ?? C8, t), t, r, s);
                }
            case "Literal":
                return no(t, (n)=>n === t.literal);
            case "UniqueSymbol":
                return no(t, (n)=>n === t.symbol);
            case "UndefinedKeyword":
                return no(t, _we);
            case "NeverKeyword":
                return no(t, xwe);
            case "UnknownKeyword":
            case "AnyKeyword":
            case "VoidKeyword":
                return mt;
            case "StringKeyword":
                return no(t, To);
            case "NumberKeyword":
                return no(t, sp);
            case "BooleanKeyword":
                return no(t, Hy);
            case "BigIntKeyword":
                return no(t, ev);
            case "SymbolKeyword":
                return no(t, l6);
            case "ObjectKeyword":
                return no(t, qc);
            case "Enums":
                return no(t, (n)=>t.enums.some(([r, s])=>s === n));
            case "TemplateLiteral":
                {
                    const n = gxe(t);
                    return no(t, (r)=>To(r) && n.test(r));
                }
            case "TupleType":
                {
                    const n = t.elements.map((l)=>Cs(l.type, e)), r = t.rest.map((l)=>Cs(l.type, e));
                    let s = t.elements.filter((l)=>!l.isOptional);
                    t.rest.length > 0 && (s = s.concat(t.rest.slice(1)));
                    const i = s.length, o = t.elements.length > 0 ? t.elements.map((l, u)=>u).join(" | ") : "never", a = Q8(t), c = eS(t);
                    return (l, u)=>{
                        if (!F_e(l)) return st(new Yr(t, l));
                        const d = u?.errors === "all", f = [];
                        let p = 0;
                        const h = [], m = l.length;
                        for(let _ = m; _ <= i - 1; _++){
                            const A = new Us(_, l, new Eb(s[_ - m]));
                            if (d) {
                                f.push([
                                    p++,
                                    A
                                ]);
                                continue;
                            } else return st(new Ur(t, l, A, h));
                        }
                        if (t.rest.length === 0) for(let _ = t.elements.length; _ <= m - 1; _++){
                            const A = new Us(_, l, new Ao(l[_], `is unexpected, expected: ${o}`));
                            if (d) {
                                f.push([
                                    p++,
                                    A
                                ]);
                                continue;
                            } else return st(new Ur(t, l, A, h));
                        }
                        let w = 0, v;
                        for(; w < n.length; w++)if (m < w + 1) {
                            if (t.elements[w].isOptional) continue;
                        } else {
                            const _ = n[w], A = _(l[w], u);
                            if (bi(A)) {
                                if (pr(A)) {
                                    const P = new Us(w, l, A.left);
                                    if (d) {
                                        f.push([
                                            p++,
                                            P
                                        ]);
                                        continue;
                                    } else return st(new Ur(t, l, P, _a(h)));
                                }
                                h.push([
                                    p++,
                                    A.right
                                ]);
                            } else {
                                const P = p++, U = w;
                                v || (v = []), v.push(({ es: K, output: X })=>nt(yf(A), (G)=>{
                                        if (pr(G)) {
                                            const ce = new Us(U, l, G.left);
                                            return d ? (K.push([
                                                P,
                                                ce
                                            ]), ln) : st(new Ur(t, l, ce, _a(X)));
                                        }
                                        return X.push([
                                            P,
                                            G.right
                                        ]), ln;
                                    }));
                            }
                        }
                        if (Fr(r)) {
                            const [_, ...A] = r;
                            for(; w < m - A.length; w++){
                                const P = _(l[w], u);
                                if (bi(P)) if (pr(P)) {
                                    const U = new Us(w, l, P.left);
                                    if (d) {
                                        f.push([
                                            p++,
                                            U
                                        ]);
                                        continue;
                                    } else return st(new Ur(t, l, U, _a(h)));
                                } else h.push([
                                    p++,
                                    P.right
                                ]);
                                else {
                                    const U = p++, K = w;
                                    v || (v = []), v.push(({ es: X, output: G })=>nt(yf(P), (ce)=>{
                                            if (pr(ce)) {
                                                const ie = new Us(K, l, ce.left);
                                                return d ? (X.push([
                                                    U,
                                                    ie
                                                ]), ln) : st(new Ur(t, l, ie, _a(G)));
                                            } else return G.push([
                                                U,
                                                ce.right
                                            ]), ln;
                                        }));
                                }
                            }
                            for(let P = 0; P < A.length; P++){
                                const U = w + P;
                                if (!(m < U + 1)) {
                                    const K = A[P](l[U], u);
                                    if (bi(K)) {
                                        if (pr(K)) {
                                            const X = new Us(U, l, K.left);
                                            if (d) {
                                                f.push([
                                                    p++,
                                                    X
                                                ]);
                                                continue;
                                            } else return st(new Ur(t, l, X, _a(h)));
                                        }
                                        h.push([
                                            p++,
                                            K.right
                                        ]);
                                    } else {
                                        const X = p++;
                                        v || (v = []), v.push(({ es: G, output: ce })=>nt(yf(K), (ie)=>{
                                                if (pr(ie)) {
                                                    const Y = new Us(U, l, ie.left);
                                                    return d ? (G.push([
                                                        X,
                                                        Y
                                                    ]), ln) : st(new Ur(t, l, Y, _a(ce)));
                                                }
                                                return ce.push([
                                                    X,
                                                    ie.right
                                                ]), ln;
                                            }));
                                    }
                                }
                            }
                        }
                        const k = ({ es: _, output: A })=>ym(_) ? st(new Ur(t, l, _a(_), _a(A))) : mt(_a(A));
                        if (v && v.length > 0) {
                            const _ = v;
                            return wr(()=>{
                                const A = {
                                    es: Zb(f),
                                    output: Zb(h)
                                };
                                return nt(Fa(_, (P)=>P(A), {
                                    concurrency: a,
                                    batching: c,
                                    discard: !0
                                }), ()=>k(A));
                            });
                        }
                        return k({
                            output: h,
                            es: f
                        });
                    };
                }
            case "TypeLiteral":
                {
                    if (t.propertySignatures.length === 0 && t.indexSignatures.length === 0) return no(t, vwe);
                    const n = [], r = {}, s = [];
                    for (const u of t.propertySignatures)n.push([
                        Cs(u.type, e),
                        u
                    ]), r[u.name] = null, s.push(u.name);
                    const i = t.indexSignatures.map((u)=>[
                            Cs(u.parameter, e),
                            Cs(u.type, e),
                            u.parameter
                        ]), o = xc.make(t.indexSignatures.map((u)=>u.parameter).concat(s.map((u)=>l6(u) ? new B2e(u) : new T2(u)))), a = Cs(o, e), c = Q8(t), l = eS(t);
                    return (u, d)=>{
                        if (!kwe(u)) return st(new Yr(t, u));
                        const f = d?.errors === "all", p = [];
                        let h = 0;
                        const m = d?.onExcessProperty === "error", w = d?.onExcessProperty === "preserve", v = {};
                        let k;
                        if (m || w) {
                            k = Reflect.ownKeys(u);
                            for (const U of k){
                                const K = a(U, d);
                                if (bi(K) && pr(K)) if (m) {
                                    const X = new Us(U, u, new Ao(u[U], `is unexpected, expected: ${String(o)}`));
                                    if (f) {
                                        p.push([
                                            h++,
                                            X
                                        ]);
                                        continue;
                                    } else return st(new Ur(t, u, X, v));
                                } else v[U] = u[U];
                            }
                        }
                        let _;
                        const A = d?.exact === !0;
                        for(let U = 0; U < n.length; U++){
                            const K = n[U][1], X = K.name, G = Object.prototype.hasOwnProperty.call(u, X);
                            if (!G) {
                                if (K.isOptional) continue;
                                if (A) {
                                    const Y = new Us(X, u, new Eb(K));
                                    if (f) {
                                        p.push([
                                            h++,
                                            Y
                                        ]);
                                        continue;
                                    } else return st(new Ur(t, u, Y, v));
                                }
                            }
                            const ce = n[U][0], ie = ce(u[X], d);
                            if (bi(ie)) {
                                if (pr(ie)) {
                                    const Y = new Us(X, u, G ? ie.left : new Eb(K));
                                    if (f) {
                                        p.push([
                                            h++,
                                            Y
                                        ]);
                                        continue;
                                    } else return st(new Ur(t, u, Y, v));
                                }
                                v[X] = ie.right;
                            } else {
                                const Y = h++, M = X;
                                _ || (_ = []), _.push(({ es: g, output: y })=>nt(yf(ie), (C)=>{
                                        if (pr(C)) {
                                            const R = new Us(M, u, G ? C.left : new Eb(K));
                                            return f ? (g.push([
                                                Y,
                                                R
                                            ]), ln) : st(new Ur(t, u, R, y));
                                        }
                                        return y[M] = C.right, ln;
                                    }));
                            }
                        }
                        for(let U = 0; U < i.length; U++){
                            const K = i[U], X = K[0], G = K[1], ce = oj(u, K[2]);
                            for (const ie of ce){
                                const Y = X(ie, d);
                                if (bi(Y) && Ma(Y)) {
                                    const M = G(u[ie], d);
                                    if (bi(M)) if (pr(M)) {
                                        const g = new Us(ie, u, M.left);
                                        if (f) {
                                            p.push([
                                                h++,
                                                g
                                            ]);
                                            continue;
                                        } else return st(new Ur(t, u, g, v));
                                    } else Object.prototype.hasOwnProperty.call(r, ie) || (v[ie] = M.right);
                                    else {
                                        const g = h++, y = ie;
                                        _ || (_ = []), _.push(({ es: C, output: R })=>nt(yf(M), (N)=>{
                                                if (pr(N)) {
                                                    const L = new Us(y, u, N.left);
                                                    return f ? (C.push([
                                                        g,
                                                        L
                                                    ]), ln) : st(new Ur(t, u, L, R));
                                                } else return Object.prototype.hasOwnProperty.call(r, ie) || (R[ie] = N.right), ln;
                                            }));
                                    }
                                }
                            }
                        }
                        const P = ({ es: U, output: K })=>{
                            if (ym(U)) return st(new Ur(t, u, _a(U), K));
                            if (d?.propertyOrder === "original") {
                                const X = k || Reflect.ownKeys(u);
                                for (const ce of s)X.indexOf(ce) === -1 && X.push(ce);
                                const G = {};
                                for (const ce of X)Object.prototype.hasOwnProperty.call(K, ce) && (G[ce] = K[ce]);
                                return mt(G);
                            }
                            return mt(K);
                        };
                        if (_ && _.length > 0) {
                            const U = _;
                            return wr(()=>{
                                const K = {
                                    es: Zb(p),
                                    output: Object.assign({}, v)
                                };
                                return nt(Fa(U, (X)=>X(K), {
                                    concurrency: c,
                                    batching: l,
                                    discard: !0
                                }), ()=>P(K));
                            });
                        }
                        return P({
                            es: p,
                            output: v
                        });
                    };
                }
            case "Union":
                {
                    const n = ZMe(t.types, e), r = Reflect.ownKeys(n.keys), s = r.length, i = t.types.length, o = new Map;
                    for(let l = 0; l < i; l++)o.set(t.types[l], Cs(t.types[l], e));
                    const a = Q8(t) ?? 1, c = eS(t);
                    return (l, u)=>{
                        const d = [];
                        let f = 0, p = [];
                        if (s > 0) if (ZT(l)) for(let w = 0; w < s; w++){
                            const v = r[w], k = n.keys[v].buckets;
                            if (Object.prototype.hasOwnProperty.call(l, v)) {
                                const _ = String(l[v]);
                                if (Object.prototype.hasOwnProperty.call(k, _)) p = p.concat(k[_]);
                                else {
                                    const { candidates: A, literals: P } = n.keys[v], U = xc.make(P), K = A.length === i ? new zf([
                                        new Ys(v, U, !1, !0)
                                    ], []) : xc.make(A);
                                    d.push([
                                        f++,
                                        new Ur(K, l, new Us(v, l, new Yr(U, l[v])))
                                    ]);
                                }
                            } else {
                                const { candidates: _, literals: A } = n.keys[v], P = new Ys(v, xc.make(A), !1, !0), U = _.length === i ? new zf([
                                    P
                                ], []) : xc.make(_);
                                d.push([
                                    f++,
                                    new Ur(U, l, new Us(v, l, new Eb(P)))
                                ]);
                            }
                        }
                        else {
                            const w = n.candidates.length === i ? t : xc.make(n.candidates);
                            d.push([
                                f++,
                                new Yr(w, l)
                            ]);
                        }
                        n.otherwise.length > 0 && (p = p.concat(n.otherwise));
                        let h;
                        for(let w = 0; w < p.length; w++){
                            const v = p[w], k = o.get(v)(l, u);
                            if (bi(k) && (!h || h.length === 0)) {
                                if (Ma(k)) return k;
                                d.push([
                                    f++,
                                    k.left
                                ]);
                            } else {
                                const _ = f++;
                                h || (h = []), h.push((A)=>wr(()=>"finalResult" in A ? ln : nt(yf(k), (P)=>(Ma(P) ? A.finalResult = P : A.es.push([
                                                _,
                                                P.left
                                            ]), ln))));
                            }
                        }
                        const m = (w)=>ym(w) ? w.length === 1 && w[0][1]._tag === "Type" ? st(w[0][1]) : st(new Ur(t, l, _a(w))) : st(new Yr(t, l));
                        if (h && h.length > 0) {
                            const w = h;
                            return wr(()=>{
                                const v = {
                                    es: Zb(d)
                                };
                                return nt(Fa(w, (k)=>k(v), {
                                    concurrency: a,
                                    batching: c,
                                    discard: !0
                                }), ()=>"finalResult" in v ? v.finalResult : m(v.es));
                            });
                        }
                        return m(d);
                    };
                }
            case "Suspend":
                {
                    const n = aj(()=>Cs(t.f(), e));
                    return (r, s)=>n()(r, s);
                }
        }
    }, no = (t, e)=>(n)=>e(n) ? mt(n) : st(new Yr(t, n)), sm = (t, e)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const n = Tj(t);
                    if (gr(n)) return sm(n.value, e);
                    break;
                }
            case "TypeLiteral":
                {
                    const n = [];
                    for(let r = 0; r < t.propertySignatures.length; r++){
                        const s = t.propertySignatures[r], i = e ? sR(s.type) : ms(s.type);
                        tR(i) && !s.isOptional && n.push([
                            s.name,
                            i
                        ]);
                    }
                    return n;
                }
            case "TupleType":
                {
                    const n = [];
                    for(let r = 0; r < t.elements.length; r++){
                        const s = t.elements[r], i = e ? sR(s.type) : ms(s.type);
                        tR(i) && !s.isOptional && n.push([
                            r,
                            i
                        ]);
                    }
                    return n;
                }
            case "Refinement":
                return sm(t.from, e);
            case "Suspend":
                return sm(t.f(), e);
            case "Transformation":
                return sm(e ? t.from : t.to, e);
        }
        return [];
    }, ZMe = (t, e)=>{
        const n = {}, r = [], s = [];
        for(let i = 0; i < t.length; i++){
            const o = t[i], a = sm(o, e);
            if (a.length > 0) {
                s.push(o);
                for(let c = 0; c < a.length; c++){
                    const [l, u] = a[c], d = String(u.literal);
                    n[l] = n[l] || {
                        buckets: {},
                        literals: [],
                        candidates: []
                    };
                    const f = n[l].buckets;
                    if (Object.prototype.hasOwnProperty.call(f, d)) {
                        if (c < a.length - 1) continue;
                        f[d].push(o), n[l].literals.push(u), n[l].candidates.push(o);
                    } else {
                        f[d] = [
                            o
                        ], n[l].literals.push(u), n[l].candidates.push(o);
                        break;
                    }
                }
            } else r.push(o);
        }
        return {
            keys: n,
            otherwise: r,
            candidates: s
        };
    }, vG = (t)=>mC(t) ? vG(t.from) : t, im = (t, e, n, r)=>{
        if (r?.isEffectAllowed === !0 || bi(t)) return t;
        const s = new bK, i = Q2(t, {
            scheduler: s
        });
        s.flush();
        const o = i.unsafePoll();
        if (o) {
            if (z6(o)) return mt(o.value);
            const a = o.cause;
            return rTe(a) ? st(a.error) : st(new XN(e, n, aTe(a)));
        }
        return st(new XN(e, n, "cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"));
    }, JMe = ([t], [e])=>t > e ? 1 : t < e ? -1 : 0;
    function _a(t) {
        return t.sort(JMe).map((e)=>e[1]);
    }
    const YMe = (t, e)=>{
        switch(t._tag){
            case "FinalTransformation":
                return e ? t.decode : t.encode;
            case "ComposeTransformation":
                return mt;
            case "TypeLiteralTransformation":
                return (n)=>{
                    let r = mt(n);
                    for (const s of t.propertySignatureTransformations){
                        const [i, o] = e ? [
                            s.from,
                            s.to
                        ] : [
                            s.to,
                            s.from
                        ], a = e ? s.decode : s.encode;
                        r = yc(r, (l)=>{
                            const u = a(Object.prototype.hasOwnProperty.call(l, i) ? ze(l[i]) : Fe());
                            return delete l[i], gr(u) && (l[o] = u.value), l;
                        });
                    }
                    return r;
                };
        }
    }, pi = (t, e = [])=>({
            value: t,
            forest: e
        }), B_ = {
        formatIssue: (t)=>yc(Mh(t), QMe),
        formatIssueSync: (t)=>{
            const e = B_.formatIssue(t);
            return bi(e) ? ov(e) : Xi(e);
        },
        formatError: (t)=>B_.formatIssue(t.issue),
        formatErrorSync: (t)=>B_.formatIssueSync(t.issue)
    }, QMe = (t)=>t.value + SG(`
`, t.forest), SG = (t, e)=>{
        let n = "";
        const r = e.length;
        let s;
        for(let i = 0; i < r; i++){
            s = e[i];
            const o = i === r - 1;
            n += t + (o ? "└" : "├") + "─ " + s.value, n += SG(t + (r > 1 && !o ? "│  " : "   "), s.forest);
        }
        return n;
    }, eRe = (t)=>{
        switch(t){
            case "Encoded":
                return "Encoded side transformation failure";
            case "Transformation":
                return "Transformation process failure";
            case "Type":
                return "Type side transformation failure";
        }
    }, tRe = (t)=>{
        switch(t){
            case "From":
                return "From side refinement failure";
            case "Predicate":
                return "Predicate refinement failure";
        }
    }, kG = (t)=>"ast" in t ? ze(t.ast) : Fe(), Ak = mt(void 0), nRe = (t)=>kG(t).pipe(xg(k2e), dn({
            onNone: ()=>Ak,
            onSome: (e)=>{
                const n = e(t);
                return To(n) ? mt({
                    message: n,
                    override: !1
                }) : Xg(n) ? wt(n, (r)=>({
                        message: r,
                        override: !1
                    })) : To(n.message) ? mt({
                    message: n.message,
                    override: n.override
                }) : wt(n.message, (r)=>({
                        message: r,
                        override: n.override
                    }));
            }
        })), zI = (t)=>(e)=>e._tag === t, TG = zI("Composite"), ZN = zI("Refinement"), JN = zI("Transformation"), Sm = (t)=>rd(nRe(t), (e)=>e !== void 0 ? !e.override && (TG(t) || ZN(t) && t.kind === "From" || JN(t) && t.kind !== "Transformation") ? JN(t) || ZN(t) ? Sm(t.issue) : Ak : mt(e.message) : Ak), CG = (t)=>kG(t).pipe(xg(I2e), __e((e)=>e(t)), _c);
    function rRe(t) {
        return kj(t).pipe(ad(()=>vj(t)), ad(()=>Sj(t)), ad(()=>fv(t)), Pr(()=>`{ ${t.from} | filter }`));
    }
    function sRe(t) {
        return t.message !== void 0 ? t.message : `Expected ${mC(t.ast) ? rRe(t.ast) : String(t.ast)}, actual ${jd(t.actual)}`;
    }
    let iRe, qw, oRe, aRe, cRe, Mh, YN, wy;
    iRe = (t)=>yc(Sm(t), (e)=>e ?? CG(t) ?? sRe(t));
    qw = (t)=>CG(t) ?? String(t.ast);
    oRe = (t)=>t.message ?? "is forbidden";
    aRe = (t)=>t.message ?? "is unexpected";
    cRe = (t)=>{
        const e = T2e(t.ast);
        if (gr(e)) {
            const n = e.value();
            return To(n) ? mt(n) : n;
        }
        return mt(t.message ?? "is missing");
    };
    Mh = (t)=>{
        switch(t._tag){
            case "Type":
                return yc(iRe(t), pi);
            case "Forbidden":
                return mt(pi(qw(t), [
                    pi(oRe(t))
                ]));
            case "Unexpected":
                return mt(pi(aRe(t)));
            case "Missing":
                return yc(cRe(t), pi);
            case "Transformation":
                return rd(Sm(t), (e)=>e !== void 0 ? mt(pi(e)) : yc(Mh(t.issue), (n)=>pi(qw(t), [
                            pi(eRe(t.kind), [
                                n
                            ])
                        ])));
            case "Refinement":
                return rd(Sm(t), (e)=>e !== void 0 ? mt(pi(e)) : yc(Mh(t.issue), (n)=>pi(qw(t), [
                            pi(tRe(t.kind), [
                                n
                            ])
                        ])));
            case "Pointer":
                return yc(Mh(t.issue), (e)=>pi(o2e(t.path), [
                        e
                    ]));
            case "Composite":
                return rd(Sm(t), (e)=>{
                    if (e !== void 0) return mt(pi(e));
                    const n = qw(t);
                    return cj(t.issues) ? yc(Fa(t.issues, Mh), (r)=>pi(n, r)) : yc(Mh(t.issues), (r)=>pi(n, [
                            r
                        ]));
                });
        }
    };
    YN = bMe;
    lRe = j((t)=>qc(t[0]), (t, ...e)=>{
        const n = {};
        for (const r of e)r in t && (n[r] = t[r]);
        return n;
    });
    uRe = j((t)=>qc(t[0]), (t, ...e)=>{
        const n = {
            ...t
        };
        for (const r of e)delete n[r];
        return n;
    });
    wy = Symbol.for("effect/Schema");
    function ts(t) {
        return class {
            [wy] = QN;
            static ast = t;
            static annotations(n) {
                return ts(Ja(this.ast, n));
            }
            static pipe() {
                return St(this, arguments);
            }
            static toString() {
                return String(t);
            }
            static Type;
            static Encoded;
            static Context;
            static [wy] = QN;
        };
    }
    const QN = {
        _A: (t)=>t,
        _I: (t)=>t,
        _R: (t)=>t
    }, eV = {
        typeConstructor: y2e,
        schemaId: _2e,
        message: lj,
        missingMessage: dC,
        identifier: fC,
        title: Ga,
        description: Np,
        examples: uj,
        default: dj,
        documentation: x2e,
        jsonSchema: fj,
        arbitrary: pj,
        pretty: hj,
        equivalence: gj,
        concurrency: bj,
        batching: mj,
        parseIssueTitle: yj,
        parseOptions: wj,
        decodingFallback: _j
    }, qp = (t)=>{
        if (!t) return {};
        const e = {
            ...t
        };
        for(const n in eV)if (n in t) {
            const r = eV[n];
            e[r] = t[n], delete e[n];
        }
        return e;
    }, Ja = (t, e)=>wC(t, qp(e));
    const Pk = (t)=>String(t.ast), Kf = (t)=>ts(ms(t.ast)), dRe = (t, e)=>{
        const n = KMe(t, e);
        return (r, s)=>Ks(n(r, s), NI);
    }, fRe = dRe, Xc = (t, e)=>{
        const n = qMe(t, e);
        return (r, s)=>Ks(n(r, s), NI);
    }, Md = (t)=>Ft(t, wy) && qc(t[wy]);
    function pRe(t) {
        return gC(t) ? xc.make(oxe(t, (e)=>new T2(e))) : new T2(t[0]);
    }
    function EG(t, e = pRe(t)) {
        return class extends ts(e) {
            static annotations(r) {
                return EG(this.literals, Ja(this.ast, r));
            }
            static literals = [
                ...t
            ];
        };
    }
    ri = function(...t) {
        return Fr(t) ? EG(t) : AG;
    };
    const hRe = (t, e, n)=>UI(t, new pv(t.map((r)=>r.ast), (...r)=>e.decode(...r.map(ts)), (...r)=>e.encode(...r.map(ts)), qp(n))), gRe = (t, e)=>{
        const n = ()=>(s, i, o)=>t(s) ? _p(s) : VI(new Yr(o, s)), r = n;
        return UI([], new pv([], n, r, qp(e)));
    };
    function UI(t, e) {
        return class extends ts(e) {
            static annotations(r) {
                return UI(this.typeParameters, Ja(this.ast, r));
            }
            static typeParameters = [
                ...t
            ];
        };
    }
    const Ni = function() {
        if (Array.isArray(arguments[0])) {
            const n = arguments[0], r = arguments[1], s = arguments[2];
            return hRe(n, r, s);
        }
        const t = arguments[0], e = arguments[1];
        return gRe(t, e);
    }, tV = Symbol.for("effect/SchemaId/Brand"), HI = (t, e)=>(n)=>LG(n, new bC(n.ast, function(i, o, a) {
                const c = t.either(i);
                return pr(c) ? ze(new Yr(a, i, c.left.map((l)=>l.message).join(", "))) : Fe();
            }, qp({
                schemaId: tV,
                [tV]: {
                    constructor: t
                },
                ...e
            }))), nV = Symbol.for("effect/SchemaId/InstanceOf"), bRe = (t, e)=>Ni((n)=>n instanceof t, {
            title: t.name,
            description: `an instance of ${t.name}`,
            pretty: ()=>String,
            schemaId: nV,
            [nV]: {
                constructor: t
            },
            ...e
        });
    class E3 extends ts(g6) {
    }
    let IG = class extends ts(D2e) {
    };
    class AG extends ts(pC) {
    }
    class mRe extends ts(Ej) {
    }
    class I3 extends ts(J2e) {
    }
    en = class extends ts(q2e) {
    };
    Or = class extends ts($2e) {
    };
    A3 = class extends ts(G2e) {
    };
    k_t = class extends ts(exe) {
    };
    const yRe = (t)=>xc.make(t.map((e)=>e.ast));
    function PG(t, e = yRe(t)) {
        return class extends ts(e) {
            static annotations(r) {
                return PG(this.members, Ja(this.ast, r));
            }
            static members = [
                ...t
            ];
        };
    }
    function Rd(...t) {
        return gC(t) ? PG(t) : Fr(t) ? t[0] : AG;
    }
    let wRe, _Re;
    OG = (t)=>Rd(t, IG);
    wRe = (t)=>Rd(t, E3);
    C_t = (t)=>Rd(t, IG, E3);
    _Re = (t, e)=>new hC(t.map((n)=>Md(n) ? new kg(n.ast, !1) : n.ast), e.map((n)=>Md(n) ? new hv(n.ast) : n.ast), !0);
    function ux(t, e, n = _Re(t, e)) {
        return class extends ts(n) {
            static annotations(s) {
                return ux(this.elements, this.rest, Ja(this.ast, s));
            }
            static elements = [
                ...t
            ];
            static rest = [
                ...e
            ];
        };
    }
    function _y(...t) {
        return Array.isArray(t[0]) ? ux(t[0], t.slice(1)) : ux(t, []);
    }
    function MG(t, e) {
        return class extends ux([], [
            t
        ], e) {
            static annotations(r) {
                return MG(this.value, Ja(this.ast, r));
            }
            static value = t;
        };
    }
    let Ok;
    Os = (t)=>MG(t);
    Ok = (t)=>t ? '"?:"' : '":"';
    class P3 extends kg {
        isReadonly;
        defaultValue;
        _tag = "PropertySignatureDeclaration";
        constructor(e, n, r, s, i){
            super(e, n, s), this.isReadonly = r, this.defaultValue = i;
        }
        toString() {
            const e = Ok(this.isOptional), n = String(this.type);
            return `PropertySignature<${e}, ${n}, never, ${e}, ${n}>`;
        }
    }
    class RG extends kg {
        isReadonly;
        defaultValue;
        constructor(e, n, r, s, i){
            super(e, n, s), this.isReadonly = r, this.defaultValue = i;
        }
    }
    const xRe = (t)=>t === void 0 ? "never" : To(t) ? JSON.stringify(t) : String(t);
    class NG {
        from;
        to;
        decode;
        encode;
        _tag = "PropertySignatureTransformation";
        constructor(e, n, r, s){
            this.from = e, this.to = n, this.decode = r, this.encode = s;
        }
        toString() {
            return `PropertySignature<${Ok(this.to.isOptional)}, ${this.to.type}, ${xRe(this.from.fromKey)}, ${Ok(this.from.isOptional)}, ${this.from.type}>`;
        }
    }
    const VG = (t, e)=>{
        switch(t._tag){
            case "PropertySignatureDeclaration":
                return new P3(t.type, t.isOptional, t.isReadonly, {
                    ...t.annotations,
                    ...e
                }, t.defaultValue);
            case "PropertySignatureTransformation":
                return new NG(t.from, new RG(t.to.type, t.to.isOptional, t.to.isReadonly, {
                    ...t.to.annotations,
                    ...e
                }, t.to.defaultValue), t.decode, t.encode);
        }
    }, DG = Symbol.for("effect/PropertySignature"), BG = (t)=>Ft(t, DG);
    class O3 {
        ast;
        [wy];
        [DG] = null;
        _TypeToken;
        _Key;
        _EncodedToken;
        _HasDefault;
        constructor(e){
            this.ast = e;
        }
        pipe() {
            return St(this, arguments);
        }
        annotations(e) {
            return new O3(VG(this.ast, qp(e)));
        }
        toString() {
            return String(this.ast);
        }
    }
    const rV = (t)=>new O3(t);
    class M3 extends O3 {
        from;
        constructor(e, n){
            super(e), this.from = n;
        }
        annotations(e) {
            return new M3(VG(this.ast, qp(e)), this.from);
        }
    }
    let vRe, SRe, kRe, TRe, CRe;
    vRe = (t)=>new M3(new P3(t.ast, !1, !0, {}, void 0), t);
    SRe = j(2, (t, e)=>{
        const n = t.ast;
        switch(n._tag){
            case "PropertySignatureDeclaration":
                return rV(new P3(n.type, n.isOptional, n.isReadonly, n.annotations, e));
            case "PropertySignatureTransformation":
                return rV(new NG(n.from, new RG(n.to.type, n.to.isOptional, n.to.isReadonly, n.to.annotations, e), n.decode, n.encode));
        }
    });
    $f = (t)=>{
        const e = t.ast === g6 || t.ast === pC ? g6 : wRe(t).ast;
        return new M3(new P3(e, !0, !0, {}, void 0), t);
    };
    kRe = Vj([
        dC
    ]);
    TRe = (t, e)=>{
        const n = Reflect.ownKeys(t), r = [];
        if (n.length > 0) {
            const i = [], o = [], a = [];
            for(let c = 0; c < n.length; c++){
                const l = n[c], u = t[l];
                if (BG(u)) {
                    const d = u.ast;
                    switch(d._tag){
                        case "PropertySignatureDeclaration":
                            {
                                const f = d.type, p = d.isOptional, h = d.annotations;
                                i.push(new Ys(l, f, p, !0, kRe(d))), o.push(new Ys(l, ms(f), p, !0, h)), r.push(new Ys(l, f, p, !0, h));
                                break;
                            }
                        case "PropertySignatureTransformation":
                            {
                                const f = d.from.fromKey ?? l;
                                i.push(new Ys(f, d.from.type, d.from.isOptional, !0, d.from.annotations)), o.push(new Ys(l, d.to.type, d.to.isOptional, !0, d.to.annotations)), a.push(new uxe(f, l, d.decode, d.encode));
                                break;
                            }
                    }
                } else i.push(new Ys(l, u.ast, !1, !0)), o.push(new Ys(l, ms(u.ast), !1, !0)), r.push(new Ys(l, u.ast, !1, !0));
            }
            if (Fr(a)) {
                const c = [], l = [];
                for (const u of e){
                    const { indexSignatures: d, propertySignatures: f } = rR(u.key.ast, u.value.ast);
                    f.forEach((p)=>{
                        i.push(p), o.push(new Ys(p.name, ms(p.type), p.isOptional, p.isReadonly, p.annotations));
                    }), d.forEach((p)=>{
                        c.push(p), l.push(new gv(p.parameter, ms(p.type), p.isReadonly));
                    });
                }
                return new yC(new zf(i, c, {
                    [h6]: "Struct (Encoded side)"
                }), new zf(o, l, {
                    [h6]: "Struct (Type side)"
                }), new dxe(a));
            }
        }
        const s = [];
        for (const i of e){
            const { indexSignatures: o, propertySignatures: a } = rR(i.key.ast, i.value.ast);
            a.forEach((c)=>r.push(c)), o.forEach((c)=>s.push(c));
        }
        return new zf(r, s);
    };
    CRe = (t, e)=>{
        const n = Reflect.ownKeys(t);
        for (const r of n){
            const s = t[r];
            if (e[r] === void 0 && BG(s)) {
                const i = s.ast, o = i._tag === "PropertySignatureDeclaration" ? i.defaultValue : i.to.defaultValue;
                o !== void 0 && (e[r] = o());
            }
        }
        return e;
    };
    function jI(t, e, n = TRe(t, e)) {
        return class extends ts(n) {
            static annotations(s) {
                return jI(this.fields, this.records, Ja(this.ast, s));
            }
            static fields = {
                ...t
            };
            static records = [
                ...e
            ];
            static make = (s, i)=>{
                const o = CRe(t, {
                    ...s
                });
                return $I(i) ? o : FI(this)(o);
            };
            static pick(...s) {
                return tn(lRe(t, ...s));
            }
            static omit(...s) {
                return tn(uRe(t, ...s));
            }
        };
    }
    tn = function(t, ...e) {
        return jI(t, e);
    };
    const ERe = (t)=>ri(t).pipe(vRe, SRe(()=>t)), IRe = (t, e)=>tn({
            _tag: ERe(t),
            ...e
        });
    function FG(t, e, n) {
        return class extends jI({}, [
            {
                key: t,
                value: e
            }
        ], n) {
            static annotations(s) {
                return FG(t, e, Ja(this.ast, s));
            }
            static key = t;
            static value = e;
        };
    }
    ARe = (t)=>FG(t.key, t.value);
    function LG(t, e) {
        return class extends ts(e) {
            static annotations(r) {
                return LG(this.from, Ja(this.ast, r));
            }
            static make = (r, s)=>$I(s) ? r : FI(this)(r);
            static from = t;
        };
    }
    let PRe;
    A1 = j((t)=>Md(t[1]), (t, e)=>qI(t, e, mxe(t.ast, e.ast)));
    PRe = Symbol.for("effect/SchemaId/Refine");
    function zG(t, e, n) {
        return class extends ts(n) {
            static annotations(s) {
                return zG(this.from, this.filter, Ja(this.ast, s));
            }
            static [PRe] = t;
            static from = t;
            static filter = e;
            static make = (s, i)=>$I(i) ? s : FI(this)(s);
        };
    }
    const sV = (t, e, n)=>{
        if (Hy(t)) return t ? Fe() : ze(new Yr(e, n));
        if (To(t)) return ze(new Yr(e, n, t));
        if (t !== void 0) {
            if ("_tag" in t) return ze(t);
            const r = new Yr(e, n, t.message);
            return ze(Fr(t.path) ? new Us(t.path, n, r) : r);
        }
        return Fe();
    }, ORe = (t, e, n)=>{
        if (i2e(t)) return sV(t, e, n);
        if (Fr(t)) {
            const r = dv(t, (s)=>sV(s, e, n));
            if (Fr(r)) return ze(r.length === 1 ? r[0] : new Ur(e, n, r));
        }
        return Fe();
    };
    function R3(t, e) {
        return (n)=>{
            function r(i, o, a) {
                return ORe(t(i, o, a), a, i);
            }
            const s = new bC(n.ast, r, qp(e));
            return zG(n, r, s);
        };
    }
    function qI(t, e, n) {
        return class extends ts(n) {
            static annotations(s) {
                return qI(this.from, this.to, Ja(this.ast, s));
            }
            static from = t;
            static to = e;
        };
    }
    let Oo, _u, iV, MRe, P1, RRe, NRe, VRe, DRe;
    Oo = j((t)=>Md(t[0]) && Md(t[1]), (t, e, n)=>qI(t, e, new yC(t.ast, e.ast, new axe(n.decode, n.encode))));
    _u = j((t)=>Md(t[0]) && Md(t[1]), (t, e, n)=>Oo(t, e, {
            strict: !0,
            decode: (r, s, i, o)=>_p(n.decode(r, o)),
            encode: (r, s, i, o)=>_p(n.encode(r, o))
        }));
    N_t = (t)=>_u(en.annotations({
            description: "a string that will be split"
        }), Os(en), {
            strict: !0,
            decode: (e)=>e.split(t),
            encode: (e)=>e.join(t)
        });
    iV = (t)=>t instanceof Error ? t.message : String(t);
    MRe = (t)=>Oo(en.annotations({
            description: "a string to be decoded into JSON"
        }), mRe, {
            strict: !0,
            decode: (e, n, r)=>Ik({
                    try: ()=>JSON.parse(e, t?.reviver),
                    catch: (s)=>new Yr(r, e, iV(s))
                }),
            encode: (e, n, r)=>Ik({
                    try: ()=>JSON.stringify(e, t?.replacer, t?.space),
                    catch: (s)=>new Yr(r, e, iV(s))
                })
        }).annotations({
            title: "parseJson",
            schemaId: V2e
        });
    P1 = (t, e)=>Md(t) ? A1(P1(e), t) : MRe(t);
    RRe = p2e;
    NRe = (t)=>(e)=>e.pipe(R3((n)=>Number.isSafeInteger(n), {
                schemaId: RRe,
                title: "int",
                description: "an integer",
                jsonSchema: {
                    type: "integer"
                },
                ...t
            }));
    VRe = h2e;
    DRe = (t, e, n)=>(r)=>r.pipe(R3((s)=>s >= t && s <= e, {
                schemaId: VRe,
                title: `between(${t}, ${e})`,
                description: `a number between ${t} and ${e}`,
                jsonSchema: {
                    minimum: t,
                    maximum: e
                },
                ...n
            }));
    function BRe(t) {
        return Oo(t, Or, {
            strict: !1,
            decode: (e, n, r)=>lx(m2e(e), ()=>new Yr(r, e, `Unable to decode ${JSON.stringify(e)} into a number`)),
            encode: (e)=>_p(String(e))
        });
    }
    V_t = class extends BRe(en.annotations({
        description: "a string to be decoded into a number"
    })).annotations({
        identifier: "NumberFromString"
    }) {
    };
    D_t = class extends Or.pipe(NRe({
        identifier: "Int"
    })) {
    };
    const oV = g2e, FRe = (t, e, n)=>(r)=>r.pipe(R3((s)=>s >= t && s <= e, {
                schemaId: oV,
                [oV]: {
                    min: t,
                    max: e
                },
                title: `betweenBigInt(${t}, ${e})`,
                description: `a bigint between ${t}n and ${e}n`,
                ...n
            }));
    Wl = class extends Oo(en.annotations({
        description: "a string to be decoded into a bigint"
    }), I3, {
        strict: !0,
        decode: (e, n, r)=>lx(xxe(e), ()=>new Yr(r, e, `Unable to decode ${JSON.stringify(e)} into a bigint`)),
        encode: (e)=>_p(String(e))
    }).annotations({
        identifier: "BigInt"
    }) {
    };
    F_t = class extends Oo(Or.annotations({
        description: "a number to be decoded into a bigint"
    }), I3.pipe(FRe(BigInt(Number.MIN_SAFE_INTEGER), BigInt(Number.MAX_SAFE_INTEGER))), {
        strict: !0,
        decode: (e, n, r)=>lx(vxe(e), ()=>new Yr(r, e, `Unable to decode ${e} into a bigint`)),
        encode: (e, n, r)=>lx(_xe(e), ()=>new Yr(r, e, `Unable to encode ${e}n into a number`))
    }).annotations({
        identifier: "BigIntFromNumber"
    }) {
    };
    const UG = (t, e, n, r)=>HMe(t, {
            onFailure: (s)=>new Ur(n, r, s),
            onSuccess: e
        });
    class HG extends Ni(Swe, {
        typeConstructor: {
            _tag: "Uint8Array"
        },
        identifier: "Uint8ArrayFromSelf",
        pretty: ()=>(e)=>`new Uint8Array(${JSON.stringify(Array.from(e))})`,
        arbitrary: ()=>(e)=>e.uint8Array(),
        equivalence: ()=>Gy(jt)
    }) {
    }
    class LRe extends Or.pipe(DRe(0, 255, {
        identifier: "Uint8",
        description: "a 8-bit unsigned integer"
    })) {
    }
    class fd extends _u(Os(LRe).annotations({
        description: "an array of 8-bit unsigned integers to be decoded into a Uint8Array"
    }), HG, {
        strict: !0,
        decode: (e)=>Uint8Array.from(e),
        encode: (e)=>Array.from(e)
    }).annotations({
        identifier: "Uint8Array"
    }) {
    }
    const zRe = (t, e, n)=>Oo(en.annotations({
            description: "a string to be decoded into a Uint8Array"
        }), HG, {
            strict: !0,
            decode: (r, s, i)=>Ks(e(r), (o)=>new Yr(i, r, o.message)),
            encode: (r)=>_p(n(r))
        }).annotations({
            identifier: t
        }), O1 = zRe("Uint8ArrayFromHex", MMe, OMe), aV = Symbol.for("effect/SchemaId/ValidDate"), URe = (t)=>(e)=>e.pipe(R3((n)=>!Number.isNaN(n.getTime()), {
                schemaId: aV,
                [aV]: {
                    noInvalidDate: !0
                },
                title: "validDate",
                description: "a valid Date",
                ...t
            })), cV = f2e;
    class WI extends Ni(PH, {
        typeConstructor: {
            _tag: "Date"
        },
        identifier: "DateFromSelf",
        schemaId: cV,
        [cV]: {
            noInvalidDate: !1
        },
        description: "a potentially invalid Date instance",
        pretty: ()=>(e)=>`new Date(${JSON.stringify(e)})`,
        arbitrary: ()=>(e)=>e.date({
                    noInvalidDate: !1
                }),
        equivalence: ()=>hwe
    }) {
    }
    class HRe extends _u(en.annotations({
        description: "a string to be decoded into a Date"
    }), WI, {
        strict: !0,
        decode: (e)=>new Date(e),
        encode: (e)=>BH(e)
    }).annotations({
        identifier: "DateFromString"
    }) {
    }
    class jG extends HRe.pipe(URe({
        identifier: "Date"
    })) {
    }
    class jRe extends Ni((e)=>mMe(e) && yMe(e), {
        typeConstructor: {
            _tag: "effect/DateTime.Utc"
        },
        identifier: "DateTimeUtcFromSelf",
        description: "a DateTime.Utc instance",
        pretty: ()=>(e)=>e.toString(),
        arbitrary: ()=>(e)=>e.date({
                    noInvalidDate: !0
                }).map((n)=>_Me(n)),
        equivalence: ()=>wMe
    }) {
    }
    const qRe = (t, e)=>Ik({
            try: ()=>xMe(t),
            catch: ()=>new Yr(e, t, `Unable to decode ${jd(t)} into a DateTime.Utc`)
        });
    class WRe extends Oo(en.annotations({
        description: "a string to be decoded into a DateTime.Utc"
    }), jRe, {
        strict: !0,
        decode: (e, n, r)=>qRe(e, r),
        encode: (e)=>_p(CMe(e))
    }).annotations({
        identifier: "DateTimeUtc"
    }) {
    }
    const KRe = (t, e, n)=>(r)=>{
            const s = r.array(r.tuple(t(r), e(r)));
            return (n.depthIdentifier !== void 0 ? r.oneof(n, r.constant([]), s) : s).map((i)=>new Map(i));
        }, $Re = (t, e)=>(n)=>`new Map([${Array.from(n.entries()).map(([r, s])=>`[${t(r)}, ${e(s)}]`).join(", ")}])`, XRe = (t, e)=>{
        const n = Gy(E0(([r, s], [i, o])=>t(r, i) && e(s, o)));
        return E0((r, s)=>n(Array.from(r.entries()), Array.from(s.entries())));
    }, lV = (t)=>(e, n, r)=>wwe(e) ? UG(t(Array.from(e.entries()), n), (s)=>new Map(s), r, e) : VI(new Yr(r, e)), GRe = (t, e, n)=>Ni([
            t,
            e
        ], {
            decode: (r, s)=>lV(_G(Os(_y(r, s)))),
            encode: (r, s)=>lV(xG(Os(_y(r, s))))
        }, {
            typeConstructor: {
                _tag: "ReadonlyMap"
            },
            description: n,
            pretty: $Re,
            arbitrary: KRe,
            equivalence: XRe
        }), ZRe = ({ key: t, value: e })=>GRe(t, e, `Map<${Pk(t)}, ${Pk(e)}>`);
    function JRe({ key: t, value: e }) {
        return _u(Os(_y(t, e)), ZRe({
            key: Kf(t),
            value: Kf(e)
        }), {
            strict: !0,
            decode: (n)=>new Map(n),
            encode: (n)=>Array.from(n.entries())
        });
    }
    const KI = (t)=>Array.isArray(t) ? KCe(t) : p$(t), YRe = (t)=>(e)=>t(e).map(KI), QRe = (t)=>(e)=>`Data(${t(e)})`, uV = (t)=>(e, n, r)=>Wm(e) ? UG(t(e, n), KI, r, e) : VI(new Yr(r, e)), eNe = (t)=>Ni([
            t
        ], {
            decode: (e)=>uV(_G(e)),
            encode: (e)=>uV(xG(e))
        }, {
            description: `Data<${Pk(t)}>`,
            pretty: QRe,
            arbitrary: YRe
        }), tNe = (t)=>_u(t, eNe(Kf(t)), {
            strict: !1,
            decode: (e)=>KI(e),
            encode: (e)=>Array.isArray(e) ? Array.from(e) : Object.assign({}, e)
        });
    function $I(t) {
        return Hy(t) ? t : t?.disableValidation ?? !1;
    }
    const XI = OPe, qG = gOe, nNe = mOe, rNe = tG, sNe = II, WG = yy, iNe = vOe, xy = SOe, oNe = TOe, aNe = COe, zc = wu, ou = Za, cNe = OOe, KG = MOe, dx = aG, GI = NOe, N3 = DOe, lNe = BOe, $d = FMe, ZI = LOe, $G = lG, uNe = jOe, V3 = $Oe, dNe = XOe, fNe = ZOe, XG = JOe, JI = dG, pNe = nMe, GG = eMe, hNe = k3, YI = iMe, gNe = oMe, bNe = lMe, mNe = uMe, dV = Symbol.for("effect/Subscribable"), yNe = e$, fV = n$, wNe = xo, pV = jf, _Ne = bCe, xNe = "effect/SubscriptionRef", vNe = Symbol.for(xNe), SNe = {
        _A: (t)=>t
    };
    class kNe extends $c {
        ref;
        pubsub;
        semaphore;
        [Ed] = Ed;
        [dV] = dV;
        [f4e] = bE;
        [yNe] = t$;
        [vNe] = SNe;
        constructor(e, n, r){
            super(), this.ref = e, this.pubsub = n, this.semaphore = r, this.get = Zo(this.ref);
        }
        commit() {
            return this.get;
        }
        get;
        get changes() {
            return V(Zo(this.ref), nt((e)=>wt(oG(this.pubsub, {
                    scoped: !0
                }), (n)=>II(ROe(e), n))), this.semaphore.withPermits(1), T3);
        }
        modify(e) {
            return this.modifyEffect((n)=>Zt(e(n)));
        }
        modifyEffect(e) {
            return V(Zo(this.ref), nt(e), nt(([n, r])=>V(ao(this.ref, r), La(n), c3(Z$(this.pubsub, r)))), this.semaphore.withPermits(1));
        }
    }
    const TNe = (t)=>Zo(t.ref), CNe = (t)=>V(py([
            G$(),
            Nl(t),
            iI(1)
        ]), wt(([e, n, r])=>new kNe(n, e, r))), ENe = j(2, (t, e)=>t.modifyEffect(e)), INe = j(2, (t, e)=>V(ao(t.ref, e), c3(Z$(t.pubsub, e)), t.semaphore.withPermits(1))), Xf = TNe, QI = CNe, Il = ENe, ZG = INe, hV = UW, xp = _Ne, ANe = (t)=>t.all.filter((e)=>"result" in e && (e.result?.status === "FAILURE" || e.result?.status === "PARTIAL_SUCCESS")), PNe = (t)=>t.all.filter((e)=>!("result" in e) || e.result === void 0), ONe = ()=>({
            all: []
        }), MNe = (t, e, n, r)=>{
        const [s, i] = V(t.all, e2e((c)=>r.isOneIncludedInOther(e, c.tx))), o = $m(i, {
            tx: e,
            creationTime: n
        }), a = n2e(o, V(cv, ip((c)=>r.ids(c).length), ip((c)=>c.tx)));
        return {
            ...t,
            all: $m(s, a)
        };
    }, RNe = (t, e, n)=>({
            ...t,
            all: Xy(t.all, (r)=>!n.areAllTxIdsIncluded(r.tx, n.ids(e)))
        }), NNe = (t, e, n, r)=>({
            ...t,
            all: Ps(t.all, (s)=>r.areAllTxIdsIncluded(s.tx, r.ids(e)) ? {
                    ...s,
                    result: n
                } : s)
        }), VNe = (t)=>{
        const e = Ni((s)=>t.isTx(s)), n = _u(O1, e, {
            encode: (s)=>t.serialize(s),
            decode: (s)=>t.deserialize(s)
        }), r = tn({
            tx: n,
            creationTime: WRe
        });
        return tn({
            version: ri("v1"),
            transactions: Os(r)
        });
    }, JG = (t, e)=>V(t, Xc(P1(VNe(e))), Qs((n)=>DNe(n))), DNe = (t)=>({
            all: t.transactions
        });
    class YG extends yv("@midnight-ntwrk/indexer-client#QueryClient")() {
    }
    const M1 = (t, e)=>new BNe(`${t}Query`, e);
    class BNe extends $c {
        name;
        document;
        constructor(e, n){
            super(), this.document = n, this.name = e, this.tag = Wc(e), this.run = ((r)=>nt(this, (s)=>s(r)));
        }
        tag;
        run;
        commit() {
            const e = this;
            return or(function*() {
                return dn(yield* M$(e.tag), {
                    onSome: Ht,
                    onNone: ()=>e.defaultFn.bind(e)
                });
            });
        }
        defaultFn(e) {
            return YG.pipe(nt((n)=>n.query(this.document, e)));
        }
    }
    class QG extends yv("@midnight-ntwrk/indexer-client#SubscriptionClient")() {
    }
    const D3 = (t, e)=>new FNe(`${t}Subscription`, e);
    class FNe extends $c {
        name;
        document;
        constructor(e, n){
            super(), this.document = n, this.name = e, this.tag = Wc(e), this.run = ((r)=>zc(this, (s)=>s(r)));
        }
        tag;
        run;
        commit() {
            const e = this;
            return or(function*() {
                return dn(yield* M$(e.tag), {
                    onSome: Ht,
                    onNone: ()=>e.defaultFn.bind(e)
                });
            });
        }
        defaultFn(e) {
            return QG.pipe(zc((n)=>n.subscribe(this.document, e)));
        }
    }
    function LNe(t, e) {
        if (!!!t) throw new Error(e);
    }
    const eZ = {
        Name: [],
        Document: [
            "definitions"
        ],
        OperationDefinition: [
            "description",
            "name",
            "variableDefinitions",
            "directives",
            "selectionSet"
        ],
        VariableDefinition: [
            "description",
            "variable",
            "type",
            "defaultValue",
            "directives"
        ],
        Variable: [
            "name"
        ],
        SelectionSet: [
            "selections"
        ],
        Field: [
            "alias",
            "name",
            "arguments",
            "directives",
            "selectionSet"
        ],
        Argument: [
            "name",
            "value"
        ],
        FragmentSpread: [
            "name",
            "directives"
        ],
        InlineFragment: [
            "typeCondition",
            "directives",
            "selectionSet"
        ],
        FragmentDefinition: [
            "description",
            "name",
            "variableDefinitions",
            "typeCondition",
            "directives",
            "selectionSet"
        ],
        IntValue: [],
        FloatValue: [],
        StringValue: [],
        BooleanValue: [],
        NullValue: [],
        EnumValue: [],
        ListValue: [
            "values"
        ],
        ObjectValue: [
            "fields"
        ],
        ObjectField: [
            "name",
            "value"
        ],
        Directive: [
            "name",
            "arguments"
        ],
        NamedType: [
            "name"
        ],
        ListType: [
            "type"
        ],
        NonNullType: [
            "type"
        ],
        SchemaDefinition: [
            "description",
            "directives",
            "operationTypes"
        ],
        OperationTypeDefinition: [
            "type"
        ],
        ScalarTypeDefinition: [
            "description",
            "name",
            "directives"
        ],
        ObjectTypeDefinition: [
            "description",
            "name",
            "interfaces",
            "directives",
            "fields"
        ],
        FieldDefinition: [
            "description",
            "name",
            "arguments",
            "type",
            "directives"
        ],
        InputValueDefinition: [
            "description",
            "name",
            "type",
            "defaultValue",
            "directives"
        ],
        InterfaceTypeDefinition: [
            "description",
            "name",
            "interfaces",
            "directives",
            "fields"
        ],
        UnionTypeDefinition: [
            "description",
            "name",
            "directives",
            "types"
        ],
        EnumTypeDefinition: [
            "description",
            "name",
            "directives",
            "values"
        ],
        EnumValueDefinition: [
            "description",
            "name",
            "directives"
        ],
        InputObjectTypeDefinition: [
            "description",
            "name",
            "directives",
            "fields"
        ],
        DirectiveDefinition: [
            "description",
            "name",
            "arguments",
            "locations"
        ],
        SchemaExtension: [
            "directives",
            "operationTypes"
        ],
        ScalarTypeExtension: [
            "name",
            "directives"
        ],
        ObjectTypeExtension: [
            "name",
            "interfaces",
            "directives",
            "fields"
        ],
        InterfaceTypeExtension: [
            "name",
            "interfaces",
            "directives",
            "fields"
        ],
        UnionTypeExtension: [
            "name",
            "directives",
            "types"
        ],
        EnumTypeExtension: [
            "name",
            "directives",
            "values"
        ],
        InputObjectTypeExtension: [
            "name",
            "directives",
            "fields"
        ],
        TypeCoordinate: [
            "name"
        ],
        MemberCoordinate: [
            "name",
            "memberName"
        ],
        ArgumentCoordinate: [
            "name",
            "fieldName",
            "argumentName"
        ],
        DirectiveCoordinate: [
            "name"
        ],
        DirectiveArgumentCoordinate: [
            "name",
            "argumentName"
        ]
    }, zNe = new Set(Object.keys(eZ));
    function gV(t) {
        const e = t?.kind;
        return typeof e == "string" && zNe.has(e);
    }
    var bV;
    (function(t) {
        t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
    })(bV || (bV = {}));
    var Mk;
    (function(t) {
        t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", t.TYPE_COORDINATE = "TypeCoordinate", t.MEMBER_COORDINATE = "MemberCoordinate", t.ARGUMENT_COORDINATE = "ArgumentCoordinate", t.DIRECTIVE_COORDINATE = "DirectiveCoordinate", t.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
    })(Mk || (Mk = {}));
    function mV(t) {
        return t === 9 || t === 32;
    }
    function UNe(t, e) {
        const n = t.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), s = r.length === 1, i = r.length > 1 && r.slice(1).every((p)=>p.length === 0 || mV(p.charCodeAt(0))), o = n.endsWith('\\"""'), a = t.endsWith('"') && !o, c = t.endsWith("\\"), l = a || c, u = !s || t.length > 70 || l || i || o;
        let d = "";
        const f = s && mV(t.charCodeAt(0));
        return (u && !f || i) && (d += `
`), d += n, (u || l) && (d += `
`), '"""' + d + '"""';
    }
    const HNe = 10, tZ = 2;
    function jNe(t) {
        return B3(t, []);
    }
    function B3(t, e) {
        switch(typeof t){
            case "string":
                return JSON.stringify(t);
            case "function":
                return t.name ? `[function ${t.name}]` : "[function]";
            case "object":
                return qNe(t, e);
            default:
                return String(t);
        }
    }
    function qNe(t, e) {
        if (t === null) return "null";
        if (e.includes(t)) return "[Circular]";
        const n = [
            ...e,
            t
        ];
        if (WNe(t)) {
            const r = t.toJSON();
            if (r !== t) return typeof r == "string" ? r : B3(r, n);
        } else if (Array.isArray(t)) return $Ne(t, n);
        return KNe(t, n);
    }
    function WNe(t) {
        return typeof t.toJSON == "function";
    }
    function KNe(t, e) {
        const n = Object.entries(t);
        return n.length === 0 ? "{}" : e.length > tZ ? "[" + XNe(t) + "]" : "{ " + n.map(([s, i])=>s + ": " + B3(i, e)).join(", ") + " }";
    }
    function $Ne(t, e) {
        if (t.length === 0) return "[]";
        if (e.length > tZ) return "[Array]";
        const n = Math.min(HNe, t.length), r = t.length - n, s = [];
        for(let i = 0; i < n; ++i)s.push(B3(t[i], e));
        return r === 1 ? s.push("... 1 more item") : r > 1 && s.push(`... ${r} more items`), "[" + s.join(", ") + "]";
    }
    function XNe(t) {
        const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
        if (e === "Object" && typeof t.constructor == "function") {
            const n = t.constructor.name;
            if (typeof n == "string" && n !== "") return n;
        }
        return e;
    }
    function GNe(t) {
        return `"${t.replace(ZNe, JNe)}"`;
    }
    const ZNe = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
    function JNe(t) {
        return YNe[t.charCodeAt(0)];
    }
    const YNe = [
        "\\u0000",
        "\\u0001",
        "\\u0002",
        "\\u0003",
        "\\u0004",
        "\\u0005",
        "\\u0006",
        "\\u0007",
        "\\b",
        "\\t",
        "\\n",
        "\\u000B",
        "\\f",
        "\\r",
        "\\u000E",
        "\\u000F",
        "\\u0010",
        "\\u0011",
        "\\u0012",
        "\\u0013",
        "\\u0014",
        "\\u0015",
        "\\u0016",
        "\\u0017",
        "\\u0018",
        "\\u0019",
        "\\u001A",
        "\\u001B",
        "\\u001C",
        "\\u001D",
        "\\u001E",
        "\\u001F",
        "",
        "",
        '\\"',
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "\\\\",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "\\u007F",
        "\\u0080",
        "\\u0081",
        "\\u0082",
        "\\u0083",
        "\\u0084",
        "\\u0085",
        "\\u0086",
        "\\u0087",
        "\\u0088",
        "\\u0089",
        "\\u008A",
        "\\u008B",
        "\\u008C",
        "\\u008D",
        "\\u008E",
        "\\u008F",
        "\\u0090",
        "\\u0091",
        "\\u0092",
        "\\u0093",
        "\\u0094",
        "\\u0095",
        "\\u0096",
        "\\u0097",
        "\\u0098",
        "\\u0099",
        "\\u009A",
        "\\u009B",
        "\\u009C",
        "\\u009D",
        "\\u009E",
        "\\u009F"
    ], QNe = Object.freeze({});
    function eVe(t, e, n = eZ) {
        const r = new Map;
        for (const v of Object.values(Mk))r.set(v, tVe(e, v));
        let s, i = Array.isArray(t), o = [
            t
        ], a = -1, c = [], l = t, u, d;
        const f = [], p = [];
        do {
            a++;
            const v = a === o.length, k = v && c.length !== 0;
            if (v) {
                if (u = p.length === 0 ? void 0 : f[f.length - 1], l = d, d = p.pop(), k) if (i) {
                    l = l.slice();
                    let A = 0;
                    for (const [P, U] of c){
                        const K = P - A;
                        U === null ? (l.splice(K, 1), A++) : l[K] = U;
                    }
                } else {
                    l = {
                        ...l
                    };
                    for (const [A, P] of c)l[A] = P;
                }
                a = s.index, o = s.keys, c = s.edits, i = s.inArray, s = s.prev;
            } else if (d) {
                if (u = i ? a : o[a], l = d[u], l == null) continue;
                f.push(u);
            }
            let _;
            if (!Array.isArray(l)) {
                var h, m;
                gV(l) || LNe(!1, `Invalid AST Node: ${jNe(l)}.`);
                const A = v ? (h = r.get(l.kind)) === null || h === void 0 ? void 0 : h.leave : (m = r.get(l.kind)) === null || m === void 0 ? void 0 : m.enter;
                if (_ = A?.call(e, l, u, d, f, p), _ === QNe) break;
                if (_ === !1) {
                    if (!v) {
                        f.pop();
                        continue;
                    }
                } else if (_ !== void 0 && (c.push([
                    u,
                    _
                ]), !v)) if (gV(_)) l = _;
                else {
                    f.pop();
                    continue;
                }
            }
            if (_ === void 0 && k && c.push([
                u,
                l
            ]), v) f.pop();
            else {
                var w;
                s = {
                    inArray: i,
                    index: a,
                    keys: o,
                    edits: c,
                    prev: s
                }, i = Array.isArray(l), o = i ? l : (w = n[l.kind]) !== null && w !== void 0 ? w : [], a = -1, c = [], d && p.push(d), d = l;
            }
        }while (s !== void 0);
        return c.length !== 0 ? c[c.length - 1][1] : t;
    }
    function tVe(t, e) {
        const n = t[e];
        return typeof n == "object" ? n : typeof n == "function" ? {
            enter: n,
            leave: void 0
        } : {
            enter: t.enter,
            leave: t.leave
        };
    }
    function nZ(t) {
        return eVe(t, rVe);
    }
    const nVe = 80, rVe = {
        Name: {
            leave: (t)=>t.value
        },
        Variable: {
            leave: (t)=>"$" + t.name
        },
        Document: {
            leave: (t)=>bt(t.definitions, `

`)
        },
        OperationDefinition: {
            leave (t) {
                const e = tS(t.variableDefinitions) ? Gt(`(
`, bt(t.variableDefinitions, `
`), `
)`) : Gt("(", bt(t.variableDefinitions, ", "), ")"), n = Gt("", t.description, `
`) + bt([
                    t.operation,
                    bt([
                        t.name,
                        e
                    ]),
                    bt(t.directives, " ")
                ], " ");
                return (n === "query" ? "" : n + " ") + t.selectionSet;
            }
        },
        VariableDefinition: {
            leave: ({ variable: t, type: e, defaultValue: n, directives: r, description: s })=>Gt("", s, `
`) + t + ": " + e + Gt(" = ", n) + Gt(" ", bt(r, " "))
        },
        SelectionSet: {
            leave: ({ selections: t })=>xa(t)
        },
        Field: {
            leave ({ alias: t, name: e, arguments: n, directives: r, selectionSet: s }) {
                const i = Gt("", t, ": ") + e;
                let o = i + Gt("(", bt(n, ", "), ")");
                return o.length > nVe && (o = i + Gt(`(
`, F_(bt(n, `
`)), `
)`)), bt([
                    o,
                    bt(r, " "),
                    s
                ], " ");
            }
        },
        Argument: {
            leave: ({ name: t, value: e })=>t + ": " + e
        },
        FragmentSpread: {
            leave: ({ name: t, directives: e })=>"..." + t + Gt(" ", bt(e, " "))
        },
        InlineFragment: {
            leave: ({ typeCondition: t, directives: e, selectionSet: n })=>bt([
                    "...",
                    Gt("on ", t),
                    bt(e, " "),
                    n
                ], " ")
        },
        FragmentDefinition: {
            leave: ({ name: t, typeCondition: e, variableDefinitions: n, directives: r, selectionSet: s, description: i })=>Gt("", i, `
`) + `fragment ${t}${Gt("(", bt(n, ", "), ")")} on ${e} ${Gt("", bt(r, " "), " ")}` + s
        },
        IntValue: {
            leave: ({ value: t })=>t
        },
        FloatValue: {
            leave: ({ value: t })=>t
        },
        StringValue: {
            leave: ({ value: t, block: e })=>e ? UNe(t) : GNe(t)
        },
        BooleanValue: {
            leave: ({ value: t })=>t ? "true" : "false"
        },
        NullValue: {
            leave: ()=>"null"
        },
        EnumValue: {
            leave: ({ value: t })=>t
        },
        ListValue: {
            leave: ({ values: t })=>"[" + bt(t, ", ") + "]"
        },
        ObjectValue: {
            leave: ({ fields: t })=>"{" + bt(t, ", ") + "}"
        },
        ObjectField: {
            leave: ({ name: t, value: e })=>t + ": " + e
        },
        Directive: {
            leave: ({ name: t, arguments: e })=>"@" + t + Gt("(", bt(e, ", "), ")")
        },
        NamedType: {
            leave: ({ name: t })=>t
        },
        ListType: {
            leave: ({ type: t })=>"[" + t + "]"
        },
        NonNullType: {
            leave: ({ type: t })=>t + "!"
        },
        SchemaDefinition: {
            leave: ({ description: t, directives: e, operationTypes: n })=>Gt("", t, `
`) + bt([
                    "schema",
                    bt(e, " "),
                    xa(n)
                ], " ")
        },
        OperationTypeDefinition: {
            leave: ({ operation: t, type: e })=>t + ": " + e
        },
        ScalarTypeDefinition: {
            leave: ({ description: t, name: e, directives: n })=>Gt("", t, `
`) + bt([
                    "scalar",
                    e,
                    bt(n, " ")
                ], " ")
        },
        ObjectTypeDefinition: {
            leave: ({ description: t, name: e, interfaces: n, directives: r, fields: s })=>Gt("", t, `
`) + bt([
                    "type",
                    e,
                    Gt("implements ", bt(n, " & ")),
                    bt(r, " "),
                    xa(s)
                ], " ")
        },
        FieldDefinition: {
            leave: ({ description: t, name: e, arguments: n, type: r, directives: s })=>Gt("", t, `
`) + e + (tS(n) ? Gt(`(
`, F_(bt(n, `
`)), `
)`) : Gt("(", bt(n, ", "), ")")) + ": " + r + Gt(" ", bt(s, " "))
        },
        InputValueDefinition: {
            leave: ({ description: t, name: e, type: n, defaultValue: r, directives: s })=>Gt("", t, `
`) + bt([
                    e + ": " + n,
                    Gt("= ", r),
                    bt(s, " ")
                ], " ")
        },
        InterfaceTypeDefinition: {
            leave: ({ description: t, name: e, interfaces: n, directives: r, fields: s })=>Gt("", t, `
`) + bt([
                    "interface",
                    e,
                    Gt("implements ", bt(n, " & ")),
                    bt(r, " "),
                    xa(s)
                ], " ")
        },
        UnionTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, types: r })=>Gt("", t, `
`) + bt([
                    "union",
                    e,
                    bt(n, " "),
                    Gt("= ", bt(r, " | "))
                ], " ")
        },
        EnumTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, values: r })=>Gt("", t, `
`) + bt([
                    "enum",
                    e,
                    bt(n, " "),
                    xa(r)
                ], " ")
        },
        EnumValueDefinition: {
            leave: ({ description: t, name: e, directives: n })=>Gt("", t, `
`) + bt([
                    e,
                    bt(n, " ")
                ], " ")
        },
        InputObjectTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, fields: r })=>Gt("", t, `
`) + bt([
                    "input",
                    e,
                    bt(n, " "),
                    xa(r)
                ], " ")
        },
        DirectiveDefinition: {
            leave: ({ description: t, name: e, arguments: n, repeatable: r, locations: s })=>Gt("", t, `
`) + "directive @" + e + (tS(n) ? Gt(`(
`, F_(bt(n, `
`)), `
)`) : Gt("(", bt(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + bt(s, " | ")
        },
        SchemaExtension: {
            leave: ({ directives: t, operationTypes: e })=>bt([
                    "extend schema",
                    bt(t, " "),
                    xa(e)
                ], " ")
        },
        ScalarTypeExtension: {
            leave: ({ name: t, directives: e })=>bt([
                    "extend scalar",
                    t,
                    bt(e, " ")
                ], " ")
        },
        ObjectTypeExtension: {
            leave: ({ name: t, interfaces: e, directives: n, fields: r })=>bt([
                    "extend type",
                    t,
                    Gt("implements ", bt(e, " & ")),
                    bt(n, " "),
                    xa(r)
                ], " ")
        },
        InterfaceTypeExtension: {
            leave: ({ name: t, interfaces: e, directives: n, fields: r })=>bt([
                    "extend interface",
                    t,
                    Gt("implements ", bt(e, " & ")),
                    bt(n, " "),
                    xa(r)
                ], " ")
        },
        UnionTypeExtension: {
            leave: ({ name: t, directives: e, types: n })=>bt([
                    "extend union",
                    t,
                    bt(e, " "),
                    Gt("= ", bt(n, " | "))
                ], " ")
        },
        EnumTypeExtension: {
            leave: ({ name: t, directives: e, values: n })=>bt([
                    "extend enum",
                    t,
                    bt(e, " "),
                    xa(n)
                ], " ")
        },
        InputObjectTypeExtension: {
            leave: ({ name: t, directives: e, fields: n })=>bt([
                    "extend input",
                    t,
                    bt(e, " "),
                    xa(n)
                ], " ")
        },
        TypeCoordinate: {
            leave: ({ name: t })=>t
        },
        MemberCoordinate: {
            leave: ({ name: t, memberName: e })=>bt([
                    t,
                    Gt(".", e)
                ])
        },
        ArgumentCoordinate: {
            leave: ({ name: t, fieldName: e, argumentName: n })=>bt([
                    t,
                    Gt(".", e),
                    Gt("(", n, ":)")
                ])
        },
        DirectiveCoordinate: {
            leave: ({ name: t })=>bt([
                    "@",
                    t
                ])
        },
        DirectiveArgumentCoordinate: {
            leave: ({ name: t, argumentName: e })=>bt([
                    "@",
                    t,
                    Gt("(", e, ":)")
                ])
        }
    };
    function bt(t, e = "") {
        var n;
        return (n = t?.filter((r)=>r).join(e)) !== null && n !== void 0 ? n : "";
    }
    function xa(t) {
        return Gt(`{
`, F_(bt(t, `
`)), `
}`);
    }
    function Gt(t, e, n = "") {
        return e != null && e !== "" ? t + e + n : "";
    }
    function F_(t) {
        return Gt("  ", t.replace(/\n/g, `
  `));
    }
    function tS(t) {
        var e;
        return (e = t?.some((n)=>n.includes(`
`))) !== null && e !== void 0 ? e : !1;
    }
    function sVe(t) {
        return typeof t == "object" && t !== null;
    }
    function iVe(t) {
        const { credentials: e = "same-origin", referrer: n, referrerPolicy: r, shouldRetry: s = ()=>!1 } = t, i = t.fetchFn || fetch, o = t.abortControllerImpl || AbortController, a = (()=>{
            let c = !1;
            const l = [];
            return {
                get disposed () {
                    return c;
                },
                onDispose (u) {
                    return c ? (setTimeout(()=>u(), 0), ()=>{}) : (l.push(u), ()=>{
                        l.splice(l.indexOf(u), 1);
                    });
                },
                dispose () {
                    if (!c) {
                        c = !0;
                        for (const u of [
                            ...l
                        ])u();
                    }
                }
            };
        })();
        return {
            subscribe (c, l) {
                if (a.disposed) throw new Error("Client has been disposed");
                const u = new o, d = a.onDispose(()=>{
                    d(), u.abort();
                });
                return (async ()=>{
                    var f;
                    let p = null, h = 0;
                    for(;;){
                        if (p) {
                            const m = await s(p, h);
                            if (u.signal.aborted) return;
                            if (!m) throw p;
                            h++;
                        }
                        try {
                            const m = typeof t.url == "function" ? await t.url(c) : t.url;
                            if (u.signal.aborted) return;
                            const w = typeof t.headers == "function" ? await t.headers() : (f = t.headers) !== null && f !== void 0 ? f : {};
                            if (u.signal.aborted) return;
                            let v;
                            try {
                                v = await i(m, {
                                    signal: u.signal,
                                    method: "POST",
                                    headers: Object.assign(Object.assign({}, w), {
                                        "content-type": "application/json; charset=utf-8",
                                        accept: "application/graphql-response+json, application/json"
                                    }),
                                    credentials: e,
                                    referrer: n,
                                    referrerPolicy: r,
                                    body: JSON.stringify(c)
                                });
                            } catch (A) {
                                throw new nS(A);
                            }
                            if (!v.ok) throw new nS(v);
                            if (!v.body) throw new Error("Missing response body");
                            const k = v.headers.get("content-type");
                            if (!k) throw new Error("Missing response content-type");
                            if (!k.includes("application/graphql-response+json") && !k.includes("application/json")) throw new Error(`Unsupported response content-type ${k}`);
                            const _ = await v.json();
                            return l.next(_), u.abort();
                        } catch (m) {
                            if (u.signal.aborted) return;
                            if (!(m instanceof nS)) throw m;
                            p = m;
                        }
                    }
                })().then(()=>l.complete()).catch((f)=>l.error(f)), ()=>u.abort();
            },
            dispose () {
                a.dispose();
            }
        };
    }
    class nS extends Error {
        constructor(e){
            let n, r;
            oVe(e) ? (r = e, n = "Server responded with " + e.status + ": " + e.statusText) : e instanceof Error ? n = e.message : n = String(e), super(n), this.name = this.constructor.name, this.response = r;
        }
    }
    function oVe(t) {
        return sVe(t) && typeof t.ok == "boolean" && typeof t.status == "number" && typeof t.statusText == "string";
    }
    class rZ extends wn("InvalidProtocolSchemeError") {
        static tag = "InvalidProtocolSchemeError";
    }
    class aVe extends wn("FailedToDeriveWebSocketUrlError") {
        static tag = "FailedToDeriveWebSocketUrlError";
    }
    const sZ = Lj((t)=>t.protocol === "http:" || t.protocol === "https:", (t)=>Fj(`Invalid protocol scheme '${t.protocol}'. Expected 'http:' or 'https:'`)), iZ = (t)=>{
        const e = new URL(t);
        try {
            return mt(sZ(e));
        } catch (n) {
            return st(new rZ({
                message: String(n),
                invalidScheme: e.protocol
            }));
        }
    }, cVe = Lj((t)=>t.protocol === "ws:" || t.protocol === "wss:", (t)=>Fj(`Invalid protocol scheme '${t.protocol}'. Expected 'ws:' or 'wss:'`)), F3 = (t)=>{
        const e = new URL(t);
        try {
            return mt(cVe(e));
        } catch (n) {
            return st(new rZ({
                message: String(n),
                invalidScheme: e.protocol
            }));
        }
    };
    class ra extends wn("ClientError") {
    }
    class vy extends wn("ServerError") {
    }
    const eA = (t)=>F$(YG, iZ(t.url).pipe(nt((e)=>jp(Kn(()=>iVe({
                    url: e.toString(),
                    shouldRetry: (n, r)=>{
                        const s = n.response?.status ?? 500;
                        return Promise.resolve(r < 3 && s >= 502 && s <= 504);
                    }
                })), (n)=>Kn(()=>n.dispose()))), wt((e)=>new lVe(e))));
    class lVe {
        constructor(e){
            this.client = e;
        }
        client;
        query(e, n) {
            return WEe((r)=>{
                let s;
                const i = this.client.subscribe({
                    query: nZ(e),
                    variables: n
                }, {
                    next: (o)=>s = o,
                    error: (o)=>{
                        const a = o.response?.status ?? 500, c = o.response?.statusText ?? "An unknown error occurred";
                        r(Ns(a >= 400 && a < 500 ? new ra({
                            message: c,
                            cause: o
                        }) : new vy({
                            message: c
                        })));
                    },
                    complete: ()=>r(s.errors ? Ns(new ra({
                            message: s.errors[0].message,
                            cause: s.errors
                        })) : Zt(s.data))
                });
                return Kn(i);
            });
        }
    }
    function Li(t) {
        return t === null ? "null" : Array.isArray(t) ? "array" : typeof t;
    }
    function _f(t) {
        return Li(t) === "object";
    }
    function uVe(t) {
        return Array.isArray(t) && t.length > 0 && t.every((e)=>"message" in e);
    }
    function yV(t, e) {
        return t.length < 124 ? t : e;
    }
    const dVe = "graphql-transport-ws";
    var Ho = ((t)=>(t[t.InternalServerError = 4500] = "InternalServerError", t[t.InternalClientError = 4005] = "InternalClientError", t[t.BadRequest = 4400] = "BadRequest", t[t.BadResponse = 4004] = "BadResponse", t[t.Unauthorized = 4401] = "Unauthorized", t[t.Forbidden = 4403] = "Forbidden", t[t.SubprotocolNotAcceptable = 4406] = "SubprotocolNotAcceptable", t[t.ConnectionInitialisationTimeout = 4408] = "ConnectionInitialisationTimeout", t[t.ConnectionAcknowledgementTimeout = 4504] = "ConnectionAcknowledgementTimeout", t[t.SubscriberAlreadyExists = 4409] = "SubscriberAlreadyExists", t[t.TooManyInitialisationRequests = 4429] = "TooManyInitialisationRequests", t))(Ho || {}), jo = ((t)=>(t.ConnectionInit = "connection_init", t.ConnectionAck = "connection_ack", t.Ping = "ping", t.Pong = "pong", t.Subscribe = "subscribe", t.Next = "next", t.Error = "error", t.Complete = "complete", t))(jo || {});
    function oZ(t) {
        if (!_f(t)) throw new Error(`Message is expected to be an object, but got ${Li(t)}`);
        if (!t.type) throw new Error("Message is missing the 'type' property");
        if (typeof t.type != "string") throw new Error(`Message is expects the 'type' property to be a string, but got ${Li(t.type)}`);
        switch(t.type){
            case "connection_init":
            case "connection_ack":
            case "ping":
            case "pong":
                {
                    if (t.payload != null && !_f(t.payload)) throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);
                    break;
                }
            case "subscribe":
                {
                    if (typeof t.id != "string") throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Li(t.id)}`);
                    if (!t.id) throw new Error(`"${t.type}" message requires a non-empty 'id' property`);
                    if (!_f(t.payload)) throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Li(t.payload)}`);
                    if (typeof t.payload.query != "string") throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Li(t.payload.query)}`);
                    if (t.payload.variables != null && !_f(t.payload.variables)) throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Li(t.payload.variables)}`);
                    if (t.payload.operationName != null && Li(t.payload.operationName) !== "string") throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Li(t.payload.operationName)}`);
                    if (t.payload.extensions != null && !_f(t.payload.extensions)) throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Li(t.payload.extensions)}`);
                    break;
                }
            case "next":
                {
                    if (typeof t.id != "string") throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Li(t.id)}`);
                    if (!t.id) throw new Error(`"${t.type}" message requires a non-empty 'id' property`);
                    if (!_f(t.payload)) throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Li(t.payload)}`);
                    break;
                }
            case "error":
                {
                    if (typeof t.id != "string") throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Li(t.id)}`);
                    if (!t.id) throw new Error(`"${t.type}" message requires a non-empty 'id' property`);
                    if (!uVe(t.payload)) throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);
                    break;
                }
            case "complete":
                {
                    if (typeof t.id != "string") throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Li(t.id)}`);
                    if (!t.id) throw new Error(`"${t.type}" message requires a non-empty 'id' property`);
                    break;
                }
            default:
                throw new Error(`Invalid message 'type' property "${t.type}"`);
        }
        return t;
    }
    function fVe(t, e) {
        return oZ(typeof t == "string" ? JSON.parse(t, e) : t);
    }
    function Ib(t, e) {
        return oZ(t), JSON.stringify(t, e);
    }
    function pVe(t) {
        const { url: e, connectionParams: n, lazy: r = !0, onNonLazyError: s = console.error, lazyCloseTimeout: i = 0, keepAlive: o = 0, disablePong: a, connectionAckWaitTimeout: c = 0, retryAttempts: l = 5, retryWait: u = async function(y) {
            const C = Math.pow(2, y);
            await new Promise((R)=>setTimeout(R, C * 1e3 + Math.floor(Math.random() * 2700 + 300)));
        }, shouldRetry: d = rS, on: f, webSocketImpl: p, generateID: h = function() {
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (y)=>{
                const C = Math.random() * 16 | 0;
                return (y == "x" ? C : C & 3 | 8).toString(16);
            });
        }, jsonMessageReplacer: m, jsonMessageReviver: w } = t;
        let v;
        if (p) {
            if (!gVe(p)) throw new Error("Invalid WebSocket implementation provided");
            v = p;
        } else typeof WebSocket < "u" ? v = WebSocket : typeof globalThis < "u" ? v = globalThis.WebSocket || globalThis.MozWebSocket : typeof window < "u" && (v = window.WebSocket || window.MozWebSocket);
        if (!v) throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");
        const k = v, _ = (()=>{
            const g = (()=>{
                const C = {};
                return {
                    on (R, N) {
                        return C[R] = N, ()=>{
                            delete C[R];
                        };
                    },
                    emit (R) {
                        "id" in R && C[R.id]?.(R);
                    }
                };
            })(), y = {
                connecting: f?.connecting ? [
                    f.connecting
                ] : [],
                opened: f?.opened ? [
                    f.opened
                ] : [],
                connected: f?.connected ? [
                    f.connected
                ] : [],
                ping: f?.ping ? [
                    f.ping
                ] : [],
                pong: f?.pong ? [
                    f.pong
                ] : [],
                message: f?.message ? [
                    g.emit,
                    f.message
                ] : [
                    g.emit
                ],
                closed: f?.closed ? [
                    f.closed
                ] : [],
                error: f?.error ? [
                    f.error
                ] : []
            };
            return {
                onMessage: g.on,
                on (C, R) {
                    const N = y[C];
                    return N.push(R), ()=>{
                        N.splice(N.indexOf(R), 1);
                    };
                },
                emit (C, ...R) {
                    for (const N of [
                        ...y[C]
                    ])N(...R);
                }
            };
        })();
        function A(g) {
            const y = [
                _.on("error", (C)=>{
                    y.forEach((R)=>R()), g(C);
                }),
                _.on("closed", (C)=>{
                    y.forEach((R)=>R()), g(C);
                })
            ];
        }
        let P, U = 0, K, X = !1, G = 0, ce = !1;
        async function ie() {
            clearTimeout(K);
            const [g, y] = await (P ?? (P = new Promise((N, L)=>(async ()=>{
                    if (X) {
                        if (await u(G), !U) return P = void 0, L({
                            code: 1e3,
                            reason: "All Subscriptions Gone"
                        });
                        G++;
                    }
                    _.emit("connecting", X);
                    const z = new k(typeof e == "function" ? await e() : e, dVe);
                    let B, x;
                    function O() {
                        isFinite(o) && o > 0 && (clearTimeout(x), x = setTimeout(()=>{
                            z.readyState === k.OPEN && (z.send(Ib({
                                type: jo.Ping
                            })), _.emit("ping", !1, void 0));
                        }, o));
                    }
                    A((H)=>{
                        P = void 0, clearTimeout(B), clearTimeout(x), L(H), H instanceof wV && (z.close(4499, "Terminated"), z.onerror = null, z.onclose = null);
                    }), z.onerror = (H)=>_.emit("error", H), z.onclose = (H)=>_.emit("closed", H), z.onopen = async ()=>{
                        try {
                            _.emit("opened", z);
                            const H = typeof n == "function" ? await n() : n;
                            if (z.readyState !== k.OPEN) return;
                            z.send(Ib(H ? {
                                type: jo.ConnectionInit,
                                payload: H
                            } : {
                                type: jo.ConnectionInit
                            }, m)), isFinite(c) && c > 0 && (B = setTimeout(()=>{
                                z.close(Ho.ConnectionAcknowledgementTimeout, "Connection acknowledgement timeout");
                            }, c)), O();
                        } catch (H) {
                            _.emit("error", H), z.close(Ho.InternalClientError, yV(H instanceof Error ? H.message : String(H), "Internal client error"));
                        }
                    };
                    let q = !1;
                    z.onmessage = ({ data: H })=>{
                        try {
                            const Z = fVe(H, w);
                            if (_.emit("message", Z), Z.type === "ping" || Z.type === "pong") {
                                _.emit(Z.type, !0, Z.payload), Z.type === "pong" ? O() : a || (z.send(Ib(Z.payload ? {
                                    type: jo.Pong,
                                    payload: Z.payload
                                } : {
                                    type: jo.Pong
                                })), _.emit("pong", !1, Z.payload));
                                return;
                            }
                            if (q) return;
                            if (Z.type !== jo.ConnectionAck) throw new Error(`First message cannot be of type ${Z.type}`);
                            clearTimeout(B), q = !0, _.emit("connected", z, Z.payload, X), X = !1, G = 0, N([
                                z,
                                new Promise((te, J)=>A(J))
                            ]);
                        } catch (Z) {
                            z.onmessage = null, _.emit("error", Z), z.close(Ho.BadResponse, yV(Z instanceof Error ? Z.message : String(Z), "Bad response"));
                        }
                    };
                })())));
            g.readyState === k.CLOSING && await y;
            let C = ()=>{};
            const R = new Promise((N)=>C = N);
            return [
                g,
                C,
                Promise.race([
                    R.then(()=>{
                        if (!U) {
                            const N = ()=>g.close(1e3, "Normal Closure");
                            isFinite(i) && i > 0 ? K = setTimeout(()=>{
                                g.readyState === k.OPEN && N();
                            }, i) : N();
                        }
                    }),
                    y
                ])
            ];
        }
        function Y(g) {
            if (rS(g) && (hVe(g.code) || [
                Ho.InternalServerError,
                Ho.InternalClientError,
                Ho.BadRequest,
                Ho.BadResponse,
                Ho.Unauthorized,
                Ho.SubprotocolNotAcceptable,
                Ho.SubscriberAlreadyExists,
                Ho.TooManyInitialisationRequests
            ].includes(g.code))) throw g;
            if (ce) return !1;
            if (rS(g) && g.code === 1e3) return U > 0;
            if (!l || G >= l || !d(g)) throw g;
            return X = !0;
        }
        r || (async ()=>{
            for(U++;;)try {
                const [, , g] = await ie();
                await g;
            } catch (g) {
                try {
                    if (!Y(g)) return;
                } catch (y) {
                    return s?.(y);
                }
            }
        })();
        function M(g, y) {
            const C = h(g);
            let R = !1, N = !1, L = ()=>{
                U--, R = !0;
            };
            return (async ()=>{
                for(U++;;)try {
                    const [z, B, x] = await ie();
                    if (R) return B();
                    const O = _.onMessage(C, (q)=>{
                        switch(q.type){
                            case jo.Next:
                                {
                                    y.next(q.payload);
                                    return;
                                }
                            case jo.Error:
                                {
                                    N = !0, R = !0, y.error(q.payload), L();
                                    return;
                                }
                            case jo.Complete:
                                {
                                    R = !0, L();
                                    return;
                                }
                        }
                    });
                    z.send(Ib({
                        id: C,
                        type: jo.Subscribe,
                        payload: g
                    }, m)), L = ()=>{
                        !R && z.readyState === k.OPEN && z.send(Ib({
                            id: C,
                            type: jo.Complete
                        }, m)), U--, R = !0, B();
                    }, await x.finally(O);
                    return;
                } catch (z) {
                    if (!Y(z)) return;
                }
            })().then(()=>{
                N || y.complete();
            }).catch((z)=>{
                y.error(z);
            }), ()=>{
                R || L();
            };
        }
        return {
            on: _.on,
            subscribe: M,
            iterate (g) {
                const y = [], C = {
                    done: !1,
                    error: null,
                    resolve: ()=>{}
                }, R = M(g, {
                    next (L) {
                        y.push(L), C.resolve();
                    },
                    error (L) {
                        C.done = !0, C.error = L, C.resolve();
                    },
                    complete () {
                        C.done = !0, C.resolve();
                    }
                }), N = (async function*() {
                    for(;;){
                        for(y.length || await new Promise((z)=>C.resolve = z); y.length;)yield y.shift();
                        if (C.error) throw C.error;
                        if (C.done) return;
                    }
                })();
                return N.throw = async (L)=>(C.done || (C.done = !0, C.error = L, C.resolve()), {
                        done: !0,
                        value: void 0
                    }), N.return = async ()=>(R(), {
                        done: !0,
                        value: void 0
                    }), N;
            },
            async dispose () {
                if (ce = !0, P) {
                    const [g] = await P;
                    g.close(1e3, "Normal Closure");
                }
            },
            terminate () {
                P && _.emit("closed", new wV);
            }
        };
    }
    class wV extends Error {
        name = "TerminatedCloseEvent";
        message = "4499: Terminated";
        code = 4499;
        reason = "Terminated";
        wasClean = !1;
    }
    function rS(t) {
        return _f(t) && "code" in t && "reason" in t;
    }
    function hVe(t) {
        return [
            1e3,
            1001,
            1006,
            1005,
            1012,
            1013,
            1014
        ].includes(t) ? !1 : t >= 1e3 && t <= 1999;
    }
    function gVe(t) {
        return typeof t == "function" && "constructor" in t && "CLOSED" in t && "CLOSING" in t && "CONNECTING" in t && "OPEN" in t;
    }
    const tA = (t)=>L$(QG, F3(t.url).pipe(nt((e)=>jp(Kn(()=>pVe({
                    url: e.toString(),
                    shouldRetry: ()=>!1,
                    keepAlive: t.keepAlive ?? 15e3
                })), (n)=>Kn(()=>n.dispose()))), wt((e)=>new bVe(e))));
    class bVe {
        constructor(e){
            this.client = e;
        }
        client;
        subscribe(e, n) {
            return qG((r)=>{
                const s = this.client.subscribe({
                    query: nZ(e),
                    variables: n
                }, {
                    next: (i)=>{
                        if (i.errors) return void r.fail(new ra({
                            message: i.errors[0].message,
                            cause: i.errors
                        }));
                        r.single(i.data);
                    },
                    error: (i)=>{
                        r.fail(Array.isArray(i) ? new ra({
                            message: i[0].message
                        }) : new vy({
                            message: String(i)
                        }));
                    },
                    complete: ()=>void r.end()
                });
                return Kn(s);
            });
        }
    }
    const mVe = (t)=>{
        const e = typeof t == "string" ? new URL(t) : t;
        try {
            const n = new URL(e);
            return n.protocol = e.protocol === "https:" ? "wss:" : "ws:", n.pathname.endsWith("/") || (n.pathname += "/"), n.pathname += "ws", mt(n.toString());
        } catch (n) {
            const r = n instanceof Error ? n : new Error(String(n));
            return st(new aVe({
                message: `Failed to derive WebSocket URL from ${e.toString()}`,
                cause: r
            }));
        }
    }, nA = (t, e)=>e ? mt(e) : mVe(t), yVe = (t, e, n)=>t.run(e).pipe(Pd(eA(n)), tI, Cn), wVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "query",
                name: {
                    kind: "Name",
                    value: "BlockHash"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "offset"
                            }
                        },
                        type: {
                            kind: "NamedType",
                            name: {
                                kind: "Name",
                                value: "BlockOffset"
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "block"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "offset"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "offset"
                                        }
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "height"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "hash"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "ledgerParameters"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "timestamp"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, _Ve = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "mutation",
                name: {
                    kind: "Name",
                    value: "Connect"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "viewingKey"
                            }
                        },
                        type: {
                            kind: "NonNullType",
                            type: {
                                kind: "NamedType",
                                name: {
                                    kind: "Name",
                                    value: "ViewingKey"
                                }
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "connect"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "viewingKey"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "viewingKey"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }, xVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "mutation",
                name: {
                    kind: "Name",
                    value: "Disconnect"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "sessionId"
                            }
                        },
                        type: {
                            kind: "NonNullType",
                            type: {
                                kind: "NamedType",
                                name: {
                                    kind: "Name",
                                    value: "HexEncoded"
                                }
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "disconnect"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "sessionId"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "sessionId"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }, vVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "query",
                name: {
                    kind: "Name",
                    value: "FetchTermsAndConditions"
                },
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "block"
                            },
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "systemParameters"
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "termsAndConditions"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "hash"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "url"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, SVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "query",
                name: {
                    kind: "Name",
                    value: "TransactionStatus"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "transactionId"
                            }
                        },
                        type: {
                            kind: "NonNullType",
                            type: {
                                kind: "NamedType",
                                name: {
                                    kind: "Name",
                                    value: "HexEncoded"
                                }
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "transactions"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "offset"
                                    },
                                    value: {
                                        kind: "ObjectValue",
                                        fields: [
                                            {
                                                kind: "ObjectField",
                                                name: {
                                                    kind: "Name",
                                                    value: "identifier"
                                                },
                                                value: {
                                                    kind: "Variable",
                                                    name: {
                                                        kind: "Name",
                                                        value: "transactionId"
                                                    }
                                                }
                                            }
                                        ]
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "__typename"
                                        }
                                    },
                                    {
                                        kind: "InlineFragment",
                                        typeCondition: {
                                            kind: "NamedType",
                                            name: {
                                                kind: "Name",
                                                value: "RegularTransaction"
                                            }
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "identifiers"
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "transactionResult"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "segments"
                                                                },
                                                                selectionSet: {
                                                                    kind: "SelectionSet",
                                                                    selections: [
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "id"
                                                                            }
                                                                        },
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "success"
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "status"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "__typename"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, kVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "subscription",
                name: {
                    kind: "Name",
                    value: "DustLedgerEvents"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "id"
                            }
                        },
                        type: {
                            kind: "NamedType",
                            name: {
                                kind: "Name",
                                value: "Int"
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "dustLedgerEvents"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "id"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "id"
                                        }
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        alias: {
                                            kind: "Name",
                                            value: "type"
                                        },
                                        name: {
                                            kind: "Name",
                                            value: "__typename"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "id"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "raw"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "maxId"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, TVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "subscription",
                name: {
                    kind: "Name",
                    value: "ShieldedTransactions"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "sessionId"
                            }
                        },
                        type: {
                            kind: "NonNullType",
                            type: {
                                kind: "NamedType",
                                name: {
                                    kind: "Name",
                                    value: "HexEncoded"
                                }
                            }
                        }
                    },
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "index"
                            }
                        },
                        type: {
                            kind: "NamedType",
                            name: {
                                kind: "Name",
                                value: "Int"
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "shieldedTransactions"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "sessionId"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "sessionId"
                                        }
                                    }
                                },
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "index"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "index"
                                        }
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "__typename"
                                        }
                                    },
                                    {
                                        kind: "InlineFragment",
                                        typeCondition: {
                                            kind: "NamedType",
                                            name: {
                                                kind: "Name",
                                                value: "ShieldedTransactionsProgress"
                                            }
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "highestEndIndex"
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "highestCheckedEndIndex"
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "highestRelevantEndIndex"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        kind: "InlineFragment",
                                        typeCondition: {
                                            kind: "NamedType",
                                            name: {
                                                kind: "Name",
                                                value: "RelevantTransaction"
                                            }
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "transaction"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "id"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "raw"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "hash"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "protocolVersion"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "identifiers"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "startIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "endIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "fees"
                                                                },
                                                                selectionSet: {
                                                                    kind: "SelectionSet",
                                                                    selections: [
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "paidFees"
                                                                            }
                                                                        },
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "estimatedFees"
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "transactionResult"
                                                                },
                                                                selectionSet: {
                                                                    kind: "SelectionSet",
                                                                    selections: [
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "status"
                                                                            }
                                                                        },
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "segments"
                                                                            },
                                                                            selectionSet: {
                                                                                kind: "SelectionSet",
                                                                                selections: [
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "id"
                                                                                        }
                                                                                    },
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "success"
                                                                                        }
                                                                                    }
                                                                                ]
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "collapsedMerkleTree"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "startIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "endIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "update"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "protocolVersion"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, CVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "subscription",
                name: {
                    kind: "Name",
                    value: "UnshieldedTransactions"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "address"
                            }
                        },
                        type: {
                            kind: "NonNullType",
                            type: {
                                kind: "NamedType",
                                name: {
                                    kind: "Name",
                                    value: "UnshieldedAddress"
                                }
                            }
                        }
                    },
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "transactionId"
                            }
                        },
                        type: {
                            kind: "NamedType",
                            name: {
                                kind: "Name",
                                value: "Int"
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "unshieldedTransactions"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "address"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "address"
                                        }
                                    }
                                },
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "transactionId"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "transactionId"
                                        }
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "InlineFragment",
                                        typeCondition: {
                                            kind: "NamedType",
                                            name: {
                                                kind: "Name",
                                                value: "UnshieldedTransaction"
                                            }
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    alias: {
                                                        kind: "Name",
                                                        value: "type"
                                                    },
                                                    name: {
                                                        kind: "Name",
                                                        value: "__typename"
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "transaction"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                alias: {
                                                                    kind: "Name",
                                                                    value: "type"
                                                                },
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "__typename"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "id"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "hash"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "protocolVersion"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "block"
                                                                },
                                                                selectionSet: {
                                                                    kind: "SelectionSet",
                                                                    selections: [
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "timestamp"
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            },
                                                            {
                                                                kind: "InlineFragment",
                                                                typeCondition: {
                                                                    kind: "NamedType",
                                                                    name: {
                                                                        kind: "Name",
                                                                        value: "RegularTransaction"
                                                                    }
                                                                },
                                                                selectionSet: {
                                                                    kind: "SelectionSet",
                                                                    selections: [
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "identifiers"
                                                                            }
                                                                        },
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "fees"
                                                                            },
                                                                            selectionSet: {
                                                                                kind: "SelectionSet",
                                                                                selections: [
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "paidFees"
                                                                                        }
                                                                                    },
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "estimatedFees"
                                                                                        }
                                                                                    }
                                                                                ]
                                                                            }
                                                                        },
                                                                        {
                                                                            kind: "Field",
                                                                            name: {
                                                                                kind: "Name",
                                                                                value: "transactionResult"
                                                                            },
                                                                            selectionSet: {
                                                                                kind: "SelectionSet",
                                                                                selections: [
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "status"
                                                                                        }
                                                                                    },
                                                                                    {
                                                                                        kind: "Field",
                                                                                        name: {
                                                                                            kind: "Name",
                                                                                            value: "segments"
                                                                                        },
                                                                                        selectionSet: {
                                                                                            kind: "SelectionSet",
                                                                                            selections: [
                                                                                                {
                                                                                                    kind: "Field",
                                                                                                    name: {
                                                                                                        kind: "Name",
                                                                                                        value: "id"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    kind: "Field",
                                                                                                    name: {
                                                                                                        kind: "Name",
                                                                                                        value: "success"
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    }
                                                                                ]
                                                                            }
                                                                        }
                                                                    ]
                                                                }
                                                            }
                                                        ]
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "createdUtxos"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "owner"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "tokenType"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "value"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "outputIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "intentHash"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "ctime"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "registeredForDustGeneration"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "spentUtxos"
                                                    },
                                                    selectionSet: {
                                                        kind: "SelectionSet",
                                                        selections: [
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "owner"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "tokenType"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "value"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "outputIndex"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "intentHash"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "ctime"
                                                                }
                                                            },
                                                            {
                                                                kind: "Field",
                                                                name: {
                                                                    kind: "Name",
                                                                    value: "registeredForDustGeneration"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        kind: "InlineFragment",
                                        typeCondition: {
                                            kind: "NamedType",
                                            name: {
                                                kind: "Name",
                                                value: "UnshieldedTransactionsProgress"
                                            }
                                        },
                                        selectionSet: {
                                            kind: "SelectionSet",
                                            selections: [
                                                {
                                                    kind: "Field",
                                                    alias: {
                                                        kind: "Name",
                                                        value: "type"
                                                    },
                                                    name: {
                                                        kind: "Name",
                                                        value: "__typename"
                                                    }
                                                },
                                                {
                                                    kind: "Field",
                                                    name: {
                                                        kind: "Name",
                                                        value: "highestTransactionId"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, EVe = {
        kind: "Document",
        definitions: [
            {
                kind: "OperationDefinition",
                operation: "subscription",
                name: {
                    kind: "Name",
                    value: "ZswapEvents"
                },
                variableDefinitions: [
                    {
                        kind: "VariableDefinition",
                        variable: {
                            kind: "Variable",
                            name: {
                                kind: "Name",
                                value: "id"
                            }
                        },
                        type: {
                            kind: "NamedType",
                            name: {
                                kind: "Name",
                                value: "Int"
                            }
                        }
                    }
                ],
                selectionSet: {
                    kind: "SelectionSet",
                    selections: [
                        {
                            kind: "Field",
                            name: {
                                kind: "Name",
                                value: "zswapLedgerEvents"
                            },
                            arguments: [
                                {
                                    kind: "Argument",
                                    name: {
                                        kind: "Name",
                                        value: "id"
                                    },
                                    value: {
                                        kind: "Variable",
                                        name: {
                                            kind: "Name",
                                            value: "id"
                                        }
                                    }
                                }
                            ],
                            selectionSet: {
                                kind: "SelectionSet",
                                selections: [
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "id"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "raw"
                                        }
                                    },
                                    {
                                        kind: "Field",
                                        name: {
                                            kind: "Name",
                                            value: "maxId"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, IVe = {
        "\n    query BlockHash($offset: BlockOffset) {\n      block(offset: $offset) {\n        height\n        hash\n        ledgerParameters\n        timestamp\n      }\n    }\n  ": wVe,
        "\n    mutation Connect($viewingKey: ViewingKey!) {\n      connect(viewingKey: $viewingKey)\n    }\n  ": _Ve,
        "\n    mutation Disconnect($sessionId: HexEncoded!) {\n      disconnect(sessionId: $sessionId)\n    }\n  ": xVe,
        "\n    query FetchTermsAndConditions {\n      block {\n        systemParameters {\n          termsAndConditions {\n            hash\n            url\n          }\n        }\n      }\n    }\n  ": vVe,
        "\n    query TransactionStatus($transactionId: HexEncoded!) {\n      transactions(offset: {identifier: $transactionId}) {\n        __typename\n        ... on RegularTransaction {\n          identifiers\n          transactionResult {\n            segments {\n              id\n              success\n            }\n            status\n            __typename\n          }\n        }\n      }\n    }\n  ": SVe,
        "\n    subscription DustLedgerEvents($id: Int) {\n      dustLedgerEvents(id: $id) {\n        type: __typename\n        id\n        raw\n        maxId\n      }\n    }\n  ": kVe,
        "\n    subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {\n      shieldedTransactions(sessionId: $sessionId, index: $index) {\n        __typename\n        ... on ShieldedTransactionsProgress {\n          highestEndIndex\n          highestCheckedEndIndex\n          highestRelevantEndIndex\n        }\n        ... on RelevantTransaction {\n          transaction {\n            id\n            raw\n            hash\n            protocolVersion\n            identifiers\n            startIndex\n            endIndex\n            fees {\n              paidFees\n              estimatedFees\n            }\n            transactionResult {\n              status\n              segments {\n                id\n                success\n              }\n            }\n          }\n          collapsedMerkleTree {\n            startIndex\n            endIndex\n            update\n            protocolVersion\n          }\n        }\n      }\n    }\n  ": TVe,
        "\n    subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {\n      unshieldedTransactions(address: $address, transactionId: $transactionId) {\n        ... on UnshieldedTransaction {\n          type: __typename\n          transaction {\n            type: __typename\n            id\n            hash\n            protocolVersion\n            block {\n              timestamp\n            }\n            ... on RegularTransaction {\n              identifiers\n              fees {\n                paidFees\n                estimatedFees\n              }\n              transactionResult {\n                status\n                segments {\n                  id\n                  success\n                }\n              }\n            }\n          }\n          createdUtxos {\n            owner\n            tokenType\n            value\n            outputIndex\n            intentHash\n            ctime\n            registeredForDustGeneration\n          }\n          spentUtxos {\n            owner\n            tokenType\n            value\n            outputIndex\n            intentHash\n            ctime\n            registeredForDustGeneration\n          }\n        }\n        ... on UnshieldedTransactionsProgress {\n          type: __typename\n          highestTransactionId\n        }\n      }\n    }\n  ": CVe,
        "\n    subscription ZswapEvents($id: Int) {\n      zswapLedgerEvents(id: $id) {\n        id\n        raw\n        maxId\n      }\n    }\n  ": EVe
    };
    function xu(t) {
        return IVe[t] ?? {};
    }
    M1("Connect", xu(`
    mutation Connect($viewingKey: ViewingKey!) {
      connect(viewingKey: $viewingKey)
    }
  `));
    M1("Disconnect", xu(`
    mutation Disconnect($sessionId: HexEncoded!) {
      disconnect(sessionId: $sessionId)
    }
  `));
    const AVe = M1("BlockHash", xu(`
    query BlockHash($offset: BlockOffset) {
      block(offset: $offset) {
        height
        hash
        ledgerParameters
        timestamp
      }
    }
  `)), PVe = M1("FetchTermsAndConditions", xu(`
    query FetchTermsAndConditions {
      block {
        systemParameters {
          termsAndConditions {
            hash
            url
          }
        }
      }
    }
  `)), OVe = M1("TransactionStatus", xu(`
    query TransactionStatus($transactionId: HexEncoded!) {
      transactions(offset: {identifier: $transactionId}) {
        __typename
        ... on RegularTransaction {
          identifiers
          transactionResult {
            segments {
              id
              success
            }
            status
            __typename
          }
        }
      }
    }
  `)), MVe = D3("DustLedgerEvents", xu(`
    subscription DustLedgerEvents($id: Int) {
      dustLedgerEvents(id: $id) {
        type: __typename
        id
        raw
        maxId
      }
    }
  `));
    D3("ShieldedTransactions", xu(`
    subscription ShieldedTransactions($sessionId: HexEncoded!, $index: Int) {
      shieldedTransactions(sessionId: $sessionId, index: $index) {
        __typename
        ... on ShieldedTransactionsProgress {
          highestEndIndex
          highestCheckedEndIndex
          highestRelevantEndIndex
        }
        ... on RelevantTransaction {
          transaction {
            id
            raw
            hash
            protocolVersion
            identifiers
            startIndex
            endIndex
            fees {
              paidFees
              estimatedFees
            }
            transactionResult {
              status
              segments {
                id
                success
              }
            }
          }
          collapsedMerkleTree {
            startIndex
            endIndex
            update
            protocolVersion
          }
        }
      }
    }
  `));
    const RVe = D3("UnshieldedTransactions", xu(`
    subscription UnshieldedTransactions($address: UnshieldedAddress!, $transactionId: Int) {
      unshieldedTransactions(address: $address, transactionId: $transactionId) {
        ... on UnshieldedTransaction {
          type: __typename
          transaction {
            type: __typename
            id
            hash
            protocolVersion
            block {
              timestamp
            }
            ... on RegularTransaction {
              identifiers
              fees {
                paidFees
                estimatedFees
              }
              transactionResult {
                status
                segments {
                  id
                  success
                }
              }
            }
          }
          createdUtxos {
            owner
            tokenType
            value
            outputIndex
            intentHash
            ctime
            registeredForDustGeneration
          }
          spentUtxos {
            owner
            tokenType
            value
            outputIndex
            intentHash
            ctime
            registeredForDustGeneration
          }
        }
        ... on UnshieldedTransactionsProgress {
          type: __typename
          highestTransactionId
        }
      }
    }
  `)), NVe = D3("ZswapEvents", xu(`
    subscription ZswapEvents($id: Int) {
      zswapLedgerEvents(id: $id) {
        id
        raw
        maxId
      }
    }
  `)), sS = j(2, (t, e)=>t.reduce(e)), aZ = j(2, (t, e)=>nu(t, e.empty, e.combine)), VVe = {
        empty: 0,
        combine: (t, e)=>t + e
    }, DVe = {
        empty: 0n,
        combine: (t, e)=>t + e
    };
    aZ(VVe);
    const BVe = aZ(DVe), FVe = (t)=>t.arrayBuffer().then((e)=>new Uint8Array(e)), cZ = (t, e)=>new Date(+t + Number(e) * 1e3), Br = (t)=>xr(t, {
            onLeft: (e)=>Ns(e),
            onRight: (e)=>Zt(e)
        });
    j(2, (t, e)=>xr(t, {
            onRight: (n)=>mt(n),
            onLeft: e
        }));
    class L_t extends wn("LeftError") {
        constructor({ cause: e }){
            super({
                message: "Unexpected left value",
                cause: e
            });
        }
    }
    const rA = (t)=>t.__polyTag__, LVe = (t, e)=>{
        if (t.__polyTag__ in e) {
            const n = t.__polyTag__, r = e[n];
            return r(t);
        } else throw new Error(`Not found implementation for ${String(t.__polyTag__)}`);
    }, zVe = (t, e)=>[
            ...t,
            e
        ];
    function UVe(t, e) {
        return t.length == 0 ? e() : t.at(0);
    }
    const lZ = (t)=>UVe(t, ()=>{
            throw new Error("Cannot get head from empty hlist");
        }), HVe = (t)=>t.toSpliced(0, 1);
    class jVe extends wn("LedgerError") {
    }
    const L_ = (t)=>yo({
            try: t,
            catch: (e)=>{
                const n = e instanceof Error ? e.message : `${e?.toString()}`;
                return new jVe({
                    message: `Error from ledger: ${n}`,
                    cause: e
                });
            }
        });
    var Rk = function(t, e) {
        return Rk = Object.setPrototypeOf || {
            __proto__: []
        } instanceof Array && function(n, r) {
            n.__proto__ = r;
        } || function(n, r) {
            for(var s in r)Object.prototype.hasOwnProperty.call(r, s) && (n[s] = r[s]);
        }, Rk(t, e);
    };
    function Mo(t, e) {
        if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
        Rk(t, e);
        function n() {
            this.constructor = t;
        }
        t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n);
    }
    function qVe(t, e, n, r) {
        function s(i) {
            return i instanceof n ? i : new n(function(o) {
                o(i);
            });
        }
        return new (n || (n = Promise))(function(i, o) {
            function a(u) {
                try {
                    l(r.next(u));
                } catch (d) {
                    o(d);
                }
            }
            function c(u) {
                try {
                    l(r.throw(u));
                } catch (d) {
                    o(d);
                }
            }
            function l(u) {
                u.done ? i(u.value) : s(u.value).then(a, c);
            }
            l((r = r.apply(t, e || [])).next());
        });
    }
    function uZ(t, e) {
        var n = {
            label: 0,
            sent: function() {
                if (i[0] & 1) throw i[1];
                return i[1];
            },
            trys: [],
            ops: []
        }, r, s, i, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
        return o.next = a(0), o.throw = a(1), o.return = a(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
            return this;
        }), o;
        function a(l) {
            return function(u) {
                return c([
                    l,
                    u
                ]);
            };
        }
        function c(l) {
            if (r) throw new TypeError("Generator is already executing.");
            for(; o && (o = 0, l[0] && (n = 0)), n;)try {
                if (r = 1, s && (i = l[0] & 2 ? s.return : l[0] ? s.throw || ((i = s.return) && i.call(s), 0) : s.next) && !(i = i.call(s, l[1])).done) return i;
                switch(s = 0, i && (l = [
                    l[0] & 2,
                    i.value
                ]), l[0]){
                    case 0:
                    case 1:
                        i = l;
                        break;
                    case 4:
                        return n.label++, {
                            value: l[1],
                            done: !1
                        };
                    case 5:
                        n.label++, s = l[1], l = [
                            0
                        ];
                        continue;
                    case 7:
                        l = n.ops.pop(), n.trys.pop();
                        continue;
                    default:
                        if (i = n.trys, !(i = i.length > 0 && i[i.length - 1]) && (l[0] === 6 || l[0] === 2)) {
                            n = 0;
                            continue;
                        }
                        if (l[0] === 3 && (!i || l[1] > i[0] && l[1] < i[3])) {
                            n.label = l[1];
                            break;
                        }
                        if (l[0] === 6 && n.label < i[1]) {
                            n.label = i[1], i = l;
                            break;
                        }
                        if (i && n.label < i[2]) {
                            n.label = i[2], n.ops.push(l);
                            break;
                        }
                        i[2] && n.ops.pop(), n.trys.pop();
                        continue;
                }
                l = e.call(t, n);
            } catch (u) {
                l = [
                    6,
                    u
                ], s = 0;
            } finally{
                r = i = 0;
            }
            if (l[0] & 5) throw l[1];
            return {
                value: l[0] ? l[1] : void 0,
                done: !0
            };
        }
    }
    function eg(t) {
        var e = typeof Symbol == "function" && Symbol.iterator, n = e && t[e], r = 0;
        if (n) return n.call(t);
        if (t && typeof t.length == "number") return {
            next: function() {
                return t && r >= t.length && (t = void 0), {
                    value: t && t[r++],
                    done: !t
                };
            }
        };
        throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }
    function vp(t, e) {
        var n = typeof Symbol == "function" && t[Symbol.iterator];
        if (!n) return t;
        var r = n.call(t), s, i = [], o;
        try {
            for(; (e === void 0 || e-- > 0) && !(s = r.next()).done;)i.push(s.value);
        } catch (a) {
            o = {
                error: a
            };
        } finally{
            try {
                s && !s.done && (n = r.return) && n.call(r);
            } finally{
                if (o) throw o.error;
            }
        }
        return i;
    }
    function Sp(t, e, n) {
        if (n || arguments.length === 2) for(var r = 0, s = e.length, i; r < s; r++)(i || !(r in e)) && (i || (i = Array.prototype.slice.call(e, 0, r)), i[r] = e[r]);
        return t.concat(i || Array.prototype.slice.call(e));
    }
    function Yh(t) {
        return this instanceof Yh ? (this.v = t, this) : new Yh(t);
    }
    function WVe(t, e, n) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var r = n.apply(t, e || []), s, i = [];
        return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", o), s[Symbol.asyncIterator] = function() {
            return this;
        }, s;
        function o(p) {
            return function(h) {
                return Promise.resolve(h).then(p, d);
            };
        }
        function a(p, h) {
            r[p] && (s[p] = function(m) {
                return new Promise(function(w, v) {
                    i.push([
                        p,
                        m,
                        w,
                        v
                    ]) > 1 || c(p, m);
                });
            }, h && (s[p] = h(s[p])));
        }
        function c(p, h) {
            try {
                l(r[p](h));
            } catch (m) {
                f(i[0][3], m);
            }
        }
        function l(p) {
            p.value instanceof Yh ? Promise.resolve(p.value.v).then(u, d) : f(i[0][2], p);
        }
        function u(p) {
            c("next", p);
        }
        function d(p) {
            c("throw", p);
        }
        function f(p, h) {
            p(h), i.shift(), i.length && c(i[0][0], i[0][1]);
        }
    }
    function KVe(t) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var e = t[Symbol.asyncIterator], n;
        return e ? e.call(t) : (t = typeof eg == "function" ? eg(t) : t[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
            return this;
        }, n);
        function r(i) {
            n[i] = t[i] && function(o) {
                return new Promise(function(a, c) {
                    o = t[i](o), s(a, c, o.done, o.value);
                });
            };
        }
        function s(i, o, a, c) {
            Promise.resolve(c).then(function(l) {
                i({
                    value: l,
                    done: a
                });
            }, o);
        }
    }
    function Sr(t) {
        return typeof t == "function";
    }
    function sA(t) {
        var e = function(r) {
            Error.call(r), r.stack = new Error().stack;
        }, n = t(e);
        return n.prototype = Object.create(Error.prototype), n.prototype.constructor = n, n;
    }
    var iS = sA(function(t) {
        return function(n) {
            t(this), this.message = n ? n.length + ` errors occurred during unsubscription:
` + n.map(function(r, s) {
                return s + 1 + ") " + r.toString();
            }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = n;
        };
    });
    function fx(t, e) {
        if (t) {
            var n = t.indexOf(e);
            0 <= n && t.splice(n, 1);
        }
    }
    var au = (function() {
        function t(e) {
            this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
        }
        return t.prototype.unsubscribe = function() {
            var e, n, r, s, i;
            if (!this.closed) {
                this.closed = !0;
                var o = this._parentage;
                if (o) if (this._parentage = null, Array.isArray(o)) try {
                    for(var a = eg(o), c = a.next(); !c.done; c = a.next()){
                        var l = c.value;
                        l.remove(this);
                    }
                } catch (m) {
                    e = {
                        error: m
                    };
                } finally{
                    try {
                        c && !c.done && (n = a.return) && n.call(a);
                    } finally{
                        if (e) throw e.error;
                    }
                }
                else o.remove(this);
                var u = this.initialTeardown;
                if (Sr(u)) try {
                    u();
                } catch (m) {
                    i = m instanceof iS ? m.errors : [
                        m
                    ];
                }
                var d = this._finalizers;
                if (d) {
                    this._finalizers = null;
                    try {
                        for(var f = eg(d), p = f.next(); !p.done; p = f.next()){
                            var h = p.value;
                            try {
                                _V(h);
                            } catch (m) {
                                i = i ?? [], m instanceof iS ? i = Sp(Sp([], vp(i)), vp(m.errors)) : i.push(m);
                            }
                        }
                    } catch (m) {
                        r = {
                            error: m
                        };
                    } finally{
                        try {
                            p && !p.done && (s = f.return) && s.call(f);
                        } finally{
                            if (r) throw r.error;
                        }
                    }
                }
                if (i) throw new iS(i);
            }
        }, t.prototype.add = function(e) {
            var n;
            if (e && e !== this) if (this.closed) _V(e);
            else {
                if (e instanceof t) {
                    if (e.closed || e._hasParent(this)) return;
                    e._addParent(this);
                }
                (this._finalizers = (n = this._finalizers) !== null && n !== void 0 ? n : []).push(e);
            }
        }, t.prototype._hasParent = function(e) {
            var n = this._parentage;
            return n === e || Array.isArray(n) && n.includes(e);
        }, t.prototype._addParent = function(e) {
            var n = this._parentage;
            this._parentage = Array.isArray(n) ? (n.push(e), n) : n ? [
                n,
                e
            ] : e;
        }, t.prototype._removeParent = function(e) {
            var n = this._parentage;
            n === e ? this._parentage = null : Array.isArray(n) && fx(n, e);
        }, t.prototype.remove = function(e) {
            var n = this._finalizers;
            n && fx(n, e), e instanceof t && e._removeParent(this);
        }, t.EMPTY = (function() {
            var e = new t;
            return e.closed = !0, e;
        })(), t;
    })(), dZ = au.EMPTY;
    function fZ(t) {
        return t instanceof au || t && "closed" in t && Sr(t.remove) && Sr(t.add) && Sr(t.unsubscribe);
    }
    function _V(t) {
        Sr(t) ? t() : t.unsubscribe();
    }
    var $Ve = {
        Promise: void 0
    }, XVe = {
        setTimeout: function(t, e) {
            for(var n = [], r = 2; r < arguments.length; r++)n[r - 2] = arguments[r];
            return setTimeout.apply(void 0, Sp([
                t,
                e
            ], vp(n)));
        },
        clearTimeout: function(t) {
            return clearTimeout(t);
        },
        delegate: void 0
    };
    function pZ(t) {
        XVe.setTimeout(function() {
            throw t;
        });
    }
    function xV() {}
    function z_(t) {
        t();
    }
    var iA = (function(t) {
        Mo(e, t);
        function e(n) {
            var r = t.call(this) || this;
            return r.isStopped = !1, n ? (r.destination = n, fZ(n) && n.add(r)) : r.destination = JVe, r;
        }
        return e.create = function(n, r, s) {
            return new tg(n, r, s);
        }, e.prototype.next = function(n) {
            this.isStopped || this._next(n);
        }, e.prototype.error = function(n) {
            this.isStopped || (this.isStopped = !0, this._error(n));
        }, e.prototype.complete = function() {
            this.isStopped || (this.isStopped = !0, this._complete());
        }, e.prototype.unsubscribe = function() {
            this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
        }, e.prototype._next = function(n) {
            this.destination.next(n);
        }, e.prototype._error = function(n) {
            try {
                this.destination.error(n);
            } finally{
                this.unsubscribe();
            }
        }, e.prototype._complete = function() {
            try {
                this.destination.complete();
            } finally{
                this.unsubscribe();
            }
        }, e;
    })(au), GVe = (function() {
        function t(e) {
            this.partialObserver = e;
        }
        return t.prototype.next = function(e) {
            var n = this.partialObserver;
            if (n.next) try {
                n.next(e);
            } catch (r) {
                Ww(r);
            }
        }, t.prototype.error = function(e) {
            var n = this.partialObserver;
            if (n.error) try {
                n.error(e);
            } catch (r) {
                Ww(r);
            }
            else Ww(e);
        }, t.prototype.complete = function() {
            var e = this.partialObserver;
            if (e.complete) try {
                e.complete();
            } catch (n) {
                Ww(n);
            }
        }, t;
    })(), tg = (function(t) {
        Mo(e, t);
        function e(n, r, s) {
            var i = t.call(this) || this, o;
            return Sr(n) || !n ? o = {
                next: n ?? void 0,
                error: r ?? void 0,
                complete: s ?? void 0
            } : o = n, i.destination = new GVe(o), i;
        }
        return e;
    })(iA);
    function Ww(t) {
        pZ(t);
    }
    function ZVe(t) {
        throw t;
    }
    var JVe = {
        closed: !0,
        next: xV,
        error: ZVe,
        complete: xV
    }, oA = (function() {
        return typeof Symbol == "function" && Symbol.observable || "@@observable";
    })();
    function Wp(t) {
        return t;
    }
    function YVe(t) {
        return t.length === 0 ? Wp : t.length === 1 ? t[0] : function(n) {
            return t.reduce(function(r, s) {
                return s(r);
            }, n);
        };
    }
    var us = (function() {
        function t(e) {
            e && (this._subscribe = e);
        }
        return t.prototype.lift = function(e) {
            var n = new t;
            return n.source = this, n.operator = e, n;
        }, t.prototype.subscribe = function(e, n, r) {
            var s = this, i = eDe(e) ? e : new tg(e, n, r);
            return z_(function() {
                var o = s, a = o.operator, c = o.source;
                i.add(a ? a.call(i, c) : c ? s._subscribe(i) : s._trySubscribe(i));
            }), i;
        }, t.prototype._trySubscribe = function(e) {
            try {
                return this._subscribe(e);
            } catch (n) {
                e.error(n);
            }
        }, t.prototype.forEach = function(e, n) {
            var r = this;
            return n = vV(n), new n(function(s, i) {
                var o = new tg({
                    next: function(a) {
                        try {
                            e(a);
                        } catch (c) {
                            i(c), o.unsubscribe();
                        }
                    },
                    error: i,
                    complete: s
                });
                r.subscribe(o);
            });
        }, t.prototype._subscribe = function(e) {
            var n;
            return (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e);
        }, t.prototype[oA] = function() {
            return this;
        }, t.prototype.pipe = function() {
            for(var e = [], n = 0; n < arguments.length; n++)e[n] = arguments[n];
            return YVe(e)(this);
        }, t.prototype.toPromise = function(e) {
            var n = this;
            return e = vV(e), new e(function(r, s) {
                var i;
                n.subscribe(function(o) {
                    return i = o;
                }, function(o) {
                    return s(o);
                }, function() {
                    return r(i);
                });
            });
        }, t.create = function(e) {
            return new t(e);
        }, t;
    })();
    function vV(t) {
        var e;
        return (e = t ?? $Ve.Promise) !== null && e !== void 0 ? e : Promise;
    }
    function QVe(t) {
        return t && Sr(t.next) && Sr(t.error) && Sr(t.complete);
    }
    function eDe(t) {
        return t && t instanceof iA || QVe(t) && fZ(t);
    }
    function hZ(t) {
        return Sr(t?.lift);
    }
    function Ds(t) {
        return function(e) {
            if (hZ(e)) return e.lift(function(n) {
                try {
                    return t(n, this);
                } catch (r) {
                    this.error(r);
                }
            });
            throw new TypeError("Unable to lift unknown Observable type");
        };
    }
    function Gs(t, e, n, r, s) {
        return new tDe(t, e, n, r, s);
    }
    var tDe = (function(t) {
        Mo(e, t);
        function e(n, r, s, i, o, a) {
            var c = t.call(this, n) || this;
            return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
                try {
                    r(l);
                } catch (u) {
                    n.error(u);
                }
            } : t.prototype._next, c._error = i ? function(l) {
                try {
                    i(l);
                } catch (u) {
                    n.error(u);
                } finally{
                    this.unsubscribe();
                }
            } : t.prototype._error, c._complete = s ? function() {
                try {
                    s();
                } catch (l) {
                    n.error(l);
                } finally{
                    this.unsubscribe();
                }
            } : t.prototype._complete, c;
        }
        return e.prototype.unsubscribe = function() {
            var n;
            if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
                var r = this.closed;
                t.prototype.unsubscribe.call(this), !r && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
            }
        }, e;
    })(iA);
    function aA() {
        return Ds(function(t, e) {
            var n = null;
            t._refCount++;
            var r = Gs(e, void 0, void 0, void 0, function() {
                if (!t || t._refCount <= 0 || 0 < --t._refCount) {
                    n = null;
                    return;
                }
                var s = t._connection, i = n;
                n = null, s && (!i || s === i) && s.unsubscribe(), e.unsubscribe();
            });
            t.subscribe(r), r.closed || (n = t.connect());
        });
    }
    var nDe = (function(t) {
        Mo(e, t);
        function e(n, r) {
            var s = t.call(this) || this;
            return s.source = n, s.subjectFactory = r, s._subject = null, s._refCount = 0, s._connection = null, hZ(n) && (s.lift = n.lift), s;
        }
        return e.prototype._subscribe = function(n) {
            return this.getSubject().subscribe(n);
        }, e.prototype.getSubject = function() {
            var n = this._subject;
            return (!n || n.isStopped) && (this._subject = this.subjectFactory()), this._subject;
        }, e.prototype._teardown = function() {
            this._refCount = 0;
            var n = this._connection;
            this._subject = this._connection = null, n?.unsubscribe();
        }, e.prototype.connect = function() {
            var n = this, r = this._connection;
            if (!r) {
                r = this._connection = new au;
                var s = this.getSubject();
                r.add(this.source.subscribe(Gs(s, void 0, function() {
                    n._teardown(), s.complete();
                }, function(i) {
                    n._teardown(), s.error(i);
                }, function() {
                    return n._teardown();
                }))), r.closed && (this._connection = null, r = au.EMPTY);
            }
            return r;
        }, e.prototype.refCount = function() {
            return aA()(this);
        }, e;
    })(us), rDe = sA(function(t) {
        return function() {
            t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
        };
    }), R1 = (function(t) {
        Mo(e, t);
        function e() {
            var n = t.call(this) || this;
            return n.closed = !1, n.currentObservers = null, n.observers = [], n.isStopped = !1, n.hasError = !1, n.thrownError = null, n;
        }
        return e.prototype.lift = function(n) {
            var r = new SV(this, this);
            return r.operator = n, r;
        }, e.prototype._throwIfClosed = function() {
            if (this.closed) throw new rDe;
        }, e.prototype.next = function(n) {
            var r = this;
            z_(function() {
                var s, i;
                if (r._throwIfClosed(), !r.isStopped) {
                    r.currentObservers || (r.currentObservers = Array.from(r.observers));
                    try {
                        for(var o = eg(r.currentObservers), a = o.next(); !a.done; a = o.next()){
                            var c = a.value;
                            c.next(n);
                        }
                    } catch (l) {
                        s = {
                            error: l
                        };
                    } finally{
                        try {
                            a && !a.done && (i = o.return) && i.call(o);
                        } finally{
                            if (s) throw s.error;
                        }
                    }
                }
            });
        }, e.prototype.error = function(n) {
            var r = this;
            z_(function() {
                if (r._throwIfClosed(), !r.isStopped) {
                    r.hasError = r.isStopped = !0, r.thrownError = n;
                    for(var s = r.observers; s.length;)s.shift().error(n);
                }
            });
        }, e.prototype.complete = function() {
            var n = this;
            z_(function() {
                if (n._throwIfClosed(), !n.isStopped) {
                    n.isStopped = !0;
                    for(var r = n.observers; r.length;)r.shift().complete();
                }
            });
        }, e.prototype.unsubscribe = function() {
            this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
        }, Object.defineProperty(e.prototype, "observed", {
            get: function() {
                var n;
                return ((n = this.observers) === null || n === void 0 ? void 0 : n.length) > 0;
            },
            enumerable: !1,
            configurable: !0
        }), e.prototype._trySubscribe = function(n) {
            return this._throwIfClosed(), t.prototype._trySubscribe.call(this, n);
        }, e.prototype._subscribe = function(n) {
            return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
        }, e.prototype._innerSubscribe = function(n) {
            var r = this, s = this, i = s.hasError, o = s.isStopped, a = s.observers;
            return i || o ? dZ : (this.currentObservers = null, a.push(n), new au(function() {
                r.currentObservers = null, fx(a, n);
            }));
        }, e.prototype._checkFinalizedStatuses = function(n) {
            var r = this, s = r.hasError, i = r.thrownError, o = r.isStopped;
            s ? n.error(i) : o && n.complete();
        }, e.prototype.asObservable = function() {
            var n = new us;
            return n.source = this, n;
        }, e.create = function(n, r) {
            return new SV(n, r);
        }, e;
    })(us), SV = (function(t) {
        Mo(e, t);
        function e(n, r) {
            var s = t.call(this) || this;
            return s.destination = n, s.source = r, s;
        }
        return e.prototype.next = function(n) {
            var r, s;
            (s = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || s === void 0 || s.call(r, n);
        }, e.prototype.error = function(n) {
            var r, s;
            (s = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || s === void 0 || s.call(r, n);
        }, e.prototype.complete = function() {
            var n, r;
            (r = (n = this.destination) === null || n === void 0 ? void 0 : n.complete) === null || r === void 0 || r.call(n);
        }, e.prototype._subscribe = function(n) {
            var r, s;
            return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(n)) !== null && s !== void 0 ? s : dZ;
        }, e;
    })(R1), Sy = (function(t) {
        Mo(e, t);
        function e(n) {
            var r = t.call(this) || this;
            return r._value = n, r;
        }
        return Object.defineProperty(e.prototype, "value", {
            get: function() {
                return this.getValue();
            },
            enumerable: !1,
            configurable: !0
        }), e.prototype._subscribe = function(n) {
            var r = t.prototype._subscribe.call(this, n);
            return !r.closed && n.next(this._value), r;
        }, e.prototype.getValue = function() {
            var n = this, r = n.hasError, s = n.thrownError, i = n._value;
            if (r) throw s;
            return this._throwIfClosed(), i;
        }, e.prototype.next = function(n) {
            t.prototype.next.call(this, this._value = n);
        }, e;
    })(R1), cA = {
        now: function() {
            return (cA.delegate || Date).now();
        },
        delegate: void 0
    }, gZ = (function(t) {
        Mo(e, t);
        function e(n, r, s) {
            n === void 0 && (n = 1 / 0), r === void 0 && (r = 1 / 0), s === void 0 && (s = cA);
            var i = t.call(this) || this;
            return i._bufferSize = n, i._windowTime = r, i._timestampProvider = s, i._buffer = [], i._infiniteTimeWindow = !0, i._infiniteTimeWindow = r === 1 / 0, i._bufferSize = Math.max(1, n), i._windowTime = Math.max(1, r), i;
        }
        return e.prototype.next = function(n) {
            var r = this, s = r.isStopped, i = r._buffer, o = r._infiniteTimeWindow, a = r._timestampProvider, c = r._windowTime;
            s || (i.push(n), !o && i.push(a.now() + c)), this._trimBuffer(), t.prototype.next.call(this, n);
        }, e.prototype._subscribe = function(n) {
            this._throwIfClosed(), this._trimBuffer();
            for(var r = this._innerSubscribe(n), s = this, i = s._infiniteTimeWindow, o = s._buffer, a = o.slice(), c = 0; c < a.length && !n.closed; c += i ? 1 : 2)n.next(a[c]);
            return this._checkFinalizedStatuses(n), r;
        }, e.prototype._trimBuffer = function() {
            var n = this, r = n._bufferSize, s = n._timestampProvider, i = n._buffer, o = n._infiniteTimeWindow, a = (o ? 1 : 2) * r;
            if (r < 1 / 0 && a < i.length && i.splice(0, i.length - a), !o) {
                for(var c = s.now(), l = 0, u = 1; u < i.length && i[u] <= c; u += 2)l = u;
                l && i.splice(0, l + 1);
            }
        }, e;
    })(R1), sDe = (function(t) {
        Mo(e, t);
        function e(n, r) {
            return t.call(this) || this;
        }
        return e.prototype.schedule = function(n, r) {
            return this;
        }, e;
    })(au), kV = {
        setInterval: function(t, e) {
            for(var n = [], r = 2; r < arguments.length; r++)n[r - 2] = arguments[r];
            return setInterval.apply(void 0, Sp([
                t,
                e
            ], vp(n)));
        },
        clearInterval: function(t) {
            return clearInterval(t);
        },
        delegate: void 0
    }, iDe = (function(t) {
        Mo(e, t);
        function e(n, r) {
            var s = t.call(this, n, r) || this;
            return s.scheduler = n, s.work = r, s.pending = !1, s;
        }
        return e.prototype.schedule = function(n, r) {
            var s;
            if (r === void 0 && (r = 0), this.closed) return this;
            this.state = n;
            var i = this.id, o = this.scheduler;
            return i != null && (this.id = this.recycleAsyncId(o, i, r)), this.pending = !0, this.delay = r, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(o, this.id, r), this;
        }, e.prototype.requestAsyncId = function(n, r, s) {
            return s === void 0 && (s = 0), kV.setInterval(n.flush.bind(n, this), s);
        }, e.prototype.recycleAsyncId = function(n, r, s) {
            if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1) return r;
            r != null && kV.clearInterval(r);
        }, e.prototype.execute = function(n, r) {
            if (this.closed) return new Error("executing a cancelled action");
            this.pending = !1;
            var s = this._execute(n, r);
            if (s) return s;
            this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
        }, e.prototype._execute = function(n, r) {
            var s = !1, i;
            try {
                this.work(n);
            } catch (o) {
                s = !0, i = o || new Error("Scheduled action threw falsy error");
            }
            if (s) return this.unsubscribe(), i;
        }, e.prototype.unsubscribe = function() {
            if (!this.closed) {
                var n = this, r = n.id, s = n.scheduler, i = s.actions;
                this.work = this.state = this.scheduler = null, this.pending = !1, fx(i, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, t.prototype.unsubscribe.call(this);
            }
        }, e;
    })(sDe), oDe = 1, oS, Nk = {};
    function TV(t) {
        return t in Nk ? (delete Nk[t], !0) : !1;
    }
    var bZ = {
        setImmediate: function(t) {
            var e = oDe++;
            return Nk[e] = !0, oS || (oS = Promise.resolve()), oS.then(function() {
                return TV(e) && t();
            }), e;
        },
        clearImmediate: function(t) {
            TV(t);
        }
    }, aDe = bZ.setImmediate, cDe = bZ.clearImmediate, CV = {
        setImmediate: function() {
            for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
            return aDe.apply(void 0, Sp([], vp(t)));
        },
        clearImmediate: function(t) {
            return cDe(t);
        },
        delegate: void 0
    }, lDe = (function(t) {
        Mo(e, t);
        function e(n, r) {
            var s = t.call(this, n, r) || this;
            return s.scheduler = n, s.work = r, s;
        }
        return e.prototype.requestAsyncId = function(n, r, s) {
            return s === void 0 && (s = 0), s !== null && s > 0 ? t.prototype.requestAsyncId.call(this, n, r, s) : (n.actions.push(this), n._scheduled || (n._scheduled = CV.setImmediate(n.flush.bind(n, void 0))));
        }, e.prototype.recycleAsyncId = function(n, r, s) {
            var i;
            if (s === void 0 && (s = 0), s != null ? s > 0 : this.delay > 0) return t.prototype.recycleAsyncId.call(this, n, r, s);
            var o = n.actions;
            r != null && ((i = o[o.length - 1]) === null || i === void 0 ? void 0 : i.id) !== r && (CV.clearImmediate(r), n._scheduled === r && (n._scheduled = void 0));
        }, e;
    })(iDe), EV = (function() {
        function t(e, n) {
            n === void 0 && (n = t.now), this.schedulerActionCtor = e, this.now = n;
        }
        return t.prototype.schedule = function(e, n, r) {
            return n === void 0 && (n = 0), new this.schedulerActionCtor(this, e).schedule(r, n);
        }, t.now = cA.now, t;
    })(), uDe = (function(t) {
        Mo(e, t);
        function e(n, r) {
            r === void 0 && (r = EV.now);
            var s = t.call(this, n, r) || this;
            return s.actions = [], s._active = !1, s;
        }
        return e.prototype.flush = function(n) {
            var r = this.actions;
            if (this._active) {
                r.push(n);
                return;
            }
            var s;
            this._active = !0;
            do if (s = n.execute(n.state, n.delay)) break;
            while (n = r.shift());
            if (this._active = !1, s) {
                for(; n = r.shift();)n.unsubscribe();
                throw s;
            }
        }, e;
    })(EV), dDe = (function(t) {
        Mo(e, t);
        function e() {
            return t !== null && t.apply(this, arguments) || this;
        }
        return e.prototype.flush = function(n) {
            this._active = !0;
            var r = this._scheduled;
            this._scheduled = void 0;
            var s = this.actions, i;
            n = n || s.shift();
            do if (i = n.execute(n.state, n.delay)) break;
            while ((n = s[0]) && n.id === r && s.shift());
            if (this._active = !1, i) {
                for(; (n = s[0]) && n.id === r && s.shift();)n.unsubscribe();
                throw i;
            }
        }, e;
    })(uDe), fDe = new dDe(lDe), N1 = new us(function(t) {
        return t.complete();
    });
    function pDe(t) {
        return t && Sr(t.schedule);
    }
    function mZ(t) {
        return t[t.length - 1];
    }
    function hDe(t) {
        return Sr(mZ(t)) ? t.pop() : void 0;
    }
    function L3(t) {
        return pDe(mZ(t)) ? t.pop() : void 0;
    }
    var yZ = (function(t) {
        return t && typeof t.length == "number" && typeof t != "function";
    });
    function wZ(t) {
        return Sr(t?.then);
    }
    function _Z(t) {
        return Sr(t[oA]);
    }
    function xZ(t) {
        return Symbol.asyncIterator && Sr(t?.[Symbol.asyncIterator]);
    }
    function vZ(t) {
        return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
    }
    function gDe() {
        return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
    }
    var SZ = gDe();
    function kZ(t) {
        return Sr(t?.[SZ]);
    }
    function TZ(t) {
        return WVe(this, arguments, function() {
            var n, r, s, i;
            return uZ(this, function(o) {
                switch(o.label){
                    case 0:
                        n = t.getReader(), o.label = 1;
                    case 1:
                        o.trys.push([
                            1,
                            ,
                            9,
                            10
                        ]), o.label = 2;
                    case 2:
                        return [
                            4,
                            Yh(n.read())
                        ];
                    case 3:
                        return r = o.sent(), s = r.value, i = r.done, i ? [
                            4,
                            Yh(void 0)
                        ] : [
                            3,
                            5
                        ];
                    case 4:
                        return [
                            2,
                            o.sent()
                        ];
                    case 5:
                        return [
                            4,
                            Yh(s)
                        ];
                    case 6:
                        return [
                            4,
                            o.sent()
                        ];
                    case 7:
                        return o.sent(), [
                            3,
                            2
                        ];
                    case 8:
                        return [
                            3,
                            10
                        ];
                    case 9:
                        return n.releaseLock(), [
                            7
                        ];
                    case 10:
                        return [
                            2
                        ];
                }
            });
        });
    }
    function CZ(t) {
        return Sr(t?.getReader);
    }
    function Gc(t) {
        if (t instanceof us) return t;
        if (t != null) {
            if (_Z(t)) return bDe(t);
            if (yZ(t)) return mDe(t);
            if (wZ(t)) return yDe(t);
            if (xZ(t)) return EZ(t);
            if (kZ(t)) return wDe(t);
            if (CZ(t)) return _De(t);
        }
        throw vZ(t);
    }
    function bDe(t) {
        return new us(function(e) {
            var n = t[oA]();
            if (Sr(n.subscribe)) return n.subscribe(e);
            throw new TypeError("Provided object does not correctly implement Symbol.observable");
        });
    }
    function mDe(t) {
        return new us(function(e) {
            for(var n = 0; n < t.length && !e.closed; n++)e.next(t[n]);
            e.complete();
        });
    }
    function yDe(t) {
        return new us(function(e) {
            t.then(function(n) {
                e.closed || (e.next(n), e.complete());
            }, function(n) {
                return e.error(n);
            }).then(null, pZ);
        });
    }
    function wDe(t) {
        return new us(function(e) {
            var n, r;
            try {
                for(var s = eg(t), i = s.next(); !i.done; i = s.next()){
                    var o = i.value;
                    if (e.next(o), e.closed) return;
                }
            } catch (a) {
                n = {
                    error: a
                };
            } finally{
                try {
                    i && !i.done && (r = s.return) && r.call(s);
                } finally{
                    if (n) throw n.error;
                }
            }
            e.complete();
        });
    }
    function EZ(t) {
        return new us(function(e) {
            xDe(t, e).catch(function(n) {
                return e.error(n);
            });
        });
    }
    function _De(t) {
        return EZ(TZ(t));
    }
    function xDe(t, e) {
        var n, r, s, i;
        return qVe(this, void 0, void 0, function() {
            var o, a;
            return uZ(this, function(c) {
                switch(c.label){
                    case 0:
                        c.trys.push([
                            0,
                            5,
                            6,
                            11
                        ]), n = KVe(t), c.label = 1;
                    case 1:
                        return [
                            4,
                            n.next()
                        ];
                    case 2:
                        if (r = c.sent(), !!r.done) return [
                            3,
                            4
                        ];
                        if (o = r.value, e.next(o), e.closed) return [
                            2
                        ];
                        c.label = 3;
                    case 3:
                        return [
                            3,
                            1
                        ];
                    case 4:
                        return [
                            3,
                            11
                        ];
                    case 5:
                        return a = c.sent(), s = {
                            error: a
                        }, [
                            3,
                            11
                        ];
                    case 6:
                        return c.trys.push([
                            6,
                            ,
                            9,
                            10
                        ]), r && !r.done && (i = n.return) ? [
                            4,
                            i.call(n)
                        ] : [
                            3,
                            8
                        ];
                    case 7:
                        c.sent(), c.label = 8;
                    case 8:
                        return [
                            3,
                            10
                        ];
                    case 9:
                        if (s) throw s.error;
                        return [
                            7
                        ];
                    case 10:
                        return [
                            7
                        ];
                    case 11:
                        return e.complete(), [
                            2
                        ];
                }
            });
        });
    }
    function pd(t, e, n, r, s) {
        r === void 0 && (r = 0), s === void 0 && (s = !1);
        var i = e.schedule(function() {
            n(), s ? t.add(this.schedule(null, r)) : this.unsubscribe();
        }, r);
        if (t.add(i), !s) return i;
    }
    function IZ(t, e) {
        return e === void 0 && (e = 0), Ds(function(n, r) {
            n.subscribe(Gs(r, function(s) {
                return pd(r, t, function() {
                    return r.next(s);
                }, e);
            }, function() {
                return pd(r, t, function() {
                    return r.complete();
                }, e);
            }, function(s) {
                return pd(r, t, function() {
                    return r.error(s);
                }, e);
            }));
        });
    }
    function AZ(t, e) {
        return e === void 0 && (e = 0), Ds(function(n, r) {
            r.add(t.schedule(function() {
                return n.subscribe(r);
            }, e));
        });
    }
    function vDe(t, e) {
        return Gc(t).pipe(AZ(e), IZ(e));
    }
    function SDe(t, e) {
        return Gc(t).pipe(AZ(e), IZ(e));
    }
    function kDe(t, e) {
        return new us(function(n) {
            var r = 0;
            return e.schedule(function() {
                r === t.length ? n.complete() : (n.next(t[r++]), n.closed || this.schedule());
            });
        });
    }
    function TDe(t, e) {
        return new us(function(n) {
            var r;
            return pd(n, e, function() {
                r = t[SZ](), pd(n, e, function() {
                    var s, i, o;
                    try {
                        s = r.next(), i = s.value, o = s.done;
                    } catch (a) {
                        n.error(a);
                        return;
                    }
                    o ? n.complete() : n.next(i);
                }, 0, !0);
            }), function() {
                return Sr(r?.return) && r.return();
            };
        });
    }
    function PZ(t, e) {
        if (!t) throw new Error("Iterable cannot be null");
        return new us(function(n) {
            pd(n, e, function() {
                var r = t[Symbol.asyncIterator]();
                pd(n, e, function() {
                    r.next().then(function(s) {
                        s.done ? n.complete() : n.next(s.value);
                    });
                }, 0, !0);
            });
        });
    }
    function CDe(t, e) {
        return PZ(TZ(t), e);
    }
    function EDe(t, e) {
        if (t != null) {
            if (_Z(t)) return vDe(t, e);
            if (yZ(t)) return kDe(t, e);
            if (wZ(t)) return SDe(t, e);
            if (xZ(t)) return PZ(t, e);
            if (kZ(t)) return TDe(t, e);
            if (CZ(t)) return CDe(t, e);
        }
        throw vZ(t);
    }
    function Tc(t, e) {
        return e ? EDe(t, e) : Gc(t);
    }
    function Te() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = L3(t);
        return Tc(t, n);
    }
    var lA = sA(function(t) {
        return function() {
            t(this), this.name = "EmptyError", this.message = "no elements in sequence";
        };
    });
    function Dn(t, e) {
        return new Promise(function(n, r) {
            var s = new tg({
                next: function(i) {
                    n(i), s.unsubscribe();
                },
                error: r,
                complete: function() {
                    r(new lA);
                }
            });
            t.subscribe(s);
        });
    }
    function ve(t, e) {
        return Ds(function(n, r) {
            var s = 0;
            n.subscribe(Gs(r, function(i) {
                r.next(t.call(e, i, s++));
            }));
        });
    }
    var IDe = Array.isArray;
    function ADe(t, e) {
        return IDe(e) ? t.apply(void 0, Sp([], vp(e))) : t(e);
    }
    function PDe(t) {
        return ve(function(e) {
            return ADe(t, e);
        });
    }
    var ODe = Array.isArray, MDe = Object.getPrototypeOf, RDe = Object.prototype, NDe = Object.keys;
    function VDe(t) {
        if (t.length === 1) {
            var e = t[0];
            if (ODe(e)) return {
                args: e,
                keys: null
            };
            if (DDe(e)) {
                var n = NDe(e);
                return {
                    args: n.map(function(r) {
                        return e[r];
                    }),
                    keys: n
                };
            }
        }
        return {
            args: t,
            keys: null
        };
    }
    function DDe(t) {
        return t && typeof t == "object" && MDe(t) === RDe;
    }
    function BDe(t, e) {
        return t.reduce(function(n, r, s) {
            return n[r] = e[s], n;
        }, {});
    }
    function et() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = L3(t), r = hDe(t), s = VDe(t), i = s.args, o = s.keys;
        if (i.length === 0) return Tc([], n);
        var a = new us(FDe(i, n, o ? function(c) {
            return BDe(o, c);
        } : Wp));
        return r ? a.pipe(PDe(r)) : a;
    }
    function FDe(t, e, n) {
        return n === void 0 && (n = Wp), function(r) {
            IV(e, function() {
                for(var s = t.length, i = new Array(s), o = s, a = s, c = function(u) {
                    IV(e, function() {
                        var d = Tc(t[u], e), f = !1;
                        d.subscribe(Gs(r, function(p) {
                            i[u] = p, f || (f = !0, a--), a || r.next(n(i.slice()));
                        }, function() {
                            --o || r.complete();
                        }));
                    }, r);
                }, l = 0; l < s; l++)c(l);
            }, r);
        };
    }
    function IV(t, e, n) {
        t ? pd(n, t, e) : e();
    }
    function LDe(t, e, n, r, s, i, o, a) {
        var c = [], l = 0, u = 0, d = !1, f = function() {
            d && !c.length && !l && e.complete();
        }, p = function(m) {
            return l < r ? h(m) : c.push(m);
        }, h = function(m) {
            l++;
            var w = !1;
            Gc(n(m, u++)).subscribe(Gs(e, function(v) {
                e.next(v);
            }, function() {
                w = !0;
            }, void 0, function() {
                if (w) try {
                    l--;
                    for(var v = function() {
                        var k = c.shift();
                        o || h(k);
                    }; c.length && l < r;)v();
                    f();
                } catch (k) {
                    e.error(k);
                }
            }));
        };
        return t.subscribe(Gs(e, p, function() {
            d = !0, f();
        })), function() {};
    }
    function Uc(t, e, n) {
        return n === void 0 && (n = 1 / 0), Sr(e) ? Uc(function(r, s) {
            return ve(function(i, o) {
                return e(r, i, s, o);
            })(Gc(t(r, s)));
        }, n) : (typeof e == "number" && (n = e), Ds(function(r, s) {
            return LDe(r, s, t, n);
        }));
    }
    function zDe(t) {
        return Uc(Wp, t);
    }
    function UDe() {
        return zDe(1);
    }
    function AV() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        return UDe()(Tc(t, L3(t)));
    }
    function vu(t, e) {
        return Ds(function(n, r) {
            var s = 0;
            n.subscribe(Gs(r, function(i) {
                return t.call(e, i, s++) && r.next(i);
            }));
        });
    }
    function cu(t) {
        return Ds(function(e, n) {
            var r = null, s = !1, i;
            r = e.subscribe(Gs(n, void 0, void 0, function(o) {
                i = Gc(t(o, cu(t)(e))), r ? (r.unsubscribe(), r = null, i.subscribe(n)) : s = !0;
            })), s && (r.unsubscribe(), r = null, i.subscribe(n));
        });
    }
    function HDe(t, e, n, r, s) {
        return function(i, o) {
            var a = n, c = e, l = 0;
            i.subscribe(Gs(o, function(u) {
                var d = l++;
                c = a ? t(c, u, d) : (a = !0, u);
            }, (function() {
                a && o.next(c), o.complete();
            })));
        };
    }
    function jDe(t, e) {
        return Ds(HDe(t, e, arguments.length >= 2, !1, !0));
    }
    var qDe = function(t, e) {
        return t.push(e), t;
    };
    function z3() {
        return Ds(function(t, e) {
            jDe(qDe, [])(t).subscribe(e);
        });
    }
    function PV(t, e) {
        return Sr(e) ? Uc(t, e, 1) : Uc(t, 1);
    }
    function WDe(t) {
        return new us(function(e) {
            return t.subscribe(e);
        });
    }
    var KDe = {
        connector: function() {
            return new R1;
        }
    };
    function $De(t, e) {
        e === void 0 && (e = KDe);
        var n = e.connector;
        return Ds(function(r, s) {
            var i = n();
            Gc(t(WDe(i))).subscribe(s), s.add(r.subscribe(i));
        });
    }
    function XDe(t) {
        return Ds(function(e, n) {
            var r = !1;
            e.subscribe(Gs(n, function(s) {
                r = !0, n.next(s);
            }, function() {
                r || n.next(t), n.complete();
            }));
        });
    }
    function GDe(t) {
        return t <= 0 ? function() {
            return N1;
        } : Ds(function(e, n) {
            var r = 0;
            e.subscribe(Gs(n, function(s) {
                ++r <= t && (n.next(s), t <= r && n.complete());
            }));
        });
    }
    function ZDe(t, e) {
        return e === void 0 && (e = Wp), t = t ?? JDe, Ds(function(n, r) {
            var s, i = !0;
            n.subscribe(Gs(r, function(o) {
                var a = e(o);
                (i || !t(s, a)) && (i = !1, s = a, r.next(o));
            }));
        });
    }
    function JDe(t, e) {
        return t === e;
    }
    function YDe(t) {
        return t === void 0 && (t = QDe), Ds(function(e, n) {
            var r = !1;
            e.subscribe(Gs(n, function(s) {
                r = !0, n.next(s);
            }, function() {
                return r ? n.complete() : n.error(t());
            }));
        });
    }
    function QDe() {
        return new lA;
    }
    function OV(t, e) {
        var n = arguments.length >= 2;
        return function(r) {
            return r.pipe(Wp, GDe(1), n ? XDe(e) : YDe(function() {
                return new lA;
            }));
        };
    }
    function eBe(t, e) {
        var n = Sr(t) ? t : function() {
            return t;
        };
        return Sr(e) ? $De(e, {
            connector: n
        }) : function(r) {
            return new nDe(r, n);
        };
    }
    function OZ(t, e, n, r) {
        var s = Sr(n) ? n : void 0;
        return function(i) {
            return eBe(new gZ(t, e, r), s)(i);
        };
    }
    function tBe(t) {
        t === void 0 && (t = {});
        var e = t.connector, n = e === void 0 ? function() {
            return new R1;
        } : e, r = t.resetOnError, s = r === void 0 ? !0 : r, i = t.resetOnComplete, o = i === void 0 ? !0 : i, a = t.resetOnRefCountZero, c = a === void 0 ? !0 : a;
        return function(l) {
            var u, d, f, p = 0, h = !1, m = !1, w = function() {
                d?.unsubscribe(), d = void 0;
            }, v = function() {
                w(), u = f = void 0, h = m = !1;
            }, k = function() {
                var _ = u;
                v(), _?.unsubscribe();
            };
            return Ds(function(_, A) {
                p++, !m && !h && w();
                var P = f = f ?? n();
                A.add(function() {
                    p--, p === 0 && !m && !h && (d = aS(k, c));
                }), P.subscribe(A), !u && p > 0 && (u = new tg({
                    next: function(U) {
                        return P.next(U);
                    },
                    error: function(U) {
                        m = !0, w(), d = aS(v, s, U), P.error(U);
                    },
                    complete: function() {
                        h = !0, w(), d = aS(v, o), P.complete();
                    }
                }), Gc(_).subscribe(u));
            })(l);
        };
    }
    function aS(t, e) {
        for(var n = [], r = 2; r < arguments.length; r++)n[r - 2] = arguments[r];
        if (e === !0) {
            t();
            return;
        }
        if (e !== !1) {
            var s = new tg({
                next: function() {
                    s.unsubscribe(), t();
                }
            });
            return Gc(e.apply(void 0, Sp([], vp(n)))).subscribe(s);
        }
    }
    function U3(t, e, n) {
        var r, s, i, o, a = !1;
        return t && typeof t == "object" ? (r = t.bufferSize, o = r === void 0 ? 1 / 0 : r, s = t.windowTime, e = s === void 0 ? 1 / 0 : s, i = t.refCount, a = i === void 0 ? !1 : i, n = t.scheduler) : o = t ?? 1 / 0, tBe({
            connector: function() {
                return new gZ(o, e, n);
            },
            resetOnError: !0,
            resetOnComplete: !1,
            resetOnRefCountZero: a
        });
    }
    function V1() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = L3(t);
        return Ds(function(r, s) {
            (n ? AV(t, r, n) : AV(t, r)).subscribe(s);
        });
    }
    function it(t, e) {
        return Ds(function(n, r) {
            var s = null, i = 0, o = !1, a = function() {
                return o && !s && r.complete();
            };
            n.subscribe(Gs(r, function(c) {
                s?.unsubscribe();
                var l = 0, u = i++;
                Gc(t(c, u)).subscribe(s = Gs(r, function(d) {
                    return r.next(e ? e(c, d, u, l++) : d);
                }, function() {
                    s = null, a();
                }));
            }, function() {
                o = !0, a();
            }));
        });
    }
    function Nd(t, e, n) {
        var r = Sr(t) || e || n ? {
            next: t,
            error: e,
            complete: n
        } : t;
        return r ? Ds(function(s, i) {
            var o;
            (o = r.subscribe) === null || o === void 0 || o.call(r);
            var a = !0;
            s.subscribe(Gs(i, function(c) {
                var l;
                (l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
            }, function() {
                var c;
                a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
            }, function(c) {
                var l;
                a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), i.error(c);
            }, function() {
                var c, l;
                a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
            }));
        }) : Wp;
    }
    const MZ = (t)=>new us((e)=>{
            const n = Q2(tI(or(function*() {
                const r = yield* bNe(t);
                for(; !(yield* v1(r, {
                    onSuccess (i) {
                        return Yxe(i, (o)=>{
                            e.next(o);
                        }), e.closed;
                    },
                    onFailure (i) {
                        return dn(i, {
                            onNone () {
                                return e.complete(), !0;
                            },
                            onSome: (o)=>(e.error(o), !0)
                        });
                    }
                })););
            })));
            e.add(()=>Q2(Rc(n)));
        }), RZ = (t, e)=>(n)=>{
            const r = {};
            for (const s of n)for(const i in s)Object.hasOwn(r, i) ? r[i] = e(r[i], s[i]) : r[i] = e(t, s[i]);
            return r;
        }, NZ = Ni((t)=>typeof t == "bigint").annotations({
        identifier: "BigIntSchema"
    }), ky = Oo(en, NZ, {
        decode: (t)=>Io({
                try: ()=>BigInt(t),
                catch: (e)=>new Ao(e, "Could not parse bigint")
            }),
        encode: (t)=>Zt(t.toString())
    });
    class km {
        static init(e) {
            return km.initEffect(e).pipe(Cn);
        }
        static restore(e, n, r) {
            return V(JG(e, n), Br, Y2((s)=>km.initEffect({
                    txTrait: n,
                    initialState: s,
                    configuration: r
                })), Cn);
        }
        static initEffect(e) {
            return or(function*() {
                const n = new uA(e.txTrait, e.initialState), r = yield* Y0();
                return new km(n, r, e.configuration);
            });
        }
        #e;
        #t;
        #n;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r;
        }
        addPendingTransaction(e) {
            return this.#e.addPendingTransaction(e).pipe(Cn);
        }
        clear(e) {
            return this.#e.clear(e).pipe(Cn);
        }
        start() {
            return this.#e.startPolling(gNe(yu(1))).pipe(Pd(eA({
                url: this.#n.indexerClientConnection.indexerHttpUrl
            })), Od(Ha, this.#t), Pd(EMe), Q2, ()=>Promise.resolve());
        }
        state() {
            return this.#e.state().pipe(MZ);
        }
        stop() {
            return V(Id(this.#t, po(void 0)), Cn);
        }
    }
    class uA {
        #e;
        #t;
        static restore(e, n) {
            return V(e, (r)=>JG(r, n), Br, wt((r)=>new uA(n, r)));
        }
        constructor(e, n){
            this.#t = e, this.#e = QI(n ?? ONe()).pipe(Xi);
        }
        state() {
            return sNe(ou(Xf(this.#e)), this.#e.changes);
        }
        startPolling(e) {
            return e.pipe($d(()=>Xf(this.#e)), N3(PNe), lNe((n)=>or(this, function*() {
                    const r = yield* jN, s = yield* this.queryForStatus(n.tx);
                    return dn(s, {
                        onSome: (i)=>[
                                {
                                    ...n,
                                    result: i
                                }
                            ],
                        onNone: ()=>{
                            const i = {
                                status: "FAILURE",
                                segments: []
                            };
                            return this.#t.hasTTLExpired(n.tx, n.creationTime, r) ? [
                                {
                                    ...n,
                                    result: i
                                }
                            ] : [];
                        }
                    });
                })), V3(V(E1(ls(1)), $Pe({
                min: .1,
                max: 1.2
            }), XPe(Yy(5)))), rNe((n)=>iNe(IN(n, "Caught error in PendingTransactionsService"))), fNe((n)=>this.saveResult(n.tx, n.result)));
        }
        addPendingTransaction(e) {
            return xp(this.#e, (n)=>jN.pipe(Y2((r)=>MNe(n, e, r, this.#t))));
        }
        clear(e) {
            return hV(this.#e, (n)=>RNe(n, e, this.#t));
        }
        saveResult(e, n) {
            switch(n.status){
                case "SUCCESS":
                    return this.clear(e);
                case "FAILURE":
                case "PARTIAL_SUCCESS":
                    return hV(this.#e, (r)=>NNe(r, e, n, this.#t));
            }
        }
        queryForStatus(e) {
            return or(this, function*() {
                const r = yield* (yield* OVe)({
                    transactionId: this.#t.firstId(e)
                }).pipe(Gg((s)=>{
                    const i = {
                        transactions: []
                    };
                    return V(IN(s, "Observed error in PendingTransactionsService, retrying"), La(i));
                }));
                return V(r.transactions, I_e((s)=>s.__typename == "SystemTransaction" || s.transactionResult.status != "SUCCESS" && s.transactionResult.status != "FAILURE" && s.transactionResult.status != "PARTIAL_SUCCESS" ? Fe() : this.#t.areAllTxIdsIncluded(e, s.identifiers) ? ze({
                        status: s.transactionResult.status,
                        segments: s.transactionResult.segments ?? []
                    }) : Fe()), C_e);
            });
        }
    }
    class nBe extends yv("@midnight-ntwrk/prover-client#ProverClient")() {
    }
    const VZ = (t, e)=>{
        class n extends h$ {
            _tag = e;
        }
        return n.prototype[t] = t, n.prototype.name = e, n;
    }, MV = Symbol.for("@effect/platform/Cookies"), RV = Symbol.for("@effect/platform/Cookies/Cookie"), rBe = {
        [MV]: MV,
        ...rv,
        toJSON () {
            return {
                _id: "@effect/platform/Cookies",
                cookies: R_e(this.cookies, (t)=>t.toJSON())
            };
        },
        pipe () {
            return St(this, arguments);
        }
    }, sBe = (t)=>{
        const e = Object.create(rBe);
        return e.cookies = t, e;
    }, iBe = (t)=>{
        const e = {};
        for (const n of t)e[n.name] = n;
        return sBe(e);
    }, oBe = (t)=>{
        const e = typeof t == "string" ? [
            t
        ] : t, n = [];
        for (const r of e){
            const s = aBe(r.trim());
            gr(s) && n.push(s.value);
        }
        return iBe(n);
    };
    function aBe(t) {
        const e = t.split(";").map((a)=>a.trim()).filter((a)=>a !== "");
        if (e.length === 0) return Fe();
        const n = e[0].indexOf("=");
        if (n === -1) return Fe();
        const r = e[0].slice(0, n);
        if (!cBe.test(r)) return Fe();
        const s = e[0].slice(n + 1), i = lBe(s);
        if (e.length === 1) return ze(Object.assign(Object.create(NV), {
            name: r,
            value: i,
            valueEncoded: s
        }));
        const o = {};
        for(let a = 1; a < e.length; a++){
            const c = e[a], l = c.indexOf("="), u = l === -1 ? c : c.slice(0, l).trim(), d = l === -1 ? void 0 : c.slice(l + 1).trim();
            switch(u.toLowerCase()){
                case "domain":
                    {
                        if (d === void 0) break;
                        const f = d.trim().replace(/^\./, "");
                        f && (o.domain = f);
                        break;
                    }
                case "expires":
                    {
                        if (d === void 0) break;
                        const f = new Date(d);
                        isNaN(f.getTime()) || (o.expires = f);
                        break;
                    }
                case "max-age":
                    {
                        if (d === void 0) break;
                        const f = parseInt(d, 10);
                        isNaN(f) || (o.maxAge = yu(f));
                        break;
                    }
                case "path":
                    {
                        if (d === void 0) break;
                        d[0] === "/" && (o.path = d);
                        break;
                    }
                case "priority":
                    {
                        if (d === void 0) break;
                        switch(d.toLowerCase()){
                            case "low":
                                o.priority = "low";
                                break;
                            case "medium":
                                o.priority = "medium";
                                break;
                            case "high":
                                o.priority = "high";
                                break;
                        }
                        break;
                    }
                case "httponly":
                    {
                        o.httpOnly = !0;
                        break;
                    }
                case "secure":
                    {
                        o.secure = !0;
                        break;
                    }
                case "partitioned":
                    {
                        o.partitioned = !0;
                        break;
                    }
                case "samesite":
                    {
                        if (d === void 0) break;
                        switch(d.toLowerCase()){
                            case "lax":
                                o.sameSite = "lax";
                                break;
                            case "strict":
                                o.sameSite = "strict";
                                break;
                            case "none":
                                o.sameSite = "none";
                                break;
                        }
                        break;
                    }
            }
        }
        return ze(Object.assign(Object.create(NV), {
            name: r,
            value: i,
            valueEncoded: s,
            options: Object.keys(o).length > 0 ? o : void 0
        }));
    }
    const cBe = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, NV = {
        [RV]: RV,
        ...rv,
        toJSON () {
            return {
                _id: "@effect/platform/Cookies/Cookie",
                name: this.name,
                value: this.value,
                options: this.options
            };
        }
    }, lBe = (t)=>{
        try {
            return decodeURIComponent(t);
        } catch  {
            return t;
        }
    }, VV = Symbol.for("@effect/platform/Headers"), Ty = Object.assign(Object.create(null), {
        [VV]: VV,
        [sv] (t) {
            return Dk(this, VW(t, BZ));
        }
    }), H3 = (t)=>Object.assign(Object.create(Ty), t), DZ = Object.create(Ty), dA = (t)=>{
        if (t === void 0) return DZ;
        if (Symbol.iterator in t) {
            const n = Object.create(Ty);
            for (const [r, s] of t)n[r.toLowerCase()] = s;
            return n;
        }
        const e = Object.create(Ty);
        for (const [n, r] of Object.entries(t))Array.isArray(r) ? e[n.toLowerCase()] = r.join(", ") : r !== void 0 && (e[n.toLowerCase()] = r);
        return e;
    }, uBe = (t)=>Object.setPrototypeOf(t, Ty), Vk = j(3, (t, e, n)=>{
        const r = H3(t);
        return r[e.toLowerCase()] = n, r;
    }), dBe = j(2, (t, e)=>H3({
            ...t,
            ...dA(e)
        })), fBe = j(2, (t, e)=>{
        const n = H3(t);
        return Object.assign(n, e), n;
    }), pBe = j(2, (t, e)=>{
        const n = H3(t), r = (s)=>{
            if (typeof s == "string") {
                const i = s.toLowerCase();
                i in t && delete n[i];
            } else for(const i in t)s.test(i) && delete n[i];
        };
        if (Array.isArray(e)) for(let s = 0; s < e.length; s++)r(e[s]);
        else r(e);
        return n;
    }), Dk = j(2, (t, e)=>{
        const n = {
            ...t
        }, r = (s)=>{
            if (typeof s == "string") {
                const i = s.toLowerCase();
                i in t && (n[i] = YN(t[i]));
            } else for(const i in t)s.test(i) && (n[i] = YN(t[i]));
        };
        if (Array.isArray(e)) for(let s = 0; s < e.length; s++)r(e[s]);
        else r(e);
        return n;
    }), BZ = Xt("@effect/platform/Headers/currentRedactedNames", ()=>oI([
            "authorization",
            "cookie",
            "set-cookie",
            "x-api-key"
        ])), hBe = Symbol.for("@effect/platform/HttpClientError"), FZ = hBe;
    class LZ extends VZ(FZ, "RequestError") {
        get methodAndUrl() {
            return `${this.request.method} ${this.request.url}`;
        }
        get message() {
            return this.description ? `${this.reason}: ${this.description} (${this.methodAndUrl})` : `${this.reason} error (${this.methodAndUrl})`;
        }
    }
    class of extends VZ(FZ, "ResponseError") {
        get methodAndUrl() {
            return `${this.request.method} ${this.request.url}`;
        }
        get message() {
            const e = `${this.response.status} ${this.methodAndUrl}`;
            return this.description ? `${this.reason}: ${this.description} (${e})` : `${this.reason} error (${e})`;
        }
    }
    const fA = (t)=>{
        const e = zZ(t), n = [];
        for(let r = 0; r < e.length; r++)if (Array.isArray(e[r][0])) {
            const [s, i] = e[r];
            n.push([
                `${s[0]}[${s.slice(1).join("][")}]`,
                i
            ]);
        } else n.push(e[r]);
        return n;
    }, zZ = (t)=>{
        const e = Symbol.iterator in t ? Un(t) : Object.entries(t), n = [];
        for (const [r, s] of e)if (Array.isArray(s)) for(let i = 0; i < s.length; i++)s[i] !== void 0 && n.push([
            r,
            String(s[i])
        ]);
        else if (typeof s == "object") {
            const i = zZ(s);
            for (const [o, a] of i)n.push([
                [
                    r,
                    ...typeof o == "string" ? [
                        o
                    ] : o
                ],
                a
            ]);
        } else s !== void 0 && n.push([
            r,
            String(s)
        ]);
        return n;
    }, gBe = [], bBe = j(2, (t, e)=>{
        const n = fA(e), r = new Set;
        for(let s = 0; s < n.length; s++)r.add(n[s][0]);
        for(let s = 0; s < t.length; s++)r.has(t[s][0]) || n.push(t[s]);
        return n;
    }), mBe = (t, e, n)=>{
        try {
            const r = new URL(t, yBe());
            for(let s = 0; s < e.length; s++){
                const [i, o] = e[s];
                o !== void 0 && r.searchParams.append(i, o);
            }
            return n._tag === "Some" && (r.hash = n.value), mt(r);
        } catch (r) {
            return st(r);
        }
    }, yBe = ()=>{
        if ("location" in globalThis && globalThis.location !== void 0 && globalThis.location.origin !== void 0 && globalThis.location.pathname !== void 0) return location.origin + location.pathname;
    }, Tm = Symbol.for("@effect/platform/HttpIncomingMessage"), wBe = (t, e)=>{
        const n = t.headers["content-type"] ?? "";
        let r;
        if (n.includes("application/json")) try {
            r = Xi(t.json);
        } catch  {}
        else if (n.includes("text/") || n.includes("urlencoded")) try {
            r = Xi(t.text);
        } catch  {}
        const s = {
            ...e,
            headers: tC(t.headers),
            remoteAddress: t.remoteAddress.toJSON()
        };
        return r !== void 0 && (s.body = r), s;
    }, _Be = (t)=>uBe({
            b3: `${t.traceId}-${t.spanId}-${t.sampled ? "1" : "0"}${t.parent._tag === "Some" ? `-${t.parent.value.spanId}` : ""}`,
            traceparent: `00-${t.traceId}-${t.spanId}-${t.sampled ? "01" : "00"}`
        }), cS = Symbol.for("@effect/platform/HttpBody");
    class UZ {
        [cS];
        constructor(){
            this[cS] = cS;
        }
        [Bn]() {
            return this.toJSON();
        }
        toString() {
            return Mr(this);
        }
    }
    class xBe extends UZ {
        _tag = "Empty";
        toJSON() {
            return {
                _id: "@effect/platform/HttpBody",
                _tag: "Empty"
            };
        }
    }
    const vBe = new xBe;
    class SBe extends UZ {
        body;
        contentType;
        _tag = "Uint8Array";
        constructor(e, n){
            super(), this.body = e, this.contentType = n;
        }
        get contentLength() {
            return this.body.length;
        }
        toJSON() {
            return {
                _id: "@effect/platform/HttpBody",
                _tag: "Uint8Array",
                body: this.contentType.startsWith("text/") || this.contentType.endsWith("json") ? new TextDecoder().decode(this.body) : `Uint8Array(${this.body.length})`,
                contentType: this.contentType,
                contentLength: this.contentLength
            };
        }
    }
    const kBe = (t, e)=>new SBe(t, e ?? "application/octet-stream"), Bk = Symbol.for("@effect/platform/HttpClientRequest"), TBe = {
        [Bk]: Bk,
        ...rv,
        toJSON () {
            return {
                _id: "@effect/platform/HttpClientRequest",
                method: this.method,
                url: this.url,
                urlParams: this.urlParams,
                hash: this.hash,
                headers: tC(this.headers),
                body: this.body.toJSON()
            };
        },
        pipe () {
            return St(this, arguments);
        }
    };
    function lu(t, e, n, r, s, i) {
        const o = Object.create(TBe);
        return o.method = t, o.url = e, o.urlParams = n, o.hash = r, o.headers = s, o.body = i, o;
    }
    const CBe = (t)=>typeof t == "object" && t !== null && Bk in t, EBe = lu("GET", "", gBe, Fe(), DZ, vBe), Kp = (t)=>(e, n)=>NBe(EBe, {
                method: t,
                url: e,
                ...n ?? void 0
            }), IBe = Kp("GET"), HZ = Kp("POST"), ABe = Kp("PUT"), PBe = Kp("PATCH"), OBe = Kp("DELETE"), MBe = Kp("HEAD"), RBe = Kp("OPTIONS"), NBe = j(2, (t, e)=>{
        let n = t;
        return e.method && (n = BBe(n, e.method)), e.url && (n = FBe(n, e.url)), e.headers && (n = jZ(n, e.headers)), e.urlParams && (n = LBe(n, e.urlParams)), e.hash && (n = zBe(n, e.hash)), e.body && (n = WZ(n, e.body)), e.accept && (n = qZ(n, e.accept)), e.acceptJson && (n = DBe(n)), n;
    }), VBe = j(3, (t, e, n)=>lu(t.method, t.url, t.urlParams, t.hash, Vk(t.headers, e, n), t.body)), jZ = j(2, (t, e)=>lu(t.method, t.url, t.urlParams, t.hash, dBe(t.headers, e), t.body)), qZ = j(2, (t, e)=>VBe(t, "Accept", e)), DBe = qZ("application/json"), BBe = j(2, (t, e)=>lu(e, t.url, t.urlParams, t.hash, t.headers, t.body)), FBe = j(2, (t, e)=>{
        if (typeof e == "string") return lu(t.method, e, t.urlParams, t.hash, t.headers, t.body);
        const n = new URL(e.toString()), r = fA(n.searchParams), s = n.hash ? ze(n.hash.slice(1)) : Fe();
        return n.search = "", n.hash = "", lu(t.method, n.toString(), r, s, t.headers, t.body);
    }), LBe = j(2, (t, e)=>lu(t.method, t.url, bBe(t.urlParams, e), t.hash, t.headers, t.body)), zBe = j(2, (t, e)=>lu(t.method, t.url, t.urlParams, ze(e), t.headers, t.body)), WZ = j(2, (t, e)=>{
        let n = t.headers;
        if (e._tag === "Empty" || e._tag === "FormData") n = pBe(n, [
            "Content-type",
            "Content-length"
        ]);
        else {
            const r = e.contentType;
            r && (n = Vk(n, "content-type", r));
            const s = e.contentLength;
            s && (n = Vk(n, "content-length", s.toString()));
        }
        return lu(t.method, t.url, t.urlParams, t.hash, n, e);
    }), UBe = j((t)=>CBe(t[0]), (t, e, n = "application/octet-stream")=>WZ(t, kBe(e, n))), Cm = Symbol.for("@effect/platform/HttpClientResponse"), HBe = (t, e)=>new jBe(t, e);
    class jBe extends Uwe {
        request;
        source;
        [Tm];
        [Cm];
        constructor(e, n){
            super(), this.request = e, this.source = n, this[Tm] = Tm, this[Cm] = Cm;
        }
        toJSON() {
            return wBe(this, {
                _id: "@effect/platform/HttpClientResponse",
                request: this.request.toJSON(),
                status: this.status
            });
        }
        get status() {
            return this.source.status;
        }
        get headers() {
            return dA(this.source.headers);
        }
        cachedCookies;
        get cookies() {
            return this.cachedCookies ? this.cachedCookies : this.cachedCookies = oBe(this.source.headers.getSetCookie());
        }
        get remoteAddress() {
            return Fe();
        }
        get stream() {
            return this.source.body ? cNe(()=>this.source.body, (e)=>new of({
                    request: this.request,
                    response: this,
                    reason: "Decode",
                    cause: e
                })) : xy(new of({
                request: this.request,
                response: this,
                reason: "EmptyBody",
                description: "can not create stream from empty body"
            }));
        }
        get json() {
            return JEe(this.text, {
                try: (e)=>e === "" ? null : JSON.parse(e),
                catch: (e)=>new of({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            });
        }
        textBody;
        get text() {
            return this.textBody ??= ud({
                try: ()=>this.source.text(),
                catch: (e)=>new of({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(L8, Xi);
        }
        get urlParamsBody() {
            return nt(this.text, (e)=>Io({
                    try: ()=>fA(new URLSearchParams(e)),
                    catch: (n)=>new of({
                            request: this.request,
                            response: this,
                            reason: "Decode",
                            cause: n
                        })
                }));
        }
        formDataBody;
        get formData() {
            return this.formDataBody ??= ud({
                try: ()=>this.source.formData(),
                catch: (e)=>new of({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(L8, Xi);
        }
        arrayBufferBody;
        get arrayBuffer() {
            return this.arrayBufferBody ??= ud({
                try: ()=>this.source.arrayBuffer(),
                catch: (e)=>new of({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(L8, Xi);
        }
    }
    const qBe = (t)=>`http.request.header.${t}`, WBe = "http.request.method", KBe = (t)=>`http.response.header.${t}`, $Be = "http.response.status_code", XBe = "server.address", GBe = "server.port", ZBe = "url.full", JBe = "url.path", YBe = "url.scheme", QBe = "url.query", DV = Symbol.for("@effect/platform/HttpClient"), KZ = Wc("@effect/platform/HttpClient"), eFe = Xt(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), ()=>oI(qm)), tFe = Xt(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), ()=>oI(!0)), nFe = Cg()("@effect/platform/HttpClient/SpanNameGenerator", {
        defaultValue: ()=>(t)=>`http.client ${t.method}`
    }), rFe = {
        [DV]: DV,
        pipe () {
            return St(this, arguments);
        },
        ...rv,
        toJSON () {
            return {
                _id: "@effect/platform/HttpClient"
            };
        },
        get (t, e) {
            return this.execute(IBe(t, e));
        },
        head (t, e) {
            return this.execute(MBe(t, e));
        },
        post (t, e) {
            return this.execute(HZ(t, e));
        },
        put (t, e) {
            return this.execute(ABe(t, e));
        },
        patch (t, e) {
            return this.execute(PBe(t, e));
        },
        del (t, e) {
            return this.execute(OBe(t, e));
        },
        options (t, e) {
            return this.execute(RBe(t, e));
        }
    }, $Z = (t, e)=>{
        const n = Object.create(rFe);
        return n.preprocess = e, n.postprocess = t, n.execute = function(r) {
            return t(e(r));
        }, n;
    }, px = Xt("@effect/platform/HttpClient/responseRegistry", ()=>{
        if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
            const e = new FinalizationRegistry((n)=>{
                n.abort();
            });
            return {
                register (n, r) {
                    e.register(n, r, n);
                },
                unregister (n) {
                    e.unregister(n);
                }
            };
        }
        const t = new Map;
        return {
            register (e, n) {
                t.set(e, setTimeout(()=>n.abort(), 5e3));
            },
            unregister (e) {
                const n = t.get(e);
                n !== void 0 && (clearTimeout(n), t.delete(e));
            }
        };
    }), sFe = Xt("@effect/platform/HttpClient/scopedRequests", ()=>new WeakMap), iFe = (t)=>$Z((e)=>nt(e, (n)=>gk((r)=>{
                    const s = sFe.get(n), i = s ?? new AbortController, o = mBe(n.url, n.urlParams, n.hash);
                    if (o._tag === "Left") return Ns(new LZ({
                        request: n,
                        reason: "InvalidUrl",
                        cause: o.left
                    }));
                    const a = o.right;
                    if (!r.getFiberRef(hIe) || r.getFiberRef(eFe)(n)) {
                        const u = t(n, a, i.signal, r);
                        return s ? u : hy((d)=>go(d(u), {
                                onSuccess (f) {
                                    return px.register(f, i), Zt(new BV(f, i));
                                },
                                onFailure (f) {
                                    return ay(f) && i.abort(), vo(f);
                                }
                            }));
                    }
                    const l = Pc(r.currentContext, nFe);
                    return dIe(l(n), {
                        kind: "client",
                        captureStackTrace: !1
                    }, (u)=>{
                        u.attribute(WBe, n.method), u.attribute(XBe, a.origin), a.port !== "" && u.attribute(GBe, +a.port), u.attribute(ZBe, a.toString()), u.attribute(JBe, a.pathname), u.attribute(YBe, a.protocol.slice(0, -1));
                        const d = a.search.slice(1);
                        d !== "" && u.attribute(QBe, d);
                        const f = r.getFiberRef(BZ), p = Dk(n.headers, f);
                        for(const h in p)u.attribute(qBe(h), String(p[h]));
                        return n = r.getFiberRef(tFe) ? jZ(n, _Be(u)) : n, hy((h)=>h(t(n, a, i.signal, r)).pipe(fIe(u), go({
                                onSuccess: (m)=>{
                                    u.attribute($Be, m.status);
                                    const w = Dk(m.headers, f);
                                    for(const v in w)u.attribute(KBe(v), String(w[v]));
                                    return s ? Zt(m) : (px.register(m, i), Zt(new BV(m, i)));
                                },
                                onFailure (m) {
                                    return !s && ay(m) && i.abort(), vo(m);
                                }
                            })));
                    });
                })), Zt);
    class BV {
        original;
        controller;
        constructor(e, n){
            this.original = e, this.controller = n;
        }
        [Cm] = Cm;
        [Tm] = Tm;
        applyInterrupt(e) {
            return wr(()=>(px.unregister(this.original), YEe(e, ()=>Kn(()=>{
                        this.controller.abort();
                    }))));
        }
        get request() {
            return this.original.request;
        }
        get status() {
            return this.original.status;
        }
        get headers() {
            return this.original.headers;
        }
        get cookies() {
            return this.original.cookies;
        }
        get remoteAddress() {
            return this.original.remoteAddress;
        }
        get formData() {
            return this.applyInterrupt(this.original.formData);
        }
        get text() {
            return this.applyInterrupt(this.original.text);
        }
        get json() {
            return this.applyInterrupt(this.original.json);
        }
        get urlParamsBody() {
            return this.applyInterrupt(this.original.urlParamsBody);
        }
        get arrayBuffer() {
            return this.applyInterrupt(this.original.arrayBuffer);
        }
        get stream() {
            return hNe(()=>(px.unregister(this.original), WG(this.original.stream, Kn(()=>{
                    this.controller.abort();
                }))));
        }
        toJSON() {
            return this.original.toJSON();
        }
        [Bn]() {
            return this.original[Bn]();
        }
    }
    const { del: z_t, execute: oFe, get: U_t, head: H_t, options: j_t, patch: q_t, post: W_t, put: K_t } = sIe(KZ), aFe = j(2, (t, e)=>{
        const n = t;
        return $Z((r)=>e(n.postprocess(r)), n.preprocess);
    }), cFe = (t)=>F$(KZ, nt(P$(), (e)=>wt(t, (n)=>aFe(n, rIe((r)=>Tg(e, r)))))), lFe = "@effect/platform/FetchHttpClient/Fetch", uFe = "@effect/platform/FetchHttpClient/FetchOptions", dFe = iFe((t, e, n, r)=>{
        const s = r.getFiberRef(pIe), i = s.unsafeMap.get(lFe) ?? globalThis.fetch, o = s.unsafeMap.get(uFe) ?? {}, a = o.headers ? fBe(dA(o.headers), t.headers) : t.headers, c = (l)=>wt(ud({
                try: ()=>i(e, {
                        ...o,
                        method: t.method,
                        headers: a,
                        body: l,
                        duplex: t.body._tag === "Stream" ? "half" : void 0,
                        signal: n
                    }),
                catch: (u)=>new LZ({
                        request: t,
                        reason: "Transport",
                        cause: u
                    })
            }), (u)=>HBe(t, u));
        switch(t.body._tag){
            case "Raw":
            case "Uint8Array":
                return c(t.body.body);
            case "FormData":
                return c(t.body.formData);
            case "Stream":
                return nt(mNe(t.body.stream), c);
        }
        return c(void 0);
    }), fFe = cFe(Zt(dFe)), pFe = fFe, hFe = oFe, gFe = HZ, bFe = UBe, mFe = "/prove", yFe = "/check", wFe = (t)=>V(iZ(new URL(t.url)), Qs((e)=>new _Fe(e)), Br, wt((e)=>nBe.of(e)));
    class _Fe {
        constructor(e){
            this.baseUrl = e;
        }
        baseUrl;
        request(e, n, r) {
            const s = (c)=>wl(()=>FVe(new Blob(c.map((l)=>new Uint8Array(l))))), i = (c)=>V(c.stream, dNe, nt((l)=>s(kC(l)))), o = sZ(new URL(e, this.baseUrl));
            return V(Zt(n), wt((c)=>gFe(o).pipe(bFe(c))), nt(hFe), nt((c)=>or(function*() {
                    if (c.status !== 200) {
                        const l = yield* c.text;
                        return yield* new ra({
                            message: `${r}: ${l}`
                        });
                    }
                    return yield* i(c);
                })), ZEe({
                times: 3,
                while: (c)=>c._tag === "ResponseError" && c.response.status >= 502 && c.response.status <= 504,
                schedule: E1(yu(2), 2)
            })).pipe($Ee({
                RequestError: (c)=>new ra({
                        message: `Failed to connect to Proof Server: ${c.message}`
                    }),
                ResponseError: (c)=>lIe(c.response.text, ()=>"Unknown server error").pipe(nt((l)=>new vy({
                            message: l
                        })))
            }), Pd(pFe));
        }
        serverProverProvider = ()=>({
                check: async (e, n)=>V(Zt(KT(e)), nt((r)=>this.request(yFe, r, "Failed to check")), wt((r)=>$T(r)), Cn),
                prove: async (e, n, r)=>V(Zt(XT(e, r)), nt((s)=>this.request(mFe, s, "Failed to prove")), Cn)
            });
        proveTransaction(e, n) {
            return V(Zt(this.serverProverProvider()), nt((r)=>ud({
                    try: ()=>e.prove(r, n),
                    catch: (s)=>s instanceof ra || s instanceof vy ? s : new ra({
                            message: "Failed to prove transaction",
                            cause: s
                        })
                })));
        }
        asProvingProvider() {
            return this.serverProverProvider();
        }
    }
    const xFe = typeof Worker < "u" ? Worker : void 0, vFe = (t)=>Zt(new RFe(t.keyMaterialProvider)), SFe = 600 * 1e3, kFe = tn({
        op: ri("check"),
        args: _y(fd)
    }), TFe = tn({
        op: ri("prove"),
        args: _y(fd, Rd(I3, E3))
    }), CFe = tn({
        op: ri("lookupKey"),
        keyLocation: en
    }), EFe = tn({
        op: ri("getParams"),
        k: Or
    }), IFe = tn({
        op: ri("result"),
        value: Rd(fd, Os(Rd(I3, E3)))
    }), AFe = tn({
        proverKey: fd,
        verifierKey: fd,
        ir: fd
    }), PFe = tn({
        op: ri("lookupKey"),
        keyLocation: en,
        result: $f(AFe)
    }), OFe = tn({
        op: ri("getParams"),
        k: Or,
        result: fd
    }), MFe = Rd(CFe, EFe, IFe), FV = ({ kmProvider: t, op: e, args: n })=>new Promise((r, s)=>{
            const i = self.location.href, o = new xFe(new URL("../../dist/proof-worker.js", i), {
                type: "module"
            });
            o.postMessage(e === "check" ? sd(kFe)({
                op: e,
                args: [
                    n[0]
                ]
            }) : sd(TFe)({
                op: e,
                args: [
                    n[0],
                    n[1]
                ]
            })), o.addEventListener("message", ({ data: a })=>{
                const c = jMe(MFe)(a), { op: l } = c;
                if (l === "lookupKey") {
                    const { keyLocation: u } = c;
                    t.lookupKey(u).then((d)=>{
                        o.postMessage(sd(PFe)({
                            op: l,
                            keyLocation: u,
                            result: d
                        }));
                    }).catch((d)=>{
                        o.terminate(), s(d);
                    });
                } else if (l === "getParams") {
                    const { k: u } = c;
                    t.getParams(u).then((d)=>{
                        o.postMessage(sd(OFe)({
                            op: l,
                            k: u,
                            result: d
                        }));
                    }).catch((d)=>{
                        o.terminate(), s(d);
                    });
                } else if (l === "result") {
                    const { value: u } = c;
                    o.terminate(), r(u);
                }
            }), o.addEventListener("error", (a)=>{
                o.terminate(), s(Error(a.message));
            }), setTimeout(()=>{
                o.terminate(), s(new Error(`${e} action timed out`));
            }, SFe);
        });
    class RFe {
        constructor(e){
            this.keyMaterialProvider = e;
        }
        keyMaterialProvider;
        wasmProverProvider = (e)=>({
                check: async (n, r)=>FV({
                        kmProvider: e ?? this.keyMaterialProvider,
                        op: "check",
                        args: [
                            n
                        ]
                    }),
                prove: async (n, r, s)=>FV({
                        kmProvider: e ?? this.keyMaterialProvider,
                        op: "prove",
                        args: [
                            n,
                            s
                        ]
                    })
            });
        proveTransaction(e, n, r) {
            return V(Zt(this.wasmProverProvider(r)), nt((s)=>ud({
                    try: ()=>e.prove(s, n),
                    catch: (i)=>i instanceof ra ? i : new ra({
                            message: "Failed to prove transaction",
                            cause: i
                        })
                })));
        }
        asProvingProvider() {
            return this.wasmProverProvider();
        }
    }
    const NFe = ()=>{
        const t = new Map, e = "https://midnight-s3-fileshare-dev-eu-west-1.s3.eu-west-1.amazonaws.com", n = 9, r = async (i, o = 5)=>{
            for(let a = 0; a < o; a++)try {
                return await fetch(i);
            } catch (c) {
                console.error("Failed to fetch at attempt", a + 1, i, c), await new Promise((l)=>setTimeout(l, 1e3 * Math.pow(2, a + 1)));
            }
            throw new Error(`Failed to fetch ${i} after ${o} attempts`);
        };
        return {
            lookupKey: async (i)=>{
                const o = {
                    "midnight/zswap/spend": `zswap/${n}/spend`,
                    "midnight/zswap/output": `zswap/${n}/output`,
                    "midnight/zswap/sign": `zswap/${n}/sign`,
                    "midnight/dust/spend": `dust/${n}/spend`
                }[i];
                if (o === void 0) return;
                if (t.has(o)) return t.get(o);
                const a = await r(`${e}/${o}.prover`), c = await r(`${e}/${o}.verifier`), l = await r(`${e}/${o}.bzkir`), u = {
                    proverKey: new Uint8Array(await a.arrayBuffer()),
                    verifierKey: new Uint8Array(await c.arrayBuffer()),
                    ir: new Uint8Array(await l.arrayBuffer())
                };
                return t.set(o, u), u;
            },
            getParams: async (i)=>{
                const o = `params-${i}`;
                if (t.has(o)) return t.get(o);
                const a = await r(`${e}/bls_midnight_2p${i}`), c = new Uint8Array(await a.arrayBuffer());
                return t.set(o, c), c;
            }
        };
    };
    class VFe extends wn("Wallet.Proving") {
    }
    const pA = (t)=>({
            prove: (e)=>Cn(t.prove(e))
        }), hA = (t)=>({
            prove (e) {
                return V(t, nt((n)=>ud({
                        try: ()=>e.prove(n, bd.initialCostModel()),
                        catch: (r)=>r instanceof ra || r instanceof vy ? r : new ra({
                                message: "Failed to prove transaction",
                                cause: r
                            })
                    })), Gg((n)=>Ns(new VFe({
                        message: n.message,
                        cause: n
                    }))));
            }
        }), DFe = (t)=>hA(Zt(t)), XZ = (t)=>V(wFe({
            url: t.provingServerUrl
        }), wt((e)=>e.asProvingProvider()), hA), BFe = (t)=>V(vFe({
            keyMaterialProvider: t?.keyMaterialProvider ?? NFe()
        }), wt((e)=>e.asProvingProvider()), hA), FFe = (t)=>XZ(t), LFe = (t)=>pA(FFe(t)), zFe = (t)=>pA(XZ(t)), UFe = (t)=>pA(BFe(t)), { Submitted: HFe, InBlock: jFe, Finalized: qFe, $match: $_t, $is: WFe } = $E();
    let KFe = class extends wn("SubmissionError") {
    };
    class LV extends wn("ConnectionError") {
    }
    class GZ extends wn("TransactionProgressError") {
    }
    class $Fe extends wn("ParseError") {
    }
    class XFe extends wn("TransactionUsurpedError") {
    }
    class GFe extends wn("TransactionDroppedError") {
    }
    class ZFe extends wn("TransactionInvalidError") {
    }
    class gA extends yv("@midnight-ntwrk/wallet-node-client#NodeClient")() {
    }
    const JFe = (t)=>gA.pipe(ou, zc((e)=>e.sendMidnightTransaction(t)));
    function YFe(t, e) {
        return JFe(t).pipe(aNe(WFe(e)), XG, nt(dn({
            onNone: ()=>Ns(new GZ({
                    message: "Transaction did not reach desired stage and no other error was reported",
                    txData: t,
                    desiredStage: e
                })),
            onSome: (n)=>Zt(n)
        })));
    }
    function QFe(t) {
        return t("return this");
    }
    const da = typeof globalThis < "u" || typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : QFe(Function);
    function bA(t, e) {
        return typeof da[t] > "u" ? e : da[t];
    }
    let eLe = class {
        __encoding;
        constructor(e){
            this.__encoding = e;
        }
        decode(e) {
            let n = "";
            for(let r = 0, s = e.length; r < s; r++)n += String.fromCharCode(e[r]);
            return n;
        }
    };
    const tLe = bA("TextDecoder", eLe);
    let nLe = class {
        encode(e) {
            const n = e.length, r = new Uint8Array(n);
            for(let s = 0; s < n; s++)r[s] = e.charCodeAt(s);
            return r;
        }
    };
    const rLe = bA("TextEncoder", nLe);
    function Mt(t) {
        return typeof t == "function";
    }
    function Fk(t, e) {
        const n = Math.ceil(t.length / e);
        if (n === 1) return [
            t
        ];
        const r = Array(n);
        for(let s = 0; s < n; s++){
            const i = s * e;
            r[s] = t.slice(i, i + e);
        }
        return r;
    }
    function Qh(t) {
        const e = t.length;
        if (e === 0) return [];
        if (e === 1) return t[0];
        let n = 0;
        for(let i = 0; i < e; i++)n += t[i].length;
        const r = new Array(n);
        let s = -1;
        for(let i = 0; i < e; i++){
            const o = t[i];
            for(let a = 0, c = o.length; a < c; a++)r[++s] = o[a];
        }
        return r;
    }
    function sLe(t, e) {
        if (!t) throw new Error(Mt(e) ? e() : e);
    }
    function Zu(t, e) {
        return sLe(t != null, e), t;
    }
    function iLe(t) {
        throw new Error(`This codepath should be unreachable. Unhandled input: ${t}`);
    }
    function ZZ(t) {
        return (...e)=>{
            const n = e.length;
            if (n === 0) throw new Error("Must provide one or more arguments");
            let r = e[0];
            for(let s = 1; s < n; s++)t(e[s], r) && (r = e[s]);
            return r;
        };
    }
    function oLe() {
        return Number.NaN;
    }
    const cr = bA("BigInt", oLe), aLe = cr(0), cLe = cr(1), lS = "0123456789abcdef", hx = new Uint8Array(256), JZ = new Uint8Array(256 * 256);
    for(let t = 0, e = lS.length; t < e; t++)hx[lS[t].charCodeAt(0) | 0] = t | 0, t > 9 && (hx[lS[t].toUpperCase().charCodeAt(0) | 0] = t | 0);
    for(let t = 0; t < 256; t++){
        const e = t << 8;
        for(let n = 0; n < 256; n++)JZ[e | n] = hx[t] << 4 | hx[n];
    }
    function Hc(t, e = -1) {
        if (!t) return new Uint8Array;
        let n = t.startsWith("0x") ? 2 : 0;
        const r = Math.ceil((t.length - n) / 2), s = Math.ceil(e === -1 ? r : e / 8), i = new Uint8Array(s), o = s > r ? s - r : 0;
        for(let a = o; a < s; a++, n += 2)i[a] = JZ[t.charCodeAt(n) << 8 | t.charCodeAt(n + 1)];
        return i;
    }
    var U_ = {
        exports: {}
    }, lLe = U_.exports, zV;
    function uLe() {
        return zV || (zV = 1, (function(t) {
            (function(e, n) {
                function r(M, g) {
                    if (!M) throw new Error(g || "Assertion failed");
                }
                function s(M, g) {
                    M.super_ = g;
                    var y = function() {};
                    y.prototype = g.prototype, M.prototype = new y, M.prototype.constructor = M;
                }
                function i(M, g, y) {
                    if (i.isBN(M)) return M;
                    this.negative = 0, this.words = null, this.length = 0, this.red = null, M !== null && ((g === "le" || g === "be") && (y = g, g = 10), this._init(M || 0, g || 10, y || "be"));
                }
                typeof e == "object" ? e.exports = i : n.BN = i, i.BN = i, i.wordSize = 26;
                var o;
                try {
                    typeof window < "u" && typeof window.Buffer < "u" ? o = window.Buffer : o = yU().Buffer;
                } catch  {}
                i.isBN = function(g) {
                    return g instanceof i ? !0 : g !== null && typeof g == "object" && g.constructor.wordSize === i.wordSize && Array.isArray(g.words);
                }, i.max = function(g, y) {
                    return g.cmp(y) > 0 ? g : y;
                }, i.min = function(g, y) {
                    return g.cmp(y) < 0 ? g : y;
                }, i.prototype._init = function(g, y, C) {
                    if (typeof g == "number") return this._initNumber(g, y, C);
                    if (typeof g == "object") return this._initArray(g, y, C);
                    y === "hex" && (y = 16), r(y === (y | 0) && y >= 2 && y <= 36), g = g.toString().replace(/\s+/g, "");
                    var R = 0;
                    g[0] === "-" && (R++, this.negative = 1), R < g.length && (y === 16 ? this._parseHex(g, R, C) : (this._parseBase(g, y, R), C === "le" && this._initArray(this.toArray(), y, C)));
                }, i.prototype._initNumber = function(g, y, C) {
                    g < 0 && (this.negative = 1, g = -g), g < 67108864 ? (this.words = [
                        g & 67108863
                    ], this.length = 1) : g < 4503599627370496 ? (this.words = [
                        g & 67108863,
                        g / 67108864 & 67108863
                    ], this.length = 2) : (r(g < 9007199254740992), this.words = [
                        g & 67108863,
                        g / 67108864 & 67108863,
                        1
                    ], this.length = 3), C === "le" && this._initArray(this.toArray(), y, C);
                }, i.prototype._initArray = function(g, y, C) {
                    if (r(typeof g.length == "number"), g.length <= 0) return this.words = [
                        0
                    ], this.length = 1, this;
                    this.length = Math.ceil(g.length / 3), this.words = new Array(this.length);
                    for(var R = 0; R < this.length; R++)this.words[R] = 0;
                    var N, L, z = 0;
                    if (C === "be") for(R = g.length - 1, N = 0; R >= 0; R -= 3)L = g[R] | g[R - 1] << 8 | g[R - 2] << 16, this.words[N] |= L << z & 67108863, this.words[N + 1] = L >>> 26 - z & 67108863, z += 24, z >= 26 && (z -= 26, N++);
                    else if (C === "le") for(R = 0, N = 0; R < g.length; R += 3)L = g[R] | g[R + 1] << 8 | g[R + 2] << 16, this.words[N] |= L << z & 67108863, this.words[N + 1] = L >>> 26 - z & 67108863, z += 24, z >= 26 && (z -= 26, N++);
                    return this._strip();
                };
                function a(M, g) {
                    var y = M.charCodeAt(g);
                    if (y >= 48 && y <= 57) return y - 48;
                    if (y >= 65 && y <= 70) return y - 55;
                    if (y >= 97 && y <= 102) return y - 87;
                    r(!1, "Invalid character in " + M);
                }
                function c(M, g, y) {
                    var C = a(M, y);
                    return y - 1 >= g && (C |= a(M, y - 1) << 4), C;
                }
                i.prototype._parseHex = function(g, y, C) {
                    this.length = Math.ceil((g.length - y) / 6), this.words = new Array(this.length);
                    for(var R = 0; R < this.length; R++)this.words[R] = 0;
                    var N = 0, L = 0, z;
                    if (C === "be") for(R = g.length - 1; R >= y; R -= 2)z = c(g, y, R) << N, this.words[L] |= z & 67108863, N >= 18 ? (N -= 18, L += 1, this.words[L] |= z >>> 26) : N += 8;
                    else {
                        var B = g.length - y;
                        for(R = B % 2 === 0 ? y + 1 : y; R < g.length; R += 2)z = c(g, y, R) << N, this.words[L] |= z & 67108863, N >= 18 ? (N -= 18, L += 1, this.words[L] |= z >>> 26) : N += 8;
                    }
                    this._strip();
                };
                function l(M, g, y, C) {
                    for(var R = 0, N = 0, L = Math.min(M.length, y), z = g; z < L; z++){
                        var B = M.charCodeAt(z) - 48;
                        R *= C, B >= 49 ? N = B - 49 + 10 : B >= 17 ? N = B - 17 + 10 : N = B, r(B >= 0 && N < C, "Invalid character"), R += N;
                    }
                    return R;
                }
                i.prototype._parseBase = function(g, y, C) {
                    this.words = [
                        0
                    ], this.length = 1;
                    for(var R = 0, N = 1; N <= 67108863; N *= y)R++;
                    R--, N = N / y | 0;
                    for(var L = g.length - C, z = L % R, B = Math.min(L, L - z) + C, x = 0, O = C; O < B; O += R)x = l(g, O, O + R, y), this.imuln(N), this.words[0] + x < 67108864 ? this.words[0] += x : this._iaddn(x);
                    if (z !== 0) {
                        var q = 1;
                        for(x = l(g, O, g.length, y), O = 0; O < z; O++)q *= y;
                        this.imuln(q), this.words[0] + x < 67108864 ? this.words[0] += x : this._iaddn(x);
                    }
                    this._strip();
                }, i.prototype.copy = function(g) {
                    g.words = new Array(this.length);
                    for(var y = 0; y < this.length; y++)g.words[y] = this.words[y];
                    g.length = this.length, g.negative = this.negative, g.red = this.red;
                };
                function u(M, g) {
                    M.words = g.words, M.length = g.length, M.negative = g.negative, M.red = g.red;
                }
                if (i.prototype._move = function(g) {
                    u(g, this);
                }, i.prototype.clone = function() {
                    var g = new i(null);
                    return this.copy(g), g;
                }, i.prototype._expand = function(g) {
                    for(; this.length < g;)this.words[this.length++] = 0;
                    return this;
                }, i.prototype._strip = function() {
                    for(; this.length > 1 && this.words[this.length - 1] === 0;)this.length--;
                    return this._normSign();
                }, i.prototype._normSign = function() {
                    return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this;
                }, typeof Symbol < "u" && typeof Symbol.for == "function") try {
                    i.prototype[Symbol.for("nodejs.util.inspect.custom")] = d;
                } catch  {
                    i.prototype.inspect = d;
                }
                else i.prototype.inspect = d;
                function d() {
                    return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
                }
                var f = [
                    "",
                    "0",
                    "00",
                    "000",
                    "0000",
                    "00000",
                    "000000",
                    "0000000",
                    "00000000",
                    "000000000",
                    "0000000000",
                    "00000000000",
                    "000000000000",
                    "0000000000000",
                    "00000000000000",
                    "000000000000000",
                    "0000000000000000",
                    "00000000000000000",
                    "000000000000000000",
                    "0000000000000000000",
                    "00000000000000000000",
                    "000000000000000000000",
                    "0000000000000000000000",
                    "00000000000000000000000",
                    "000000000000000000000000",
                    "0000000000000000000000000"
                ], p = [
                    0,
                    0,
                    25,
                    16,
                    12,
                    11,
                    10,
                    9,
                    8,
                    8,
                    7,
                    7,
                    7,
                    7,
                    6,
                    6,
                    6,
                    6,
                    6,
                    6,
                    6,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5
                ], h = [
                    0,
                    0,
                    33554432,
                    43046721,
                    16777216,
                    48828125,
                    60466176,
                    40353607,
                    16777216,
                    43046721,
                    1e7,
                    19487171,
                    35831808,
                    62748517,
                    7529536,
                    11390625,
                    16777216,
                    24137569,
                    34012224,
                    47045881,
                    64e6,
                    4084101,
                    5153632,
                    6436343,
                    7962624,
                    9765625,
                    11881376,
                    14348907,
                    17210368,
                    20511149,
                    243e5,
                    28629151,
                    33554432,
                    39135393,
                    45435424,
                    52521875,
                    60466176
                ];
                i.prototype.toString = function(g, y) {
                    g = g || 10, y = y | 0 || 1;
                    var C;
                    if (g === 16 || g === "hex") {
                        C = "";
                        for(var R = 0, N = 0, L = 0; L < this.length; L++){
                            var z = this.words[L], B = ((z << R | N) & 16777215).toString(16);
                            N = z >>> 24 - R & 16777215, R += 2, R >= 26 && (R -= 26, L--), N !== 0 || L !== this.length - 1 ? C = f[6 - B.length] + B + C : C = B + C;
                        }
                        for(N !== 0 && (C = N.toString(16) + C); C.length % y !== 0;)C = "0" + C;
                        return this.negative !== 0 && (C = "-" + C), C;
                    }
                    if (g === (g | 0) && g >= 2 && g <= 36) {
                        var x = p[g], O = h[g];
                        C = "";
                        var q = this.clone();
                        for(q.negative = 0; !q.isZero();){
                            var H = q.modrn(O).toString(g);
                            q = q.idivn(O), q.isZero() ? C = H + C : C = f[x - H.length] + H + C;
                        }
                        for(this.isZero() && (C = "0" + C); C.length % y !== 0;)C = "0" + C;
                        return this.negative !== 0 && (C = "-" + C), C;
                    }
                    r(!1, "Base should be between 2 and 36");
                }, i.prototype.toNumber = function() {
                    var g = this.words[0];
                    return this.length === 2 ? g += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? g += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && r(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -g : g;
                }, i.prototype.toJSON = function() {
                    return this.toString(16, 2);
                }, o && (i.prototype.toBuffer = function(g, y) {
                    return this.toArrayLike(o, g, y);
                }), i.prototype.toArray = function(g, y) {
                    return this.toArrayLike(Array, g, y);
                };
                var m = function(g, y) {
                    return g.allocUnsafe ? g.allocUnsafe(y) : new g(y);
                };
                i.prototype.toArrayLike = function(g, y, C) {
                    this._strip();
                    var R = this.byteLength(), N = C || Math.max(1, R);
                    r(R <= N, "byte array longer than desired length"), r(N > 0, "Requested array length <= 0");
                    var L = m(g, N), z = y === "le" ? "LE" : "BE";
                    return this["_toArrayLike" + z](L, R), L;
                }, i.prototype._toArrayLikeLE = function(g, y) {
                    for(var C = 0, R = 0, N = 0, L = 0; N < this.length; N++){
                        var z = this.words[N] << L | R;
                        g[C++] = z & 255, C < g.length && (g[C++] = z >> 8 & 255), C < g.length && (g[C++] = z >> 16 & 255), L === 6 ? (C < g.length && (g[C++] = z >> 24 & 255), R = 0, L = 0) : (R = z >>> 24, L += 2);
                    }
                    if (C < g.length) for(g[C++] = R; C < g.length;)g[C++] = 0;
                }, i.prototype._toArrayLikeBE = function(g, y) {
                    for(var C = g.length - 1, R = 0, N = 0, L = 0; N < this.length; N++){
                        var z = this.words[N] << L | R;
                        g[C--] = z & 255, C >= 0 && (g[C--] = z >> 8 & 255), C >= 0 && (g[C--] = z >> 16 & 255), L === 6 ? (C >= 0 && (g[C--] = z >> 24 & 255), R = 0, L = 0) : (R = z >>> 24, L += 2);
                    }
                    if (C >= 0) for(g[C--] = R; C >= 0;)g[C--] = 0;
                }, Math.clz32 ? i.prototype._countBits = function(g) {
                    return 32 - Math.clz32(g);
                } : i.prototype._countBits = function(g) {
                    var y = g, C = 0;
                    return y >= 4096 && (C += 13, y >>>= 13), y >= 64 && (C += 7, y >>>= 7), y >= 8 && (C += 4, y >>>= 4), y >= 2 && (C += 2, y >>>= 2), C + y;
                }, i.prototype._zeroBits = function(g) {
                    if (g === 0) return 26;
                    var y = g, C = 0;
                    return (y & 8191) === 0 && (C += 13, y >>>= 13), (y & 127) === 0 && (C += 7, y >>>= 7), (y & 15) === 0 && (C += 4, y >>>= 4), (y & 3) === 0 && (C += 2, y >>>= 2), (y & 1) === 0 && C++, C;
                }, i.prototype.bitLength = function() {
                    var g = this.words[this.length - 1], y = this._countBits(g);
                    return (this.length - 1) * 26 + y;
                };
                function w(M) {
                    for(var g = new Array(M.bitLength()), y = 0; y < g.length; y++){
                        var C = y / 26 | 0, R = y % 26;
                        g[y] = M.words[C] >>> R & 1;
                    }
                    return g;
                }
                i.prototype.zeroBits = function() {
                    if (this.isZero()) return 0;
                    for(var g = 0, y = 0; y < this.length; y++){
                        var C = this._zeroBits(this.words[y]);
                        if (g += C, C !== 26) break;
                    }
                    return g;
                }, i.prototype.byteLength = function() {
                    return Math.ceil(this.bitLength() / 8);
                }, i.prototype.toTwos = function(g) {
                    return this.negative !== 0 ? this.abs().inotn(g).iaddn(1) : this.clone();
                }, i.prototype.fromTwos = function(g) {
                    return this.testn(g - 1) ? this.notn(g).iaddn(1).ineg() : this.clone();
                }, i.prototype.isNeg = function() {
                    return this.negative !== 0;
                }, i.prototype.neg = function() {
                    return this.clone().ineg();
                }, i.prototype.ineg = function() {
                    return this.isZero() || (this.negative ^= 1), this;
                }, i.prototype.iuor = function(g) {
                    for(; this.length < g.length;)this.words[this.length++] = 0;
                    for(var y = 0; y < g.length; y++)this.words[y] = this.words[y] | g.words[y];
                    return this._strip();
                }, i.prototype.ior = function(g) {
                    return r((this.negative | g.negative) === 0), this.iuor(g);
                }, i.prototype.or = function(g) {
                    return this.length > g.length ? this.clone().ior(g) : g.clone().ior(this);
                }, i.prototype.uor = function(g) {
                    return this.length > g.length ? this.clone().iuor(g) : g.clone().iuor(this);
                }, i.prototype.iuand = function(g) {
                    var y;
                    this.length > g.length ? y = g : y = this;
                    for(var C = 0; C < y.length; C++)this.words[C] = this.words[C] & g.words[C];
                    return this.length = y.length, this._strip();
                }, i.prototype.iand = function(g) {
                    return r((this.negative | g.negative) === 0), this.iuand(g);
                }, i.prototype.and = function(g) {
                    return this.length > g.length ? this.clone().iand(g) : g.clone().iand(this);
                }, i.prototype.uand = function(g) {
                    return this.length > g.length ? this.clone().iuand(g) : g.clone().iuand(this);
                }, i.prototype.iuxor = function(g) {
                    var y, C;
                    this.length > g.length ? (y = this, C = g) : (y = g, C = this);
                    for(var R = 0; R < C.length; R++)this.words[R] = y.words[R] ^ C.words[R];
                    if (this !== y) for(; R < y.length; R++)this.words[R] = y.words[R];
                    return this.length = y.length, this._strip();
                }, i.prototype.ixor = function(g) {
                    return r((this.negative | g.negative) === 0), this.iuxor(g);
                }, i.prototype.xor = function(g) {
                    return this.length > g.length ? this.clone().ixor(g) : g.clone().ixor(this);
                }, i.prototype.uxor = function(g) {
                    return this.length > g.length ? this.clone().iuxor(g) : g.clone().iuxor(this);
                }, i.prototype.inotn = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var y = Math.ceil(g / 26) | 0, C = g % 26;
                    this._expand(y), C > 0 && y--;
                    for(var R = 0; R < y; R++)this.words[R] = ~this.words[R] & 67108863;
                    return C > 0 && (this.words[R] = ~this.words[R] & 67108863 >> 26 - C), this._strip();
                }, i.prototype.notn = function(g) {
                    return this.clone().inotn(g);
                }, i.prototype.setn = function(g, y) {
                    r(typeof g == "number" && g >= 0);
                    var C = g / 26 | 0, R = g % 26;
                    return this._expand(C + 1), y ? this.words[C] = this.words[C] | 1 << R : this.words[C] = this.words[C] & ~(1 << R), this._strip();
                }, i.prototype.iadd = function(g) {
                    var y;
                    if (this.negative !== 0 && g.negative === 0) return this.negative = 0, y = this.isub(g), this.negative ^= 1, this._normSign();
                    if (this.negative === 0 && g.negative !== 0) return g.negative = 0, y = this.isub(g), g.negative = 1, y._normSign();
                    var C, R;
                    this.length > g.length ? (C = this, R = g) : (C = g, R = this);
                    for(var N = 0, L = 0; L < R.length; L++)y = (C.words[L] | 0) + (R.words[L] | 0) + N, this.words[L] = y & 67108863, N = y >>> 26;
                    for(; N !== 0 && L < C.length; L++)y = (C.words[L] | 0) + N, this.words[L] = y & 67108863, N = y >>> 26;
                    if (this.length = C.length, N !== 0) this.words[this.length] = N, this.length++;
                    else if (C !== this) for(; L < C.length; L++)this.words[L] = C.words[L];
                    return this;
                }, i.prototype.add = function(g) {
                    var y;
                    return g.negative !== 0 && this.negative === 0 ? (g.negative = 0, y = this.sub(g), g.negative ^= 1, y) : g.negative === 0 && this.negative !== 0 ? (this.negative = 0, y = g.sub(this), this.negative = 1, y) : this.length > g.length ? this.clone().iadd(g) : g.clone().iadd(this);
                }, i.prototype.isub = function(g) {
                    if (g.negative !== 0) {
                        g.negative = 0;
                        var y = this.iadd(g);
                        return g.negative = 1, y._normSign();
                    } else if (this.negative !== 0) return this.negative = 0, this.iadd(g), this.negative = 1, this._normSign();
                    var C = this.cmp(g);
                    if (C === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
                    var R, N;
                    C > 0 ? (R = this, N = g) : (R = g, N = this);
                    for(var L = 0, z = 0; z < N.length; z++)y = (R.words[z] | 0) - (N.words[z] | 0) + L, L = y >> 26, this.words[z] = y & 67108863;
                    for(; L !== 0 && z < R.length; z++)y = (R.words[z] | 0) + L, L = y >> 26, this.words[z] = y & 67108863;
                    if (L === 0 && z < R.length && R !== this) for(; z < R.length; z++)this.words[z] = R.words[z];
                    return this.length = Math.max(this.length, z), R !== this && (this.negative = 1), this._strip();
                }, i.prototype.sub = function(g) {
                    return this.clone().isub(g);
                };
                function v(M, g, y) {
                    y.negative = g.negative ^ M.negative;
                    var C = M.length + g.length | 0;
                    y.length = C, C = C - 1 | 0;
                    var R = M.words[0] | 0, N = g.words[0] | 0, L = R * N, z = L & 67108863, B = L / 67108864 | 0;
                    y.words[0] = z;
                    for(var x = 1; x < C; x++){
                        for(var O = B >>> 26, q = B & 67108863, H = Math.min(x, g.length - 1), Z = Math.max(0, x - M.length + 1); Z <= H; Z++){
                            var te = x - Z | 0;
                            R = M.words[te] | 0, N = g.words[Z] | 0, L = R * N + q, O += L / 67108864 | 0, q = L & 67108863;
                        }
                        y.words[x] = q | 0, B = O | 0;
                    }
                    return B !== 0 ? y.words[x] = B | 0 : y.length--, y._strip();
                }
                var k = function(g, y, C) {
                    var R = g.words, N = y.words, L = C.words, z = 0, B, x, O, q = R[0] | 0, H = q & 8191, Z = q >>> 13, te = R[1] | 0, J = te & 8191, se = te >>> 13, fe = R[2] | 0, ge = fe & 8191, Ce = fe >>> 13, Ue = R[3] | 0, Ie = Ue & 8191, Le = Ue >>> 13, Ge = R[4] | 0, Ve = Ge & 8191, Ne = Ge >>> 13, be = R[5] | 0, Qe = be & 8191, le = be >>> 13, De = R[6] | 0, Re = De & 8191, ee = De >>> 13, oe = R[7] | 0, ye = oe & 8191, D = oe >>> 13, S = R[8] | 0, E = S & 8191, $ = S >>> 13, re = R[9] | 0, ae = re & 8191, me = re >>> 13, Oe = N[0] | 0, ut = Oe & 8191, dt = Oe >>> 13, Ut = N[1] | 0, at = Ut & 8191, Qt = Ut >>> 13, ci = N[2] | 0, Sn = ci & 8191, Hn = ci >>> 13, Qc = N[3] | 0, jn = Qc & 8191, An = Qc >>> 13, ya = N[4] | 0, ar = ya & 8191, Ln = ya >>> 13, el = N[5] | 0, Gn = el & 8191, _e = el >>> 13, an = N[6] | 0, kt = an & 8191, je = an >>> 13, Lt = N[7] | 0, pn = Lt & 8191, hn = Lt >>> 13, nr = N[8] | 0, gn = nr & 8191, Wt = nr >>> 13, li = N[9] | 0, rn = li & 8191, Pn = li >>> 13;
                    C.negative = g.negative ^ y.negative, C.length = 19, B = Math.imul(H, ut), x = Math.imul(H, dt), x = x + Math.imul(Z, ut) | 0, O = Math.imul(Z, dt);
                    var Qa = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Qa >>> 26) | 0, Qa &= 67108863, B = Math.imul(J, ut), x = Math.imul(J, dt), x = x + Math.imul(se, ut) | 0, O = Math.imul(se, dt), B = B + Math.imul(H, at) | 0, x = x + Math.imul(H, Qt) | 0, x = x + Math.imul(Z, at) | 0, O = O + Math.imul(Z, Qt) | 0;
                    var ec = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (ec >>> 26) | 0, ec &= 67108863, B = Math.imul(ge, ut), x = Math.imul(ge, dt), x = x + Math.imul(Ce, ut) | 0, O = Math.imul(Ce, dt), B = B + Math.imul(J, at) | 0, x = x + Math.imul(J, Qt) | 0, x = x + Math.imul(se, at) | 0, O = O + Math.imul(se, Qt) | 0, B = B + Math.imul(H, Sn) | 0, x = x + Math.imul(H, Hn) | 0, x = x + Math.imul(Z, Sn) | 0, O = O + Math.imul(Z, Hn) | 0;
                    var tl = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (tl >>> 26) | 0, tl &= 67108863, B = Math.imul(Ie, ut), x = Math.imul(Ie, dt), x = x + Math.imul(Le, ut) | 0, O = Math.imul(Le, dt), B = B + Math.imul(ge, at) | 0, x = x + Math.imul(ge, Qt) | 0, x = x + Math.imul(Ce, at) | 0, O = O + Math.imul(Ce, Qt) | 0, B = B + Math.imul(J, Sn) | 0, x = x + Math.imul(J, Hn) | 0, x = x + Math.imul(se, Sn) | 0, O = O + Math.imul(se, Hn) | 0, B = B + Math.imul(H, jn) | 0, x = x + Math.imul(H, An) | 0, x = x + Math.imul(Z, jn) | 0, O = O + Math.imul(Z, An) | 0;
                    var Bs = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Bs >>> 26) | 0, Bs &= 67108863, B = Math.imul(Ve, ut), x = Math.imul(Ve, dt), x = x + Math.imul(Ne, ut) | 0, O = Math.imul(Ne, dt), B = B + Math.imul(Ie, at) | 0, x = x + Math.imul(Ie, Qt) | 0, x = x + Math.imul(Le, at) | 0, O = O + Math.imul(Le, Qt) | 0, B = B + Math.imul(ge, Sn) | 0, x = x + Math.imul(ge, Hn) | 0, x = x + Math.imul(Ce, Sn) | 0, O = O + Math.imul(Ce, Hn) | 0, B = B + Math.imul(J, jn) | 0, x = x + Math.imul(J, An) | 0, x = x + Math.imul(se, jn) | 0, O = O + Math.imul(se, An) | 0, B = B + Math.imul(H, ar) | 0, x = x + Math.imul(H, Ln) | 0, x = x + Math.imul(Z, ar) | 0, O = O + Math.imul(Z, Ln) | 0;
                    var Qd = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Qd >>> 26) | 0, Qd &= 67108863, B = Math.imul(Qe, ut), x = Math.imul(Qe, dt), x = x + Math.imul(le, ut) | 0, O = Math.imul(le, dt), B = B + Math.imul(Ve, at) | 0, x = x + Math.imul(Ve, Qt) | 0, x = x + Math.imul(Ne, at) | 0, O = O + Math.imul(Ne, Qt) | 0, B = B + Math.imul(Ie, Sn) | 0, x = x + Math.imul(Ie, Hn) | 0, x = x + Math.imul(Le, Sn) | 0, O = O + Math.imul(Le, Hn) | 0, B = B + Math.imul(ge, jn) | 0, x = x + Math.imul(ge, An) | 0, x = x + Math.imul(Ce, jn) | 0, O = O + Math.imul(Ce, An) | 0, B = B + Math.imul(J, ar) | 0, x = x + Math.imul(J, Ln) | 0, x = x + Math.imul(se, ar) | 0, O = O + Math.imul(se, Ln) | 0, B = B + Math.imul(H, Gn) | 0, x = x + Math.imul(H, _e) | 0, x = x + Math.imul(Z, Gn) | 0, O = O + Math.imul(Z, _e) | 0;
                    var Pu = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Pu >>> 26) | 0, Pu &= 67108863, B = Math.imul(Re, ut), x = Math.imul(Re, dt), x = x + Math.imul(ee, ut) | 0, O = Math.imul(ee, dt), B = B + Math.imul(Qe, at) | 0, x = x + Math.imul(Qe, Qt) | 0, x = x + Math.imul(le, at) | 0, O = O + Math.imul(le, Qt) | 0, B = B + Math.imul(Ve, Sn) | 0, x = x + Math.imul(Ve, Hn) | 0, x = x + Math.imul(Ne, Sn) | 0, O = O + Math.imul(Ne, Hn) | 0, B = B + Math.imul(Ie, jn) | 0, x = x + Math.imul(Ie, An) | 0, x = x + Math.imul(Le, jn) | 0, O = O + Math.imul(Le, An) | 0, B = B + Math.imul(ge, ar) | 0, x = x + Math.imul(ge, Ln) | 0, x = x + Math.imul(Ce, ar) | 0, O = O + Math.imul(Ce, Ln) | 0, B = B + Math.imul(J, Gn) | 0, x = x + Math.imul(J, _e) | 0, x = x + Math.imul(se, Gn) | 0, O = O + Math.imul(se, _e) | 0, B = B + Math.imul(H, kt) | 0, x = x + Math.imul(H, je) | 0, x = x + Math.imul(Z, kt) | 0, O = O + Math.imul(Z, je) | 0;
                    var ef = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (ef >>> 26) | 0, ef &= 67108863, B = Math.imul(ye, ut), x = Math.imul(ye, dt), x = x + Math.imul(D, ut) | 0, O = Math.imul(D, dt), B = B + Math.imul(Re, at) | 0, x = x + Math.imul(Re, Qt) | 0, x = x + Math.imul(ee, at) | 0, O = O + Math.imul(ee, Qt) | 0, B = B + Math.imul(Qe, Sn) | 0, x = x + Math.imul(Qe, Hn) | 0, x = x + Math.imul(le, Sn) | 0, O = O + Math.imul(le, Hn) | 0, B = B + Math.imul(Ve, jn) | 0, x = x + Math.imul(Ve, An) | 0, x = x + Math.imul(Ne, jn) | 0, O = O + Math.imul(Ne, An) | 0, B = B + Math.imul(Ie, ar) | 0, x = x + Math.imul(Ie, Ln) | 0, x = x + Math.imul(Le, ar) | 0, O = O + Math.imul(Le, Ln) | 0, B = B + Math.imul(ge, Gn) | 0, x = x + Math.imul(ge, _e) | 0, x = x + Math.imul(Ce, Gn) | 0, O = O + Math.imul(Ce, _e) | 0, B = B + Math.imul(J, kt) | 0, x = x + Math.imul(J, je) | 0, x = x + Math.imul(se, kt) | 0, O = O + Math.imul(se, je) | 0, B = B + Math.imul(H, pn) | 0, x = x + Math.imul(H, hn) | 0, x = x + Math.imul(Z, pn) | 0, O = O + Math.imul(Z, hn) | 0;
                    var to = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (to >>> 26) | 0, to &= 67108863, B = Math.imul(E, ut), x = Math.imul(E, dt), x = x + Math.imul($, ut) | 0, O = Math.imul($, dt), B = B + Math.imul(ye, at) | 0, x = x + Math.imul(ye, Qt) | 0, x = x + Math.imul(D, at) | 0, O = O + Math.imul(D, Qt) | 0, B = B + Math.imul(Re, Sn) | 0, x = x + Math.imul(Re, Hn) | 0, x = x + Math.imul(ee, Sn) | 0, O = O + Math.imul(ee, Hn) | 0, B = B + Math.imul(Qe, jn) | 0, x = x + Math.imul(Qe, An) | 0, x = x + Math.imul(le, jn) | 0, O = O + Math.imul(le, An) | 0, B = B + Math.imul(Ve, ar) | 0, x = x + Math.imul(Ve, Ln) | 0, x = x + Math.imul(Ne, ar) | 0, O = O + Math.imul(Ne, Ln) | 0, B = B + Math.imul(Ie, Gn) | 0, x = x + Math.imul(Ie, _e) | 0, x = x + Math.imul(Le, Gn) | 0, O = O + Math.imul(Le, _e) | 0, B = B + Math.imul(ge, kt) | 0, x = x + Math.imul(ge, je) | 0, x = x + Math.imul(Ce, kt) | 0, O = O + Math.imul(Ce, je) | 0, B = B + Math.imul(J, pn) | 0, x = x + Math.imul(J, hn) | 0, x = x + Math.imul(se, pn) | 0, O = O + Math.imul(se, hn) | 0, B = B + Math.imul(H, gn) | 0, x = x + Math.imul(H, Wt) | 0, x = x + Math.imul(Z, gn) | 0, O = O + Math.imul(Z, Wt) | 0;
                    var nl = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (nl >>> 26) | 0, nl &= 67108863, B = Math.imul(ae, ut), x = Math.imul(ae, dt), x = x + Math.imul(me, ut) | 0, O = Math.imul(me, dt), B = B + Math.imul(E, at) | 0, x = x + Math.imul(E, Qt) | 0, x = x + Math.imul($, at) | 0, O = O + Math.imul($, Qt) | 0, B = B + Math.imul(ye, Sn) | 0, x = x + Math.imul(ye, Hn) | 0, x = x + Math.imul(D, Sn) | 0, O = O + Math.imul(D, Hn) | 0, B = B + Math.imul(Re, jn) | 0, x = x + Math.imul(Re, An) | 0, x = x + Math.imul(ee, jn) | 0, O = O + Math.imul(ee, An) | 0, B = B + Math.imul(Qe, ar) | 0, x = x + Math.imul(Qe, Ln) | 0, x = x + Math.imul(le, ar) | 0, O = O + Math.imul(le, Ln) | 0, B = B + Math.imul(Ve, Gn) | 0, x = x + Math.imul(Ve, _e) | 0, x = x + Math.imul(Ne, Gn) | 0, O = O + Math.imul(Ne, _e) | 0, B = B + Math.imul(Ie, kt) | 0, x = x + Math.imul(Ie, je) | 0, x = x + Math.imul(Le, kt) | 0, O = O + Math.imul(Le, je) | 0, B = B + Math.imul(ge, pn) | 0, x = x + Math.imul(ge, hn) | 0, x = x + Math.imul(Ce, pn) | 0, O = O + Math.imul(Ce, hn) | 0, B = B + Math.imul(J, gn) | 0, x = x + Math.imul(J, Wt) | 0, x = x + Math.imul(se, gn) | 0, O = O + Math.imul(se, Wt) | 0, B = B + Math.imul(H, rn) | 0, x = x + Math.imul(H, Pn) | 0, x = x + Math.imul(Z, rn) | 0, O = O + Math.imul(Z, Pn) | 0;
                    var tc = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (tc >>> 26) | 0, tc &= 67108863, B = Math.imul(ae, at), x = Math.imul(ae, Qt), x = x + Math.imul(me, at) | 0, O = Math.imul(me, Qt), B = B + Math.imul(E, Sn) | 0, x = x + Math.imul(E, Hn) | 0, x = x + Math.imul($, Sn) | 0, O = O + Math.imul($, Hn) | 0, B = B + Math.imul(ye, jn) | 0, x = x + Math.imul(ye, An) | 0, x = x + Math.imul(D, jn) | 0, O = O + Math.imul(D, An) | 0, B = B + Math.imul(Re, ar) | 0, x = x + Math.imul(Re, Ln) | 0, x = x + Math.imul(ee, ar) | 0, O = O + Math.imul(ee, Ln) | 0, B = B + Math.imul(Qe, Gn) | 0, x = x + Math.imul(Qe, _e) | 0, x = x + Math.imul(le, Gn) | 0, O = O + Math.imul(le, _e) | 0, B = B + Math.imul(Ve, kt) | 0, x = x + Math.imul(Ve, je) | 0, x = x + Math.imul(Ne, kt) | 0, O = O + Math.imul(Ne, je) | 0, B = B + Math.imul(Ie, pn) | 0, x = x + Math.imul(Ie, hn) | 0, x = x + Math.imul(Le, pn) | 0, O = O + Math.imul(Le, hn) | 0, B = B + Math.imul(ge, gn) | 0, x = x + Math.imul(ge, Wt) | 0, x = x + Math.imul(Ce, gn) | 0, O = O + Math.imul(Ce, Wt) | 0, B = B + Math.imul(J, rn) | 0, x = x + Math.imul(J, Pn) | 0, x = x + Math.imul(se, rn) | 0, O = O + Math.imul(se, Pn) | 0;
                    var ui = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (ui >>> 26) | 0, ui &= 67108863, B = Math.imul(ae, Sn), x = Math.imul(ae, Hn), x = x + Math.imul(me, Sn) | 0, O = Math.imul(me, Hn), B = B + Math.imul(E, jn) | 0, x = x + Math.imul(E, An) | 0, x = x + Math.imul($, jn) | 0, O = O + Math.imul($, An) | 0, B = B + Math.imul(ye, ar) | 0, x = x + Math.imul(ye, Ln) | 0, x = x + Math.imul(D, ar) | 0, O = O + Math.imul(D, Ln) | 0, B = B + Math.imul(Re, Gn) | 0, x = x + Math.imul(Re, _e) | 0, x = x + Math.imul(ee, Gn) | 0, O = O + Math.imul(ee, _e) | 0, B = B + Math.imul(Qe, kt) | 0, x = x + Math.imul(Qe, je) | 0, x = x + Math.imul(le, kt) | 0, O = O + Math.imul(le, je) | 0, B = B + Math.imul(Ve, pn) | 0, x = x + Math.imul(Ve, hn) | 0, x = x + Math.imul(Ne, pn) | 0, O = O + Math.imul(Ne, hn) | 0, B = B + Math.imul(Ie, gn) | 0, x = x + Math.imul(Ie, Wt) | 0, x = x + Math.imul(Le, gn) | 0, O = O + Math.imul(Le, Wt) | 0, B = B + Math.imul(ge, rn) | 0, x = x + Math.imul(ge, Pn) | 0, x = x + Math.imul(Ce, rn) | 0, O = O + Math.imul(Ce, Pn) | 0;
                    var nc = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (nc >>> 26) | 0, nc &= 67108863, B = Math.imul(ae, jn), x = Math.imul(ae, An), x = x + Math.imul(me, jn) | 0, O = Math.imul(me, An), B = B + Math.imul(E, ar) | 0, x = x + Math.imul(E, Ln) | 0, x = x + Math.imul($, ar) | 0, O = O + Math.imul($, Ln) | 0, B = B + Math.imul(ye, Gn) | 0, x = x + Math.imul(ye, _e) | 0, x = x + Math.imul(D, Gn) | 0, O = O + Math.imul(D, _e) | 0, B = B + Math.imul(Re, kt) | 0, x = x + Math.imul(Re, je) | 0, x = x + Math.imul(ee, kt) | 0, O = O + Math.imul(ee, je) | 0, B = B + Math.imul(Qe, pn) | 0, x = x + Math.imul(Qe, hn) | 0, x = x + Math.imul(le, pn) | 0, O = O + Math.imul(le, hn) | 0, B = B + Math.imul(Ve, gn) | 0, x = x + Math.imul(Ve, Wt) | 0, x = x + Math.imul(Ne, gn) | 0, O = O + Math.imul(Ne, Wt) | 0, B = B + Math.imul(Ie, rn) | 0, x = x + Math.imul(Ie, Pn) | 0, x = x + Math.imul(Le, rn) | 0, O = O + Math.imul(Le, Pn) | 0;
                    var Vi = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Vi >>> 26) | 0, Vi &= 67108863, B = Math.imul(ae, ar), x = Math.imul(ae, Ln), x = x + Math.imul(me, ar) | 0, O = Math.imul(me, Ln), B = B + Math.imul(E, Gn) | 0, x = x + Math.imul(E, _e) | 0, x = x + Math.imul($, Gn) | 0, O = O + Math.imul($, _e) | 0, B = B + Math.imul(ye, kt) | 0, x = x + Math.imul(ye, je) | 0, x = x + Math.imul(D, kt) | 0, O = O + Math.imul(D, je) | 0, B = B + Math.imul(Re, pn) | 0, x = x + Math.imul(Re, hn) | 0, x = x + Math.imul(ee, pn) | 0, O = O + Math.imul(ee, hn) | 0, B = B + Math.imul(Qe, gn) | 0, x = x + Math.imul(Qe, Wt) | 0, x = x + Math.imul(le, gn) | 0, O = O + Math.imul(le, Wt) | 0, B = B + Math.imul(Ve, rn) | 0, x = x + Math.imul(Ve, Pn) | 0, x = x + Math.imul(Ne, rn) | 0, O = O + Math.imul(Ne, Pn) | 0;
                    var rc = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (rc >>> 26) | 0, rc &= 67108863, B = Math.imul(ae, Gn), x = Math.imul(ae, _e), x = x + Math.imul(me, Gn) | 0, O = Math.imul(me, _e), B = B + Math.imul(E, kt) | 0, x = x + Math.imul(E, je) | 0, x = x + Math.imul($, kt) | 0, O = O + Math.imul($, je) | 0, B = B + Math.imul(ye, pn) | 0, x = x + Math.imul(ye, hn) | 0, x = x + Math.imul(D, pn) | 0, O = O + Math.imul(D, hn) | 0, B = B + Math.imul(Re, gn) | 0, x = x + Math.imul(Re, Wt) | 0, x = x + Math.imul(ee, gn) | 0, O = O + Math.imul(ee, Wt) | 0, B = B + Math.imul(Qe, rn) | 0, x = x + Math.imul(Qe, Pn) | 0, x = x + Math.imul(le, rn) | 0, O = O + Math.imul(le, Pn) | 0;
                    var Ou = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Ou >>> 26) | 0, Ou &= 67108863, B = Math.imul(ae, kt), x = Math.imul(ae, je), x = x + Math.imul(me, kt) | 0, O = Math.imul(me, je), B = B + Math.imul(E, pn) | 0, x = x + Math.imul(E, hn) | 0, x = x + Math.imul($, pn) | 0, O = O + Math.imul($, hn) | 0, B = B + Math.imul(ye, gn) | 0, x = x + Math.imul(ye, Wt) | 0, x = x + Math.imul(D, gn) | 0, O = O + Math.imul(D, Wt) | 0, B = B + Math.imul(Re, rn) | 0, x = x + Math.imul(Re, Pn) | 0, x = x + Math.imul(ee, rn) | 0, O = O + Math.imul(ee, Pn) | 0;
                    var Mu = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Mu >>> 26) | 0, Mu &= 67108863, B = Math.imul(ae, pn), x = Math.imul(ae, hn), x = x + Math.imul(me, pn) | 0, O = Math.imul(me, hn), B = B + Math.imul(E, gn) | 0, x = x + Math.imul(E, Wt) | 0, x = x + Math.imul($, gn) | 0, O = O + Math.imul($, Wt) | 0, B = B + Math.imul(ye, rn) | 0, x = x + Math.imul(ye, Pn) | 0, x = x + Math.imul(D, rn) | 0, O = O + Math.imul(D, Pn) | 0;
                    var sc = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (sc >>> 26) | 0, sc &= 67108863, B = Math.imul(ae, gn), x = Math.imul(ae, Wt), x = x + Math.imul(me, gn) | 0, O = Math.imul(me, Wt), B = B + Math.imul(E, rn) | 0, x = x + Math.imul(E, Pn) | 0, x = x + Math.imul($, rn) | 0, O = O + Math.imul($, Pn) | 0;
                    var Ru = (z + B | 0) + ((x & 8191) << 13) | 0;
                    z = (O + (x >>> 13) | 0) + (Ru >>> 26) | 0, Ru &= 67108863, B = Math.imul(ae, rn), x = Math.imul(ae, Pn), x = x + Math.imul(me, rn) | 0, O = Math.imul(me, Pn);
                    var rl = (z + B | 0) + ((x & 8191) << 13) | 0;
                    return z = (O + (x >>> 13) | 0) + (rl >>> 26) | 0, rl &= 67108863, L[0] = Qa, L[1] = ec, L[2] = tl, L[3] = Bs, L[4] = Qd, L[5] = Pu, L[6] = ef, L[7] = to, L[8] = nl, L[9] = tc, L[10] = ui, L[11] = nc, L[12] = Vi, L[13] = rc, L[14] = Ou, L[15] = Mu, L[16] = sc, L[17] = Ru, L[18] = rl, z !== 0 && (L[19] = z, C.length++), C;
                };
                Math.imul || (k = v);
                function _(M, g, y) {
                    y.negative = g.negative ^ M.negative, y.length = M.length + g.length;
                    for(var C = 0, R = 0, N = 0; N < y.length - 1; N++){
                        var L = R;
                        R = 0;
                        for(var z = C & 67108863, B = Math.min(N, g.length - 1), x = Math.max(0, N - M.length + 1); x <= B; x++){
                            var O = N - x, q = M.words[O] | 0, H = g.words[x] | 0, Z = q * H, te = Z & 67108863;
                            L = L + (Z / 67108864 | 0) | 0, te = te + z | 0, z = te & 67108863, L = L + (te >>> 26) | 0, R += L >>> 26, L &= 67108863;
                        }
                        y.words[N] = z, C = L, L = R;
                    }
                    return C !== 0 ? y.words[N] = C : y.length--, y._strip();
                }
                function A(M, g, y) {
                    return _(M, g, y);
                }
                i.prototype.mulTo = function(g, y) {
                    var C, R = this.length + g.length;
                    return this.length === 10 && g.length === 10 ? C = k(this, g, y) : R < 63 ? C = v(this, g, y) : R < 1024 ? C = _(this, g, y) : C = A(this, g, y), C;
                }, i.prototype.mul = function(g) {
                    var y = new i(null);
                    return y.words = new Array(this.length + g.length), this.mulTo(g, y);
                }, i.prototype.mulf = function(g) {
                    var y = new i(null);
                    return y.words = new Array(this.length + g.length), A(this, g, y);
                }, i.prototype.imul = function(g) {
                    return this.clone().mulTo(g, this);
                }, i.prototype.imuln = function(g) {
                    var y = g < 0;
                    y && (g = -g), r(typeof g == "number"), r(g < 67108864);
                    for(var C = 0, R = 0; R < this.length; R++){
                        var N = (this.words[R] | 0) * g, L = (N & 67108863) + (C & 67108863);
                        C >>= 26, C += N / 67108864 | 0, C += L >>> 26, this.words[R] = L & 67108863;
                    }
                    return C !== 0 && (this.words[R] = C, this.length++), this.length = g === 0 ? 1 : this.length, y ? this.ineg() : this;
                }, i.prototype.muln = function(g) {
                    return this.clone().imuln(g);
                }, i.prototype.sqr = function() {
                    return this.mul(this);
                }, i.prototype.isqr = function() {
                    return this.imul(this.clone());
                }, i.prototype.pow = function(g) {
                    var y = w(g);
                    if (y.length === 0) return new i(1);
                    for(var C = this, R = 0; R < y.length && y[R] === 0; R++, C = C.sqr());
                    if (++R < y.length) for(var N = C.sqr(); R < y.length; R++, N = N.sqr())y[R] !== 0 && (C = C.mul(N));
                    return C;
                }, i.prototype.iushln = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var y = g % 26, C = (g - y) / 26, R = 67108863 >>> 26 - y << 26 - y, N;
                    if (y !== 0) {
                        var L = 0;
                        for(N = 0; N < this.length; N++){
                            var z = this.words[N] & R, B = (this.words[N] | 0) - z << y;
                            this.words[N] = B | L, L = z >>> 26 - y;
                        }
                        L && (this.words[N] = L, this.length++);
                    }
                    if (C !== 0) {
                        for(N = this.length - 1; N >= 0; N--)this.words[N + C] = this.words[N];
                        for(N = 0; N < C; N++)this.words[N] = 0;
                        this.length += C;
                    }
                    return this._strip();
                }, i.prototype.ishln = function(g) {
                    return r(this.negative === 0), this.iushln(g);
                }, i.prototype.iushrn = function(g, y, C) {
                    r(typeof g == "number" && g >= 0);
                    var R;
                    y ? R = (y - y % 26) / 26 : R = 0;
                    var N = g % 26, L = Math.min((g - N) / 26, this.length), z = 67108863 ^ 67108863 >>> N << N, B = C;
                    if (R -= L, R = Math.max(0, R), B) {
                        for(var x = 0; x < L; x++)B.words[x] = this.words[x];
                        B.length = L;
                    }
                    if (L !== 0) if (this.length > L) for(this.length -= L, x = 0; x < this.length; x++)this.words[x] = this.words[x + L];
                    else this.words[0] = 0, this.length = 1;
                    var O = 0;
                    for(x = this.length - 1; x >= 0 && (O !== 0 || x >= R); x--){
                        var q = this.words[x] | 0;
                        this.words[x] = O << 26 - N | q >>> N, O = q & z;
                    }
                    return B && O !== 0 && (B.words[B.length++] = O), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip();
                }, i.prototype.ishrn = function(g, y, C) {
                    return r(this.negative === 0), this.iushrn(g, y, C);
                }, i.prototype.shln = function(g) {
                    return this.clone().ishln(g);
                }, i.prototype.ushln = function(g) {
                    return this.clone().iushln(g);
                }, i.prototype.shrn = function(g) {
                    return this.clone().ishrn(g);
                }, i.prototype.ushrn = function(g) {
                    return this.clone().iushrn(g);
                }, i.prototype.testn = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var y = g % 26, C = (g - y) / 26, R = 1 << y;
                    if (this.length <= C) return !1;
                    var N = this.words[C];
                    return !!(N & R);
                }, i.prototype.imaskn = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var y = g % 26, C = (g - y) / 26;
                    if (r(this.negative === 0, "imaskn works only with positive numbers"), this.length <= C) return this;
                    if (y !== 0 && C++, this.length = Math.min(C, this.length), y !== 0) {
                        var R = 67108863 ^ 67108863 >>> y << y;
                        this.words[this.length - 1] &= R;
                    }
                    return this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip();
                }, i.prototype.maskn = function(g) {
                    return this.clone().imaskn(g);
                }, i.prototype.iaddn = function(g) {
                    return r(typeof g == "number"), r(g < 67108864), g < 0 ? this.isubn(-g) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= g ? (this.words[0] = g - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(g), this.negative = 1, this) : this._iaddn(g);
                }, i.prototype._iaddn = function(g) {
                    this.words[0] += g;
                    for(var y = 0; y < this.length && this.words[y] >= 67108864; y++)this.words[y] -= 67108864, y === this.length - 1 ? this.words[y + 1] = 1 : this.words[y + 1]++;
                    return this.length = Math.max(this.length, y + 1), this;
                }, i.prototype.isubn = function(g) {
                    if (r(typeof g == "number"), r(g < 67108864), g < 0) return this.iaddn(-g);
                    if (this.negative !== 0) return this.negative = 0, this.iaddn(g), this.negative = 1, this;
                    if (this.words[0] -= g, this.length === 1 && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
                    else for(var y = 0; y < this.length && this.words[y] < 0; y++)this.words[y] += 67108864, this.words[y + 1] -= 1;
                    return this._strip();
                }, i.prototype.addn = function(g) {
                    return this.clone().iaddn(g);
                }, i.prototype.subn = function(g) {
                    return this.clone().isubn(g);
                }, i.prototype.iabs = function() {
                    return this.negative = 0, this;
                }, i.prototype.abs = function() {
                    return this.clone().iabs();
                }, i.prototype._ishlnsubmul = function(g, y, C) {
                    var R = g.length + C, N;
                    this._expand(R);
                    var L, z = 0;
                    for(N = 0; N < g.length; N++){
                        L = (this.words[N + C] | 0) + z;
                        var B = (g.words[N] | 0) * y;
                        L -= B & 67108863, z = (L >> 26) - (B / 67108864 | 0), this.words[N + C] = L & 67108863;
                    }
                    for(; N < this.length - C; N++)L = (this.words[N + C] | 0) + z, z = L >> 26, this.words[N + C] = L & 67108863;
                    if (z === 0) return this._strip();
                    for(r(z === -1), z = 0, N = 0; N < this.length; N++)L = -(this.words[N] | 0) + z, z = L >> 26, this.words[N] = L & 67108863;
                    return this.negative = 1, this._strip();
                }, i.prototype._wordDiv = function(g, y) {
                    var C = this.length - g.length, R = this.clone(), N = g, L = N.words[N.length - 1] | 0, z = this._countBits(L);
                    C = 26 - z, C !== 0 && (N = N.ushln(C), R.iushln(C), L = N.words[N.length - 1] | 0);
                    var B = R.length - N.length, x;
                    if (y !== "mod") {
                        x = new i(null), x.length = B + 1, x.words = new Array(x.length);
                        for(var O = 0; O < x.length; O++)x.words[O] = 0;
                    }
                    var q = R.clone()._ishlnsubmul(N, 1, B);
                    q.negative === 0 && (R = q, x && (x.words[B] = 1));
                    for(var H = B - 1; H >= 0; H--){
                        var Z = (R.words[N.length + H] | 0) * 67108864 + (R.words[N.length + H - 1] | 0);
                        for(Z = Math.min(Z / L | 0, 67108863), R._ishlnsubmul(N, Z, H); R.negative !== 0;)Z--, R.negative = 0, R._ishlnsubmul(N, 1, H), R.isZero() || (R.negative ^= 1);
                        x && (x.words[H] = Z);
                    }
                    return x && x._strip(), R._strip(), y !== "div" && C !== 0 && R.iushrn(C), {
                        div: x || null,
                        mod: R
                    };
                }, i.prototype.divmod = function(g, y, C) {
                    if (r(!g.isZero()), this.isZero()) return {
                        div: new i(0),
                        mod: new i(0)
                    };
                    var R, N, L;
                    return this.negative !== 0 && g.negative === 0 ? (L = this.neg().divmod(g, y), y !== "mod" && (R = L.div.neg()), y !== "div" && (N = L.mod.neg(), C && N.negative !== 0 && N.iadd(g)), {
                        div: R,
                        mod: N
                    }) : this.negative === 0 && g.negative !== 0 ? (L = this.divmod(g.neg(), y), y !== "mod" && (R = L.div.neg()), {
                        div: R,
                        mod: L.mod
                    }) : (this.negative & g.negative) !== 0 ? (L = this.neg().divmod(g.neg(), y), y !== "div" && (N = L.mod.neg(), C && N.negative !== 0 && N.isub(g)), {
                        div: L.div,
                        mod: N
                    }) : g.length > this.length || this.cmp(g) < 0 ? {
                        div: new i(0),
                        mod: this
                    } : g.length === 1 ? y === "div" ? {
                        div: this.divn(g.words[0]),
                        mod: null
                    } : y === "mod" ? {
                        div: null,
                        mod: new i(this.modrn(g.words[0]))
                    } : {
                        div: this.divn(g.words[0]),
                        mod: new i(this.modrn(g.words[0]))
                    } : this._wordDiv(g, y);
                }, i.prototype.div = function(g) {
                    return this.divmod(g, "div", !1).div;
                }, i.prototype.mod = function(g) {
                    return this.divmod(g, "mod", !1).mod;
                }, i.prototype.umod = function(g) {
                    return this.divmod(g, "mod", !0).mod;
                }, i.prototype.divRound = function(g) {
                    var y = this.divmod(g);
                    if (y.mod.isZero()) return y.div;
                    var C = y.div.negative !== 0 ? y.mod.isub(g) : y.mod, R = g.ushrn(1), N = g.andln(1), L = C.cmp(R);
                    return L < 0 || N === 1 && L === 0 ? y.div : y.div.negative !== 0 ? y.div.isubn(1) : y.div.iaddn(1);
                }, i.prototype.modrn = function(g) {
                    var y = g < 0;
                    y && (g = -g), r(g <= 67108863);
                    for(var C = (1 << 26) % g, R = 0, N = this.length - 1; N >= 0; N--)R = (C * R + (this.words[N] | 0)) % g;
                    return y ? -R : R;
                }, i.prototype.modn = function(g) {
                    return this.modrn(g);
                }, i.prototype.idivn = function(g) {
                    var y = g < 0;
                    y && (g = -g), r(g <= 67108863);
                    for(var C = 0, R = this.length - 1; R >= 0; R--){
                        var N = (this.words[R] | 0) + C * 67108864;
                        this.words[R] = N / g | 0, C = N % g;
                    }
                    return this._strip(), y ? this.ineg() : this;
                }, i.prototype.divn = function(g) {
                    return this.clone().idivn(g);
                }, i.prototype.egcd = function(g) {
                    r(g.negative === 0), r(!g.isZero());
                    var y = this, C = g.clone();
                    y.negative !== 0 ? y = y.umod(g) : y = y.clone();
                    for(var R = new i(1), N = new i(0), L = new i(0), z = new i(1), B = 0; y.isEven() && C.isEven();)y.iushrn(1), C.iushrn(1), ++B;
                    for(var x = C.clone(), O = y.clone(); !y.isZero();){
                        for(var q = 0, H = 1; (y.words[0] & H) === 0 && q < 26; ++q, H <<= 1);
                        if (q > 0) for(y.iushrn(q); q-- > 0;)(R.isOdd() || N.isOdd()) && (R.iadd(x), N.isub(O)), R.iushrn(1), N.iushrn(1);
                        for(var Z = 0, te = 1; (C.words[0] & te) === 0 && Z < 26; ++Z, te <<= 1);
                        if (Z > 0) for(C.iushrn(Z); Z-- > 0;)(L.isOdd() || z.isOdd()) && (L.iadd(x), z.isub(O)), L.iushrn(1), z.iushrn(1);
                        y.cmp(C) >= 0 ? (y.isub(C), R.isub(L), N.isub(z)) : (C.isub(y), L.isub(R), z.isub(N));
                    }
                    return {
                        a: L,
                        b: z,
                        gcd: C.iushln(B)
                    };
                }, i.prototype._invmp = function(g) {
                    r(g.negative === 0), r(!g.isZero());
                    var y = this, C = g.clone();
                    y.negative !== 0 ? y = y.umod(g) : y = y.clone();
                    for(var R = new i(1), N = new i(0), L = C.clone(); y.cmpn(1) > 0 && C.cmpn(1) > 0;){
                        for(var z = 0, B = 1; (y.words[0] & B) === 0 && z < 26; ++z, B <<= 1);
                        if (z > 0) for(y.iushrn(z); z-- > 0;)R.isOdd() && R.iadd(L), R.iushrn(1);
                        for(var x = 0, O = 1; (C.words[0] & O) === 0 && x < 26; ++x, O <<= 1);
                        if (x > 0) for(C.iushrn(x); x-- > 0;)N.isOdd() && N.iadd(L), N.iushrn(1);
                        y.cmp(C) >= 0 ? (y.isub(C), R.isub(N)) : (C.isub(y), N.isub(R));
                    }
                    var q;
                    return y.cmpn(1) === 0 ? q = R : q = N, q.cmpn(0) < 0 && q.iadd(g), q;
                }, i.prototype.gcd = function(g) {
                    if (this.isZero()) return g.abs();
                    if (g.isZero()) return this.abs();
                    var y = this.clone(), C = g.clone();
                    y.negative = 0, C.negative = 0;
                    for(var R = 0; y.isEven() && C.isEven(); R++)y.iushrn(1), C.iushrn(1);
                    do {
                        for(; y.isEven();)y.iushrn(1);
                        for(; C.isEven();)C.iushrn(1);
                        var N = y.cmp(C);
                        if (N < 0) {
                            var L = y;
                            y = C, C = L;
                        } else if (N === 0 || C.cmpn(1) === 0) break;
                        y.isub(C);
                    }while (!0);
                    return C.iushln(R);
                }, i.prototype.invm = function(g) {
                    return this.egcd(g).a.umod(g);
                }, i.prototype.isEven = function() {
                    return (this.words[0] & 1) === 0;
                }, i.prototype.isOdd = function() {
                    return (this.words[0] & 1) === 1;
                }, i.prototype.andln = function(g) {
                    return this.words[0] & g;
                }, i.prototype.bincn = function(g) {
                    r(typeof g == "number");
                    var y = g % 26, C = (g - y) / 26, R = 1 << y;
                    if (this.length <= C) return this._expand(C + 1), this.words[C] |= R, this;
                    for(var N = R, L = C; N !== 0 && L < this.length; L++){
                        var z = this.words[L] | 0;
                        z += N, N = z >>> 26, z &= 67108863, this.words[L] = z;
                    }
                    return N !== 0 && (this.words[L] = N, this.length++), this;
                }, i.prototype.isZero = function() {
                    return this.length === 1 && this.words[0] === 0;
                }, i.prototype.cmpn = function(g) {
                    var y = g < 0;
                    if (this.negative !== 0 && !y) return -1;
                    if (this.negative === 0 && y) return 1;
                    this._strip();
                    var C;
                    if (this.length > 1) C = 1;
                    else {
                        y && (g = -g), r(g <= 67108863, "Number is too big");
                        var R = this.words[0] | 0;
                        C = R === g ? 0 : R < g ? -1 : 1;
                    }
                    return this.negative !== 0 ? -C | 0 : C;
                }, i.prototype.cmp = function(g) {
                    if (this.negative !== 0 && g.negative === 0) return -1;
                    if (this.negative === 0 && g.negative !== 0) return 1;
                    var y = this.ucmp(g);
                    return this.negative !== 0 ? -y | 0 : y;
                }, i.prototype.ucmp = function(g) {
                    if (this.length > g.length) return 1;
                    if (this.length < g.length) return -1;
                    for(var y = 0, C = this.length - 1; C >= 0; C--){
                        var R = this.words[C] | 0, N = g.words[C] | 0;
                        if (R !== N) {
                            R < N ? y = -1 : R > N && (y = 1);
                            break;
                        }
                    }
                    return y;
                }, i.prototype.gtn = function(g) {
                    return this.cmpn(g) === 1;
                }, i.prototype.gt = function(g) {
                    return this.cmp(g) === 1;
                }, i.prototype.gten = function(g) {
                    return this.cmpn(g) >= 0;
                }, i.prototype.gte = function(g) {
                    return this.cmp(g) >= 0;
                }, i.prototype.ltn = function(g) {
                    return this.cmpn(g) === -1;
                }, i.prototype.lt = function(g) {
                    return this.cmp(g) === -1;
                }, i.prototype.lten = function(g) {
                    return this.cmpn(g) <= 0;
                }, i.prototype.lte = function(g) {
                    return this.cmp(g) <= 0;
                }, i.prototype.eqn = function(g) {
                    return this.cmpn(g) === 0;
                }, i.prototype.eq = function(g) {
                    return this.cmp(g) === 0;
                }, i.red = function(g) {
                    return new ie(g);
                }, i.prototype.toRed = function(g) {
                    return r(!this.red, "Already a number in reduction context"), r(this.negative === 0, "red works only with positives"), g.convertTo(this)._forceRed(g);
                }, i.prototype.fromRed = function() {
                    return r(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
                }, i.prototype._forceRed = function(g) {
                    return this.red = g, this;
                }, i.prototype.forceRed = function(g) {
                    return r(!this.red, "Already a number in reduction context"), this._forceRed(g);
                }, i.prototype.redAdd = function(g) {
                    return r(this.red, "redAdd works only with red numbers"), this.red.add(this, g);
                }, i.prototype.redIAdd = function(g) {
                    return r(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, g);
                }, i.prototype.redSub = function(g) {
                    return r(this.red, "redSub works only with red numbers"), this.red.sub(this, g);
                }, i.prototype.redISub = function(g) {
                    return r(this.red, "redISub works only with red numbers"), this.red.isub(this, g);
                }, i.prototype.redShl = function(g) {
                    return r(this.red, "redShl works only with red numbers"), this.red.shl(this, g);
                }, i.prototype.redMul = function(g) {
                    return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, g), this.red.mul(this, g);
                }, i.prototype.redIMul = function(g) {
                    return r(this.red, "redMul works only with red numbers"), this.red._verify2(this, g), this.red.imul(this, g);
                }, i.prototype.redSqr = function() {
                    return r(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
                }, i.prototype.redISqr = function() {
                    return r(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
                }, i.prototype.redSqrt = function() {
                    return r(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
                }, i.prototype.redInvm = function() {
                    return r(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
                }, i.prototype.redNeg = function() {
                    return r(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
                }, i.prototype.redPow = function(g) {
                    return r(this.red && !g.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, g);
                };
                var P = {
                    k256: null,
                    p224: null,
                    p192: null,
                    p25519: null
                };
                function U(M, g) {
                    this.name = M, this.p = new i(g, 16), this.n = this.p.bitLength(), this.k = new i(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
                }
                U.prototype._tmp = function() {
                    var g = new i(null);
                    return g.words = new Array(Math.ceil(this.n / 13)), g;
                }, U.prototype.ireduce = function(g) {
                    var y = g, C;
                    do this.split(y, this.tmp), y = this.imulK(y), y = y.iadd(this.tmp), C = y.bitLength();
                    while (C > this.n);
                    var R = C < this.n ? -1 : y.ucmp(this.p);
                    return R === 0 ? (y.words[0] = 0, y.length = 1) : R > 0 ? y.isub(this.p) : y.strip !== void 0 ? y.strip() : y._strip(), y;
                }, U.prototype.split = function(g, y) {
                    g.iushrn(this.n, 0, y);
                }, U.prototype.imulK = function(g) {
                    return g.imul(this.k);
                };
                function K() {
                    U.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
                }
                s(K, U), K.prototype.split = function(g, y) {
                    for(var C = 4194303, R = Math.min(g.length, 9), N = 0; N < R; N++)y.words[N] = g.words[N];
                    if (y.length = R, g.length <= 9) {
                        g.words[0] = 0, g.length = 1;
                        return;
                    }
                    var L = g.words[9];
                    for(y.words[y.length++] = L & C, N = 10; N < g.length; N++){
                        var z = g.words[N] | 0;
                        g.words[N - 10] = (z & C) << 4 | L >>> 22, L = z;
                    }
                    L >>>= 22, g.words[N - 10] = L, L === 0 && g.length > 10 ? g.length -= 10 : g.length -= 9;
                }, K.prototype.imulK = function(g) {
                    g.words[g.length] = 0, g.words[g.length + 1] = 0, g.length += 2;
                    for(var y = 0, C = 0; C < g.length; C++){
                        var R = g.words[C] | 0;
                        y += R * 977, g.words[C] = y & 67108863, y = R * 64 + (y / 67108864 | 0);
                    }
                    return g.words[g.length - 1] === 0 && (g.length--, g.words[g.length - 1] === 0 && g.length--), g;
                };
                function X() {
                    U.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
                }
                s(X, U);
                function G() {
                    U.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
                }
                s(G, U);
                function ce() {
                    U.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
                }
                s(ce, U), ce.prototype.imulK = function(g) {
                    for(var y = 0, C = 0; C < g.length; C++){
                        var R = (g.words[C] | 0) * 19 + y, N = R & 67108863;
                        R >>>= 26, g.words[C] = N, y = R;
                    }
                    return y !== 0 && (g.words[g.length++] = y), g;
                }, i._prime = function(g) {
                    if (P[g]) return P[g];
                    var y;
                    if (g === "k256") y = new K;
                    else if (g === "p224") y = new X;
                    else if (g === "p192") y = new G;
                    else if (g === "p25519") y = new ce;
                    else throw new Error("Unknown prime " + g);
                    return P[g] = y, y;
                };
                function ie(M) {
                    if (typeof M == "string") {
                        var g = i._prime(M);
                        this.m = g.p, this.prime = g;
                    } else r(M.gtn(1), "modulus must be greater than 1"), this.m = M, this.prime = null;
                }
                ie.prototype._verify1 = function(g) {
                    r(g.negative === 0, "red works only with positives"), r(g.red, "red works only with red numbers");
                }, ie.prototype._verify2 = function(g, y) {
                    r((g.negative | y.negative) === 0, "red works only with positives"), r(g.red && g.red === y.red, "red works only with red numbers");
                }, ie.prototype.imod = function(g) {
                    return this.prime ? this.prime.ireduce(g)._forceRed(this) : (u(g, g.umod(this.m)._forceRed(this)), g);
                }, ie.prototype.neg = function(g) {
                    return g.isZero() ? g.clone() : this.m.sub(g)._forceRed(this);
                }, ie.prototype.add = function(g, y) {
                    this._verify2(g, y);
                    var C = g.add(y);
                    return C.cmp(this.m) >= 0 && C.isub(this.m), C._forceRed(this);
                }, ie.prototype.iadd = function(g, y) {
                    this._verify2(g, y);
                    var C = g.iadd(y);
                    return C.cmp(this.m) >= 0 && C.isub(this.m), C;
                }, ie.prototype.sub = function(g, y) {
                    this._verify2(g, y);
                    var C = g.sub(y);
                    return C.cmpn(0) < 0 && C.iadd(this.m), C._forceRed(this);
                }, ie.prototype.isub = function(g, y) {
                    this._verify2(g, y);
                    var C = g.isub(y);
                    return C.cmpn(0) < 0 && C.iadd(this.m), C;
                }, ie.prototype.shl = function(g, y) {
                    return this._verify1(g), this.imod(g.ushln(y));
                }, ie.prototype.imul = function(g, y) {
                    return this._verify2(g, y), this.imod(g.imul(y));
                }, ie.prototype.mul = function(g, y) {
                    return this._verify2(g, y), this.imod(g.mul(y));
                }, ie.prototype.isqr = function(g) {
                    return this.imul(g, g.clone());
                }, ie.prototype.sqr = function(g) {
                    return this.mul(g, g);
                }, ie.prototype.sqrt = function(g) {
                    if (g.isZero()) return g.clone();
                    var y = this.m.andln(3);
                    if (r(y % 2 === 1), y === 3) {
                        var C = this.m.add(new i(1)).iushrn(2);
                        return this.pow(g, C);
                    }
                    for(var R = this.m.subn(1), N = 0; !R.isZero() && R.andln(1) === 0;)N++, R.iushrn(1);
                    r(!R.isZero());
                    var L = new i(1).toRed(this), z = L.redNeg(), B = this.m.subn(1).iushrn(1), x = this.m.bitLength();
                    for(x = new i(2 * x * x).toRed(this); this.pow(x, B).cmp(z) !== 0;)x.redIAdd(z);
                    for(var O = this.pow(x, R), q = this.pow(g, R.addn(1).iushrn(1)), H = this.pow(g, R), Z = N; H.cmp(L) !== 0;){
                        for(var te = H, J = 0; te.cmp(L) !== 0; J++)te = te.redSqr();
                        r(J < Z);
                        var se = this.pow(O, new i(1).iushln(Z - J - 1));
                        q = q.redMul(se), O = se.redSqr(), H = H.redMul(O), Z = J;
                    }
                    return q;
                }, ie.prototype.invm = function(g) {
                    var y = g._invmp(this.m);
                    return y.negative !== 0 ? (y.negative = 0, this.imod(y).redNeg()) : this.imod(y);
                }, ie.prototype.pow = function(g, y) {
                    if (y.isZero()) return new i(1).toRed(this);
                    if (y.cmpn(1) === 0) return g.clone();
                    var C = 4, R = new Array(1 << C);
                    R[0] = new i(1).toRed(this), R[1] = g;
                    for(var N = 2; N < R.length; N++)R[N] = this.mul(R[N - 1], g);
                    var L = R[0], z = 0, B = 0, x = y.bitLength() % 26;
                    for(x === 0 && (x = 26), N = y.length - 1; N >= 0; N--){
                        for(var O = y.words[N], q = x - 1; q >= 0; q--){
                            var H = O >> q & 1;
                            if (L !== R[0] && (L = this.sqr(L)), H === 0 && z === 0) {
                                B = 0;
                                continue;
                            }
                            z <<= 1, z |= H, B++, !(B !== C && (N !== 0 || q !== 0)) && (L = this.mul(L, R[z]), B = 0, z = 0);
                        }
                        x = 26;
                    }
                    return L;
                }, ie.prototype.convertTo = function(g) {
                    var y = g.umod(this.m);
                    return y === g ? y.clone() : y;
                }, ie.prototype.convertFrom = function(g) {
                    var y = g.clone();
                    return y.red = null, y;
                }, i.mont = function(g) {
                    return new Y(g);
                };
                function Y(M) {
                    ie.call(this, M), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new i(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);
                }
                s(Y, ie), Y.prototype.convertTo = function(g) {
                    return this.imod(g.ushln(this.shift));
                }, Y.prototype.convertFrom = function(g) {
                    var y = this.imod(g.mul(this.rinv));
                    return y.red = null, y;
                }, Y.prototype.imul = function(g, y) {
                    if (g.isZero() || y.isZero()) return g.words[0] = 0, g.length = 1, g;
                    var C = g.imul(y), R = C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), N = C.isub(R).iushrn(this.shift), L = N;
                    return N.cmp(this.m) >= 0 ? L = N.isub(this.m) : N.cmpn(0) < 0 && (L = N.iadd(this.m)), L._forceRed(this);
                }, Y.prototype.mul = function(g, y) {
                    if (g.isZero() || y.isZero()) return new i(0)._forceRed(this);
                    var C = g.mul(y), R = C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), N = C.isub(R).iushrn(this.shift), L = N;
                    return N.cmp(this.m) >= 0 ? L = N.isub(this.m) : N.cmpn(0) < 0 && (L = N.iadd(this.m)), L._forceRed(this);
                }, Y.prototype.invm = function(g) {
                    var y = this.imod(g._invmp(this.m).mul(this.r2));
                    return y._forceRed(this);
                };
            })(t, lLe);
        })(U_)), U_.exports;
    }
    dLe = uLe();
    ht = mU(dLe);
    function Ya(t) {
        return ht.isBN(t);
    }
    const YZ = /^0x[\da-fA-F]+$/, fLe = /^[\da-fA-F]+$/;
    function Fn(t, e = -1, n) {
        return typeof t == "string" && (t === "0x" || YZ.test(t)) && (e === -1 ? n || t.length % 2 === 0 : t.length === 2 + Math.ceil(e / 4));
    }
    function eo(t) {
        return !!t && typeof t == "object";
    }
    function QZ(...t) {
        return (e)=>(eo(e) || Mt(e)) && t.every((n)=>Mt(e[n]));
    }
    function pLe(...t) {
        return (e)=>Mt(e) && t.every((n)=>Mt(e[n]));
    }
    function mA(...t) {
        return (e)=>eo(e) && t.every((n)=>Mt(e[n]));
    }
    const hLe = QZ("toBigInt"), gLe = QZ("toBn"), j3 = typeof cr == "function" && typeof cr.asIntN == "function", bLe = typeof da.Buffer == "function" && typeof da.Buffer.isBuffer == "function";
    da.process;
    function eJ(t) {
        return bLe && !!t && Mt(t.readDoubleLE) && da.Buffer.isBuffer(t);
    }
    function Bt(t) {
        return (t && t.constructor) === Uint8Array || t instanceof Uint8Array;
    }
    const mLe = new rLe;
    function ja(t) {
        return t ? mLe.encode(t.toString()) : new Uint8Array;
    }
    function Dt(t, e = !1) {
        if (e && t == null) throw new Error("u8aToU8a: Expected non-null, non-undefined value");
        return Bt(t) ? eJ(t) ? new Uint8Array(t) : t : Fn(t) ? Hc(t) : Array.isArray(t) ? new Uint8Array(t) : ja(t);
    }
    function Ai(...t) {
        const e = t.length, n = new Array(e);
        let r = 0;
        for(let s = 0; s < e; s++)n[s] = Dt(t[s]), r += n[s].length;
        return Po(n, r);
    }
    function Po(t, e = 0) {
        const n = t.length;
        let r = 0;
        if (!e) for(let i = 0; i < n; i++)e += t[i].length;
        const s = new Uint8Array(e);
        for(let i = 0; i < n; i++)s.set(t[i], r), r += t[i].length;
        return s;
    }
    function tJ(t, e) {
        const n = Dt(t), r = Dt(e);
        if (n.length === r.length) {
            const s = new DataView(n.buffer, n.byteOffset), i = new DataView(r.buffer, r.byteOffset), o = n.length % 4 | 0, a = n.length - o | 0;
            for(let c = 0; c < a; c += 4)if (s.getUint32(c) !== i.getUint32(c)) return !1;
            for(let c = a, l = n.length; c < l; c++)if (n[c] !== r[c]) return !1;
            return !0;
        }
        return !1;
    }
    function uu(t, { isLe: e = !0, isNegative: n = !1 } = {}) {
        e || (t = t.slice().reverse());
        const r = t.length;
        if (n && r && t[r - 1] & 128) switch(r){
            case 0:
                return new ht(0);
            case 1:
                return new ht((t[0] ^ 255) * -1 - 1);
            case 2:
                return new ht((t[0] + (t[1] << 8) ^ 65535) * -1 - 1);
            case 3:
                return new ht((t[0] + (t[1] << 8) + (t[2] << 16) ^ 16777215) * -1 - 1);
            case 4:
                return new ht((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) * -1 - 1);
            case 5:
                return new ht(((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] ^ 255) * 4294967296) * -1 - 1);
            case 6:
                return new ht(((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] + (t[5] << 8) ^ 65535) * 4294967296) * -1 - 1);
            default:
                return new ht(t, "le").fromTwos(r * 8);
        }
        switch(r){
            case 0:
                return new ht(0);
            case 1:
                return new ht(t[0]);
            case 2:
                return new ht(t[0] + (t[1] << 8));
            case 3:
                return new ht(t[0] + (t[1] << 8) + (t[2] << 16));
            case 4:
                return new ht(t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216);
            case 5:
                return new ht(t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8)) * 16777216);
            case 6:
                return new ht(t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8) + (t[5] << 16)) * 16777216);
            default:
                return new ht(t, "le");
        }
    }
    function yLe(t, { bitLength: e = 32, isLe: n = !0 } = {}) {
        if (e !== 32 && e !== 64) throw new Error("Invalid bitLength provided, expected 32 or 64");
        if (t.length < e / 8) throw new Error(`Invalid input buffer provided, expected at least ${e / 8} bytes, found ${t.length}`);
        const r = new DataView(t.buffer, t.byteOffset);
        return e === 32 ? r.getFloat32(0, n) : r.getFloat64(0, n);
    }
    const gx = new Array(256), nJ = new Array(256 * 256);
    for(let t = 0; t < 256; t++)gx[t] = t.toString(16).padStart(2, "0");
    for(let t = 0; t < 256; t++){
        const e = t << 8;
        for(let n = 0; n < 256; n++)nJ[e | n] = gx[t] + gx[n];
    }
    function uS(t, e) {
        const n = t.length % 2 | 0, r = t.length - n | 0;
        for(let s = 0; s < r; s += 2)e += nJ[t[s] << 8 | t[s + 1]];
        return n && (e += gx[t[r] | 0]), e;
    }
    function nn(t, e = -1, n = !0) {
        const r = n ? "0x" : "";
        if (t?.length) {
            if (e > 0) {
                const s = Math.ceil(e / 8);
                if (t.length > s) return `${uS(t.subarray(0, s / 2), r)}…${uS(t.subarray(t.length - s / 2), "")}`;
            }
        } else return r;
        return uS(t, r);
    }
    function wLe(t, { isLe: e = !0, isNegative: n = !1 } = {}) {
        e || (t = t.slice().reverse());
        const r = t.length;
        if (n && r && t[r - 1] & 128) switch(r){
            case 0:
                return 0;
            case 1:
                return (t[0] ^ 255) * -1 - 1;
            case 2:
                return (t[0] + (t[1] << 8) ^ 65535) * -1 - 1;
            case 3:
                return (t[0] + (t[1] << 8) + (t[2] << 16) ^ 16777215) * -1 - 1;
            case 4:
                return (t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) * -1 - 1;
            case 5:
                return ((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] ^ 255) * 4294967296) * -1 - 1;
            case 6:
                return ((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] + (t[5] << 8) ^ 65535) * 4294967296) * -1 - 1;
            default:
                throw new Error("Value more than 48-bits cannot be reliably converted");
        }
        switch(r){
            case 0:
                return 0;
            case 1:
                return t[0];
            case 2:
                return t[0] + (t[1] << 8);
            case 3:
                return t[0] + (t[1] << 8) + (t[2] << 16);
            case 4:
                return t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216;
            case 5:
                return t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8)) * 16777216;
            case 6:
                return t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8) + (t[5] << 16)) * 16777216;
            default:
                throw new Error("Value more than 48-bits cannot be reliably converted");
        }
    }
    const _Le = new tLe("utf-8");
    function Kl(t) {
        return t ? _Le.decode(t) : "";
    }
    function xLe(t) {
        if (!t || t === "0x") return "";
        if (YZ.test(t)) return t.substring(2);
        if (fLe.test(t)) return t;
        throw new Error(`Expected hex value to convert, found '${t}'`);
    }
    function yA(t, { isLe: e = !1, isNegative: n = !1 } = {}) {
        if (!t || t === "0x") return new ht(0);
        const r = xLe(t), s = new ht(r, 16, e ? "le" : "be");
        return n ? s.fromTwos(r.length * 4) : s;
    }
    const H_ = ZZ((t, e)=>t.gt(e)), vLe = ZZ((t, e)=>t.lt(e)), ss = new ht(0), Qg = new ht(1), q3 = new ht(2), SLe = new ht(100), kLe = new ht(1e6), bx = new ht(1e9), TLe = bx.mul(bx), CLe = new ht(Number.MAX_SAFE_INTEGER), ELe = new ht(94906265);
    function $p(t) {
        return typeof t == "bigint";
    }
    function Ms(t) {
        return t ? ht.isBN(t) ? t : Fn(t) ? yA(t.toString()) : $p(t) ? new ht(t.toString()) : gLe(t) ? t.toBn() : hLe(t) ? new ht(t.toBigInt().toString()) : new ht(t) : new ht(0);
    }
    function rJ(t) {
        const e = Ms(t);
        if (e.isNeg()) throw new Error("square root of negative numbers is not supported");
        if (e.lte(CLe)) return new ht(~~Math.sqrt(e.toNumber()));
        let n = ELe.clone();
        for(;;){
            const r = e.div(n).iadd(n).ishrn(1);
            if (n.eq(r) || n.eq(r.sub(Qg))) return n;
            n = r;
        }
    }
    const ILe = {
        bitLength: -1,
        isLe: !0,
        isNegative: !1
    };
    function $l(t, { bitLength: e = -1, isLe: n = !0, isNegative: r = !1 } = ILe) {
        const s = Ms(t), i = Math.ceil(e === -1 ? s.bitLength() / 8 : (e || 0) / 8);
        if (!t) return e === -1 ? new Uint8Array(1) : new Uint8Array(i);
        const o = new Uint8Array(i), a = r ? s.toTwos(i * 8) : s;
        return o.set(a.toArray(n ? "le" : "be", i), 0), o;
    }
    function ALe(t, { bitLength: e = -1, isLe: n = !1, isNegative: r = !1 } = {}) {
        return nn($l(t, {
            bitLength: e,
            isLe: n,
            isNegative: r
        }));
    }
    const PLe = q3.pow(new ht(6)).isub(Qg), OLe = q3.pow(new ht(14)).isub(Qg), MLe = q3.pow(new ht(30)).isub(Qg), RLe = {
        bitLength: 16
    }, NLe = {
        bitLength: 32
    };
    function es(t) {
        const e = Ms(t);
        if (e.lte(PLe)) return new Uint8Array([
            e.toNumber() << 2
        ]);
        if (e.lte(OLe)) return $l(e.shln(2).iadd(Qg), RLe);
        if (e.lte(MLe)) return $l(e.shln(2).iadd(q3), NLe);
        const n = $l(e);
        let r = n.length;
        for(; n[r - 1] === 0;)r--;
        if (r < 4) throw new Error("Invalid length, previous checks match anything less than 2^30");
        return Po([
            new Uint8Array([
                (r - 4 << 2) + 3
            ]),
            n.subarray(0, r)
        ]);
    }
    function Xp(t) {
        return Po([
            es(t.length),
            t
        ]);
    }
    function W3(t) {
        const e = Dt(t);
        switch(e[0] & 3){
            case 0:
                return [
                    1,
                    new ht(e[0] >>> 2)
                ];
            case 1:
                return [
                    2,
                    new ht(e[0] + (e[1] << 8) >>> 2)
                ];
            case 2:
                return [
                    4,
                    new ht(e[0] + (e[1] << 8) + (e[2] << 16) + e[3] * 16777216 >>> 2)
                ];
            default:
                {
                    const n = (e[0] >>> 2) + 5;
                    switch(n){
                        case 5:
                            return [
                                5,
                                new ht(e[1] + (e[2] << 8) + (e[3] << 16) + e[4] * 16777216)
                            ];
                        case 6:
                            return [
                                6,
                                new ht(e[1] + (e[2] << 8) + (e[3] << 16) + (e[4] + (e[5] << 8)) * 16777216)
                            ];
                        case 7:
                            return [
                                7,
                                new ht(e[1] + (e[2] << 8) + (e[3] << 16) + (e[4] + (e[5] << 8) + (e[6] << 16)) * 16777216)
                            ];
                        default:
                            return [
                                n,
                                uu(e.subarray(1, n))
                            ];
                    }
                }
        }
    }
    function Gp(t) {
        switch(t[0] & 3){
            case 0:
                return [
                    1,
                    t[0] >>> 2
                ];
            case 1:
                return [
                    2,
                    t[0] + (t[1] << 8) >>> 2
                ];
            case 2:
                return [
                    4,
                    t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 >>> 2
                ];
            default:
                switch((t[0] >>> 2) + 5){
                    case 5:
                        return [
                            5,
                            t[1] + (t[2] << 8) + (t[3] << 16) + t[4] * 16777216
                        ];
                    case 6:
                        return [
                            6,
                            t[1] + (t[2] << 8) + (t[3] << 16) + (t[4] + (t[5] << 8)) * 16777216
                        ];
                    case 7:
                        return [
                            7,
                            t[1] + (t[2] << 8) + (t[3] << 16) + (t[4] + (t[5] << 8) + (t[6] << 16)) * 16777216
                        ];
                    default:
                        throw new Error("Compact input is > Number.MAX_SAFE_INTEGER");
                }
        }
    }
    function mx(t) {
        const [e, n] = W3(t), r = e + n.toNumber();
        return [
            r,
            t.subarray(e, r)
        ];
    }
    function VLe(t = 0, { bitLength: e = 32, isLe: n = !0 } = {}) {
        if (e !== 32 && e !== 64) throw new Error("Invalid bitLength provided, expected 32 or 64");
        const r = new Uint8Array(e / 8), s = new DataView(r.buffer, r.byteOffset);
        return e === 32 ? s.setFloat32(0, Number(t), n) : s.setFloat64(0, Number(t), n), r;
    }
    function Cy(t) {
        return typeof t == "boolean";
    }
    const UV = new RegExp("(\\d+?)(?=(\\d{3})+(?!\\d)|$)", "g");
    function sJ(t, e = ",") {
        const n = t[0].startsWith("-"), r = n ? t.substring(1).match(UV) : t.match(UV);
        return r ? `${n ? "-" : ""}${r.join(e)}` : t;
    }
    function iJ(t) {
        return {
            decimal: .1.toLocaleString(t, {
                useGrouping: !1
            }).charAt(1),
            thousand: 1e3.toLocaleString(t, {
                useGrouping: !0
            }).replace(/\d/g, "").charAt(0)
        };
    }
    const D1 = 8, Na = [
        {
            power: -24,
            text: "yocto",
            value: "y"
        },
        {
            power: -21,
            text: "zepto",
            value: "z"
        },
        {
            power: -18,
            text: "atto",
            value: "a"
        },
        {
            power: -15,
            text: "femto",
            value: "f"
        },
        {
            power: -12,
            text: "pico",
            value: "p"
        },
        {
            power: -9,
            text: "nano",
            value: "n"
        },
        {
            power: -6,
            text: "micro",
            value: "µ"
        },
        {
            power: -3,
            text: "milli",
            value: "m"
        },
        {
            power: 0,
            text: "Unit",
            value: "-"
        },
        {
            power: 3,
            text: "Kilo",
            value: "k"
        },
        {
            power: 6,
            text: "Mill",
            value: "M"
        },
        {
            power: 9,
            text: "Bill",
            value: "B"
        },
        {
            power: 12,
            text: "Tril",
            value: "T"
        },
        {
            power: 15,
            text: "Peta",
            value: "P"
        },
        {
            power: 18,
            text: "Exa",
            value: "E"
        },
        {
            power: 21,
            text: "Zeta",
            value: "Z"
        },
        {
            power: 24,
            text: "Yotta",
            value: "Y"
        }
    ];
    function oJ(t) {
        for(let e = 0, n = Na.length; e < n; e++)if (Na[e].value === t) return Na[e];
        return Na[D1];
    }
    function aJ(t, e, n) {
        if (n) return oJ(n);
        const r = D1 - 1 + Math.ceil((t.length - e) / 3);
        return Na[r] || Na[r < 0 ? 0 : Na.length - 1];
    }
    const DLe = 0, BLe = Na[D1].text;
    let ng = DLe, j_ = BLe;
    function FLe(t, { decimals: e = ng, forceUnit: n, locale: r = "en", withAll: s = !1, withSi: i = !0, withSiFull: o = !1, withUnit: a = !0, withZero: c = !0 } = {}) {
        let l = Ms(t).toString();
        if (l.length === 0 || l === "0") return "0";
        let u = "";
        l[0].startsWith("-") && (u = "-", l = l.substring(1));
        const d = aJ(l, e, n), f = l.length - (e + d.power), p = f <= 0 ? "0" : l.substring(0, f);
        let h = l.padStart(f < 0 ? e : 1, "0").substring(f < 0 ? 0 : f).padEnd(s ? Math.max(e, 4) : 4, "0").substring(0, s ? Math.max(4, e + d.power) : 4);
        if (!c) {
            let _ = h.length - 1;
            do h[_] === "0" && _--;
            while (h[_] === "0");
            h = h.substring(0, _ + 1);
        }
        const m = Cy(a) ? Na[D1].text : a, w = i || o ? d.value === "-" ? a ? ` ${m}` : "" : ` ${o ? `${d.text}${a ? " " : ""}` : d.value}${a ? m : ""}` : "", { decimal: v, thousand: k } = iJ(r);
        return `${u}${sJ(p, k)}${h && `${v}${h}`}${w}`;
    }
    const Zp = FLe;
    Zp.calcSi = (t, e = ng)=>aJ(t, e);
    Zp.findSi = oJ;
    Zp.getDefaults = ()=>({
            decimals: ng,
            unit: j_
        });
    Zp.getOptions = (t = ng)=>Na.filter(({ power: e })=>e < 0 ? t + e >= 0 : !0);
    Zp.setDefaults = ({ decimals: t, unit: e })=>{
        ng = (Array.isArray(t) ? t[0] : t) ?? ng, j_ = (Array.isArray(e) ? e[0] : e) ?? j_, Na[D1].text = j_;
    };
    function Ab(t) {
        return t.toString().padStart(2, "0");
    }
    function LLe(t) {
        const e = t.getFullYear().toString(), n = Ab(t.getMonth() + 1), r = Ab(t.getDate()), s = Ab(t.getHours()), i = Ab(t.getMinutes()), o = Ab(t.getSeconds());
        return `${e}-${n}-${r} ${s}:${i}:${o}`;
    }
    function Lk(t, { locale: e = "en" } = {}) {
        const { thousand: n } = iJ(e);
        return sJ(Ms(t).toString(), n);
    }
    function br(t) {
        return typeof t == "string" || t instanceof String;
    }
    function zLe(t) {
        for(let e = 0, n = t.length; e < n; e++){
            const r = t.charCodeAt(e);
            if (r < 32 || r > 126) return !1;
        }
        return !0;
    }
    function HV(t) {
        for(let e = 0, n = t.length; e < n; e++){
            const r = t[e] | 0;
            if (r < 32 || r > 126) return !1;
        }
        return !0;
    }
    function jV(t) {
        return br(t) ? Fn(t) ? HV(Dt(t)) : zLe(t) : t ? HV(t) : !1;
    }
    const qV = pLe("isPrototypeOf", "hasOwnProperty");
    function ULe(t, e) {
        return qV(e) && qV(t) ? t === e || t.isPrototypeOf(e) : !1;
    }
    const HLe = mA("toHex", "toHuman", "toU8a"), jLe = mA("get");
    function oa(t) {
        return HLe(t) && jLe(t.registry);
    }
    const cJ = mA("toBigInt", "toBn", "toNumber", "unwrap");
    function qLe(t, e) {
        return $p(e) ? e.toString() : e;
    }
    function vn(t, e) {
        return JSON.stringify(t, qLe, e);
    }
    function Gf(t) {
        return t === null;
    }
    function Xn(t) {
        return typeof t == "number";
    }
    function Rr(t) {
        return t === void 0;
    }
    function WLe(t) {
        if (!t) return br(t);
        const e = Dt(t), n = e.length;
        let r = 0;
        for(; r < n;)if (e[r] <= 127) r += 1;
        else if (e[r] >= 194 && e[r] <= 223) {
            if (r + 1 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 191) return !1;
            } else return !1;
            r += 2;
        } else if (e[r] === 224) {
            if (r + 2 < n) {
                if (e[r + 1] < 160 || e[r + 1] > 191 || e[r + 2] < 128 || e[r + 2] > 191) return !1;
            } else return !1;
            r += 3;
        } else if (e[r] >= 225 && e[r] <= 236) {
            if (r + 2 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 191 || e[r + 2] < 128 || e[r + 2] > 191) return !1;
            } else return !1;
            r += 3;
        } else if (e[r] === 237) {
            if (r + 2 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 159 || e[r + 2] < 128 || e[r + 2] > 191) return !1;
            } else return !1;
            r += 3;
        } else if (e[r] >= 238 && e[r] <= 239) {
            if (r + 2 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 191 || e[r + 2] < 128 || e[r + 2] > 191) return !1;
            } else return !1;
            r += 3;
        } else if (e[r] === 240) {
            if (r + 3 < n) {
                if (e[r + 1] < 144 || e[r + 1] > 191 || e[r + 2] < 128 || e[r + 2] > 191 || e[r + 3] < 128 || e[r + 3] > 191) return !1;
            } else return !1;
            r += 4;
        } else if (e[r] >= 241 && e[r] <= 243) {
            if (r + 3 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 191 || e[r + 2] < 128 || e[r + 2] > 191 || e[r + 3] < 128 || e[r + 3] > 191) return !1;
            } else return !1;
            r += 4;
        } else if (e[r] === 244) {
            if (r + 3 < n) {
                if (e[r + 1] < 128 || e[r + 1] > 143 || e[r + 2] < 128 || e[r + 2] > 191 || e[r + 3] < 128 || e[r + 3] > 191) return !1;
            } else return !1;
            r += 4;
        } else return !1;
        return !0;
    }
    function ni(t, e, n, r, s = 0) {
        const i = r ? r(e, s) : e.toString();
        let o;
        Object.defineProperty(t, i, {
            configurable: !0,
            enumerable: !0,
            get: function() {
                if (o === void 0) {
                    o = n(e, s, this);
                    try {
                        Object.defineProperty(this, i, {
                            value: o
                        });
                    } catch  {}
                }
                return o;
            }
        });
    }
    function Zf(t, e, n, r) {
        for(let s = 0, i = e.length; s < i; s++)ni(t, e[s], n, r, s);
        return t;
    }
    function Jp(t) {
        return t;
    }
    function Xl() {}
    const KLe = {
        debug: "log",
        error: "error",
        log: "log",
        warn: "warn"
    };
    function $Le(t) {
        if (t && eo(t) && t.constructor === Object) {
            const e = {};
            for (const [n, r] of Object.entries(t))e[n] = wA(r);
            return e;
        }
        return t;
    }
    function wA(t) {
        return Array.isArray(t) ? t.map(wA) : Ya(t) ? t.toString() : Bt(t) || eJ(t) ? nn(Dt(t)) : $Le(t);
    }
    function XLe(t) {
        return (e)=>{
            if (t <= 0) return e;
            const n = `${e}`;
            return n.length < t ? e : `${n.substring(0, t)} ...`;
        };
    }
    function om(t, e, n, r = -1) {
        if (n.length === 1 && Mt(n[0])) {
            const s = n[0]();
            return om(t, e, Array.isArray(s) ? s : [
                s
            ], r);
        }
        console[KLe[t]](LLe(new Date), e, ...n.map(wA).map(XLe(r)));
    }
    function GLe(t, e) {
        return !!t && (t === "*" || e === t || t.endsWith("*") && e.startsWith(t.slice(0, -1)));
    }
    function ZLe(t, e) {
        return !!t && t.startsWith("-") && (e === t.slice(1) || t.endsWith("*") && e.startsWith(t.slice(1, -1)));
    }
    function JLe(t, e) {
        let n = !1;
        for (const r of t)GLe(r, e) ? n = !0 : ZLe(r, e) && (n = !1);
        return n;
    }
    function YLe(t) {
        const e = parseInt(da.process?.env?.DEBUG_MAX || "-1", 10);
        return [
            JLe((da.process?.env?.DEBUG || "").toLowerCase().split(","), t),
            isNaN(e) ? -1 : e
        ];
    }
    function ma(t) {
        const e = `${t.toUpperCase()}:`.padStart(16), [n, r] = YLe(t.toLowerCase());
        return {
            debug: n ? (...s)=>om("debug", e, s, r) : Xl,
            error: (...s)=>om("error", e, s),
            log: (...s)=>om("log", e, s),
            noop: Xl,
            warn: (...s)=>om("warn", e, s)
        };
    }
    function QLe() {
        return "none";
    }
    function am(t, { getInstanceId: e = QLe } = {}) {
        const n = {}, r = (...s)=>{
            const i = vn(s), o = e();
            return n[o] || (n[o] = {}), n[o][i] === void 0 && (n[o][i] = t(...s)), n[o][i];
        };
        return r.unmemoize = (...s)=>{
            const i = vn(s), o = e();
            n[o]?.[i] !== void 0 && delete n[o][i];
        }, r;
    }
    function kp(t, e) {
        setTimeout(()=>{
            Promise.resolve().then(()=>{
                t();
            }).catch((n)=>{
                console.error(n);
            });
        }, 0);
    }
    function eze(t) {
        const e = Object.keys(t);
        for(let n = 0, r = e.length; n < r; n++)delete t[e[n]];
        return t;
    }
    function Ye(t, ...e) {
        const n = new Set([
            "__proto__",
            "constructor",
            "prototype"
        ]);
        for(let r = 0, s = e.length; r < s; r++){
            const i = e[r];
            if (i) if (typeof i.entries == "function") for (const [o, a] of i.entries())n.has(o) || (t[o] = a);
            else {
                const o = Object.create(null);
                for (const [a, c] of Object.entries(i))n.has(a) || (o[a] = c);
                Object.assign(t, o);
            }
        }
        return t;
    }
    function _A(t, e, n, r, s = 0) {
        const i = e;
        i in t || Object.defineProperty(t, i, {
            enumerable: !0,
            get: function() {
                return n(e, s, this);
            }
        });
    }
    function Vd(t, e, n, r) {
        for(let s = 0, i = e.length; s < i; s++)_A(t, e[s], n, r, s);
    }
    const rg = new Array(256), lJ = new Array(256);
    for(let t = 0, e = rg.length; t < e; t++)lJ[t] = String.fromCharCode(t).toLowerCase(), rg[t] = String.fromCharCode(t).toUpperCase();
    function tze(t) {
        return t.slice(0, t.length - 1).toLowerCase() + rg[t.charCodeAt(t.length - 1)];
    }
    function uJ(t) {
        return (e)=>{
            const n = e.replace(/[-_., ]+/g, " ").trim().split(" ");
            let r = "";
            for(let s = 0, i = n.length; s < i; s++){
                const o = n[s];
                r += t(/^[\dA-Z]+$/.test(o) ? o.toLowerCase() : o.replace(/^[\dA-Z]{2,}[^a-z]/, tze), s);
            }
            return r;
        };
    }
    const tr = uJ((t, e)=>(e ? rg[t.charCodeAt(0)] : lJ[t.charCodeAt(0)]) + t.slice(1)), xA = uJ((t)=>rg[t.charCodeAt(0)] + t.slice(1));
    function nze(t) {
        return (e)=>e ? t[e.charCodeAt(0)] + e.slice(1) : "";
    }
    const rze = nze(rg);
    function dJ(t) {
        return nn(ja(t));
    }
    const WV = {
        name: "@polkadot/api",
        path: import.meta && self.location.href ? new URL(self.location.href).pathname.substring(0, new URL(self.location.href).pathname.lastIndexOf("/") + 1) : "auto",
        version: "16.5.6"
    }, sze = da.crypto;
    function ize(t) {
        return sze.getRandomValues(t);
    }
    const q_ = {
        getRandomValues: ize
    }, oze = {
        crypto: q_
    };
    class aze {
        #e;
        constructor(e){
            this.#e = e;
        }
        abort = ()=>{
            throw new Error("abort");
        };
        __wbindgen_is_undefined = (e)=>this.#e.getObject(e) === void 0;
        __wbindgen_throw = (e, n)=>{
            throw new Error(this.#e.getString(e, n));
        };
        __wbg_self_1b7a39e3a92c949c = ()=>this.#e.addObject(oze);
        __wbg_require_604837428532a733 = (e, n)=>{
            throw new Error(`Unable to require ${this.#e.getString(e, n)}`);
        };
        __wbg_crypto_968f1772287e2df0 = (e)=>this.#e.addObject(q_);
        __wbg_getRandomValues_a3d34b4fee3c2869 = (e)=>this.#e.addObject(q_.getRandomValues);
        __wbg_getRandomValues_f5e14ab7ac8e995d = (e, n, r)=>{
            q_.getRandomValues(this.#e.getU8a(n, r));
        };
        __wbg_randomFillSync_d5bd2d655fdf256a = (e, n, r)=>{
            throw new Error("randomFillsync is not available");
        };
        __wbindgen_object_drop_ref = (e)=>{
            this.#e.takeObject(e);
        };
    }
    class cze {
        #e;
        #t;
        #n;
        #r;
        #s;
        #i;
        #o;
        #a;
        #l;
        #f;
        constructor(e){
            this.#e = e, this.#r = null, this.#s = null, this.#t = new Array(32).fill(void 0).concat(void 0, null, !0, !1), this.#i = this.#t.length, this.#f = "none", this.#o = null, this.#a = null, this.#l = null, this.#n = {
                ...new aze(this)
            };
        }
        get error() {
            return this.#a;
        }
        get type() {
            return this.#f;
        }
        get wasm() {
            return this.#o;
        }
        async init(e) {
            (!this.#l || e) && (this.#l = (e || this.#e)(this.#n));
            const { error: n, type: r, wasm: s } = await this.#l;
            return this.#f = r, this.#o = s, this.#a = n, this.#o;
        }
        getObject(e) {
            return this.#t[e];
        }
        dropObject(e) {
            e < 36 || (this.#t[e] = this.#i, this.#i = e);
        }
        takeObject(e) {
            const n = this.getObject(e);
            return this.dropObject(e), n;
        }
        addObject(e) {
            this.#i === this.#t.length && this.#t.push(this.#t.length + 1);
            const n = this.#i;
            return this.#i = this.#t[n], this.#t[n] = e, n;
        }
        getInt32() {
            return (this.#r === null || this.#r.buffer !== this.#o.memory.buffer) && (this.#r = new Int32Array(this.#o.memory.buffer)), this.#r;
        }
        getUint8() {
            return (this.#s === null || this.#s.buffer !== this.#o.memory.buffer) && (this.#s = new Uint8Array(this.#o.memory.buffer)), this.#s;
        }
        getU8a(e, n) {
            return this.getUint8().subarray(e / 1, e / 1 + n);
        }
        getString(e, n) {
            return Kl(this.getU8a(e, n));
        }
        allocU8a(e) {
            const n = this.#o.__wbindgen_malloc(e.length * 1);
            return this.getUint8().set(e, n / 1), [
                n,
                e.length
            ];
        }
        allocString(e) {
            return this.allocU8a(ja(e));
        }
        resultU8a() {
            const e = this.getInt32()[2], n = this.getInt32()[8 / 4 + 1], r = this.getU8a(e, n).slice();
            return this.#o.__wbindgen_free(e, n * 1), r;
        }
        resultString() {
            return Kl(this.resultU8a());
        }
    }
    function lze(t, e, n) {
        return async (r)=>{
            const s = {
                error: null,
                type: "none",
                wasm: null
            };
            try {
                if (e?.length) {
                    if (typeof WebAssembly != "object" || typeof WebAssembly.instantiate != "function") throw new Error("WebAssembly is not available in your environment");
                } else throw new Error("No WebAssembly provided for initialization");
                const i = await WebAssembly.instantiate(e, {
                    wbg: r
                });
                s.wasm = i.instance.exports, s.type = "wasm";
            } catch (i) {
                s.error = `FATAL: Unable to initialize @polkadot/wasm-${t}:: ${i.message}`, console.error(s.error);
            }
            return s;
        };
    }
    const KV = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", fJ = new Array(256);
    for(let t = 0, e = KV.length; t < e; t++)fJ[KV.charCodeAt(t)] = t;
    function uze(t, e) {
        let n = 0, r = 0, s = -1;
        for(let i = 0, o = e.length - 1; s !== o; i++)n = n << 6 | fJ[t.charCodeAt(i)], (r += 6) >= 8 && (e[++s] = n >>> (r -= 8) & 255);
        return e;
    }
    const Ic = Uint8Array, Jf = Uint16Array, zk = Uint32Array, dze = new Ic([
        16,
        17,
        18,
        0,
        8,
        7,
        9,
        6,
        10,
        5,
        11,
        4,
        12,
        3,
        13,
        2,
        14,
        1,
        15
    ]), pJ = new Ic([
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        1,
        1,
        1,
        2,
        2,
        2,
        2,
        3,
        3,
        3,
        3,
        4,
        4,
        4,
        4,
        5,
        5,
        5,
        5,
        0,
        0,
        0,
        0
    ]), hJ = new Ic([
        0,
        0,
        0,
        0,
        1,
        1,
        2,
        2,
        3,
        3,
        4,
        4,
        5,
        5,
        6,
        6,
        7,
        7,
        8,
        8,
        9,
        9,
        10,
        10,
        11,
        11,
        12,
        12,
        13,
        13,
        0,
        0
    ]), gJ = (t, e)=>{
        const n = new Jf(31);
        for(let s = 0; s < 31; ++s)n[s] = e += 1 << t[s - 1];
        const r = new zk(n[30]);
        for(let s = 1; s < 30; ++s)for(let i = n[s]; i < n[s + 1]; ++i)r[i] = i - n[s] << 5 | s;
        return [
            n,
            r
        ];
    }, [bJ, fze] = gJ(pJ, 2);
    bJ[28] = 258, fze[258] = 28;
    const [pze] = gJ(hJ, 0), mJ = new Jf(32768);
    for(let t = 0; t < 32768; ++t){
        let e = (t & 43690) >>> 1 | (t & 21845) << 1;
        e = (e & 52428) >>> 2 | (e & 13107) << 2, e = (e & 61680) >>> 4 | (e & 3855) << 4, mJ[t] = ((e & 65280) >>> 8 | (e & 255) << 8) >>> 1;
    }
    const Em = ((t, e, n)=>{
        const r = t.length;
        let s = 0;
        const i = new Jf(e);
        for(; s < r; ++s)t[s] && ++i[t[s] - 1];
        const o = new Jf(e);
        for(s = 1; s < e; ++s)o[s] = o[s - 1] + i[s - 1] << 1;
        let a;
        {
            a = new Jf(1 << e);
            const c = 15 - e;
            for(s = 0; s < r; ++s)if (t[s]) {
                const l = s << 4 | t[s], u = e - t[s];
                let d = o[t[s] - 1]++ << u;
                for(const f = d | (1 << u) - 1; d <= f; ++d)a[mJ[d] >> c] = l;
            }
        }
        return a;
    }), B1 = new Ic(288);
    for(let t = 0; t < 144; ++t)B1[t] = 8;
    for(let t = 144; t < 256; ++t)B1[t] = 9;
    for(let t = 256; t < 280; ++t)B1[t] = 7;
    for(let t = 280; t < 288; ++t)B1[t] = 8;
    const yJ = new Ic(32);
    for(let t = 0; t < 32; ++t)yJ[t] = 5;
    const hze = Em(B1, 9), gze = Em(yJ, 5), va = (t, e, n)=>{
        const r = e >>> 3;
        return (t[r] | t[r + 1] << 8) >>> (e & 7) & n;
    }, dS = (t, e)=>{
        const n = e >>> 3;
        return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) >>> (e & 7);
    }, bze = (t)=>(t >>> 3) + (t & 7 && 1), mze = (t, e, n)=>{
        (n == null || n > t.length) && (n = t.length);
        const r = new (t instanceof Jf ? Jf : t instanceof zk ? zk : Ic)(n - e);
        return r.set(t.subarray(e, n)), r;
    }, fS = (t)=>{
        let e = t[0];
        for(let n = 1, r = t.length; n < r; ++n)t[n] > e && (e = t[n]);
        return e;
    }, yze = (t, e, n)=>{
        const r = !n || n.i;
        n || (n = {});
        const s = t.length, i = !e || !r;
        e || (e = new Ic(s * 3));
        const o = (m)=>{
            let w = e.length;
            if (m > w) {
                const v = new Ic(Math.max(w << 1, m));
                v.set(e), e = v;
            }
        };
        let a = n.f || 0, c = n.p || 0, l = n.b || 0, u = n.l, d = n.d, f = n.m, p = n.n;
        if (a && !u) return e;
        const h = s << 3;
        do {
            if (!u) {
                n.f = a = va(t, c, 1);
                const k = va(t, c + 1, 3);
                if (c += 3, k) if (k == 1) u = hze, d = gze, f = 9, p = 5;
                else if (k == 2) {
                    const _ = va(t, c, 31) + 257, A = va(t, c + 10, 15) + 4, P = _ + va(t, c + 5, 31) + 1;
                    c += 14;
                    const U = new Ic(P), K = new Ic(19);
                    for(let M = 0; M < A; ++M)K[dze[M]] = va(t, c + M * 3, 7);
                    c += A * 3;
                    const X = fS(K), G = (1 << X) - 1;
                    if (!r && c + P * (X + 7) > h) break;
                    const ce = Em(K, X);
                    for(let M = 0; M < P;){
                        const g = ce[va(t, c, G)];
                        c += g & 15;
                        const y = g >>> 4;
                        if (y < 16) U[M++] = y;
                        else {
                            let C = 0, R = 0;
                            for(y == 16 ? (R = 3 + va(t, c, 3), c += 2, C = U[M - 1]) : y == 17 ? (R = 3 + va(t, c, 7), c += 3) : y == 18 && (R = 11 + va(t, c, 127), c += 7); R--;)U[M++] = C;
                        }
                    }
                    const ie = U.subarray(0, _), Y = U.subarray(_);
                    f = fS(ie), p = fS(Y), u = Em(ie, f), d = Em(Y, p);
                } else throw "invalid block type";
                else {
                    const _ = bze(c) + 4, A = t[_ - 4] | t[_ - 3] << 8, P = _ + A;
                    if (P > s) {
                        if (r) throw "unexpected EOF";
                        break;
                    }
                    i && o(l + A), e.set(t.subarray(_, P), l), n.b = l += A, n.p = c = P << 3;
                    continue;
                }
                if (c > h) throw "unexpected EOF";
            }
            i && o(l + 131072);
            const m = (1 << f) - 1, w = (1 << p) - 1, v = f + p + 18;
            for(; r || c + v < h;){
                const k = u[dS(t, c) & m], _ = k >>> 4;
                if (c += k & 15, c > h) throw "unexpected EOF";
                if (!k) throw "invalid length/literal";
                if (_ < 256) e[l++] = _;
                else if (_ == 256) {
                    u = void 0;
                    break;
                } else {
                    let A = _ - 254;
                    if (_ > 264) {
                        const G = _ - 257, ce = pJ[G];
                        A = va(t, c, (1 << ce) - 1) + bJ[G], c += ce;
                    }
                    const P = d[dS(t, c) & w], U = P >>> 4;
                    if (!P) throw "invalid distance";
                    c += P & 15;
                    let K = pze[U];
                    if (U > 3) {
                        const G = hJ[U];
                        K += dS(t, c) & (1 << G) - 1, c += G;
                    }
                    if (c > h) throw "unexpected EOF";
                    i && o(l + 131072);
                    const X = l + A;
                    for(; l < X; l += 4)e[l] = e[l - K], e[l + 1] = e[l + 1 - K], e[l + 2] = e[l + 2 - K], e[l + 3] = e[l + 3 - K];
                    l = X;
                }
            }
            n.l = u, n.p = c, n.b = l, u && (a = 1, n.m = f, n.d = d, n.n = p);
        }while (!a);
        return l == e.length ? e : mze(e, 0, l);
    }, wze = (t)=>{
        if ((t[0] & 15) != 8 || t[0] >>> 4 > 7 || (t[0] << 8 | t[1]) % 31) throw "invalid zlib data";
        if (t[1] & 32) throw "invalid zlib data: preset dictionaries not supported";
    };
    function _ze(t, e) {
        return yze((wze(t), t.subarray(2, -4)), e);
    }
    var Pb = {}, $V;
    function xze() {
        return $V || ($V = 1, Pb.lenIn = 168782, Pb.lenOut = 335277, Pb.bytes = " "), Pb;
    }
    var pS = xze();
    const vze = _ze(uze(pS.bytes, new Uint8Array(pS.lenIn)), new Uint8Array(pS.lenOut)), Sze = lze("crypto", vze), Ci = new cze(Sze);
    async function kze(t) {
        return Ci.init(t);
    }
    function F1(t) {
        return (...e)=>{
            if (!Ci.wasm) throw new Error("The WASM interface has not been initialized. Ensure that you wait for the initialization Promise with waitReady() from @polkadot/wasm-crypto (or cryptoWaitReady() from @polkadot/util-crypto) before attempting to use WASM-only interfaces.");
            return t(Ci.wasm, ...e);
        };
    }
    const Tze = F1((t, e)=>(t.ext_secp_pub_expand(8, ...Ci.allocU8a(e)), Ci.resultU8a())), Cze = F1((t, e, n, r)=>(t.ext_blake2b(8, ...Ci.allocU8a(e), ...Ci.allocU8a(n), r), Ci.resultU8a())), Eze = F1((t, e)=>(t.ext_keccak256(8, ...Ci.allocU8a(e)), Ci.resultU8a())), Ize = F1((t, e)=>(t.ext_keccak512(8, ...Ci.allocU8a(e)), Ci.resultU8a())), Aze = F1((t, e, n)=>(t.ext_twox(8, ...Ci.allocU8a(e), n), Ci.resultU8a()));
    function L1() {
        return !!Ci.wasm;
    }
    async function Pze() {
        try {
            return !!await kze();
        } catch  {
            return !1;
        }
    }
    function Oze() {
        return Pze().then(()=>{
            if (!L1()) throw new Error("Unable to initialize @polkadot/util-crypto");
            return !0;
        }).catch(()=>!1);
    }
    function Mze(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function wJ(t, e) {
        return Array.isArray(e) ? e.length === 0 ? !0 : t ? e.every((n)=>typeof n == "string") : e.every((n)=>Number.isSafeInteger(n)) : !1;
    }
    function Uk(t, e) {
        if (typeof e != "string") throw new Error(`${t}: string expected`);
        return !0;
    }
    function _J(t) {
        if (!Number.isSafeInteger(t)) throw new Error(`invalid integer: ${t}`);
    }
    function Hk(t) {
        if (!Array.isArray(t)) throw new Error("array expected");
    }
    function xJ(t, e) {
        if (!wJ(!0, e)) throw new Error(`${t}: array of strings expected`);
    }
    function Rze(t, e) {
        if (!wJ(!1, e)) throw new Error(`${t}: array of numbers expected`);
    }
    function Nze(...t) {
        const e = (i)=>i, n = (i, o)=>(a)=>i(o(a)), r = t.map((i)=>i.encode).reduceRight(n, e), s = t.map((i)=>i.decode).reduce(n, e);
        return {
            encode: r,
            decode: s
        };
    }
    function Vze(t) {
        const e = typeof t == "string" ? t.split("") : t, n = e.length;
        xJ("alphabet", e);
        const r = new Map(e.map((s, i)=>[
                s,
                i
            ]));
        return {
            encode: (s)=>(Hk(s), s.map((i)=>{
                    if (!Number.isSafeInteger(i) || i < 0 || i >= n) throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${t}`);
                    return e[i];
                })),
            decode: (s)=>(Hk(s), s.map((i)=>{
                    Uk("alphabet.decode", i);
                    const o = r.get(i);
                    if (o === void 0) throw new Error(`Unknown letter: "${i}". Allowed: ${t}`);
                    return o;
                }))
        };
    }
    function Dze(t = "") {
        return Uk("join", t), {
            encode: (e)=>(xJ("join.decode", e), e.join(t)),
            decode: (e)=>(Uk("join.decode", e), e.split(t))
        };
    }
    function XV(t, e, n) {
        if (e < 2) throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);
        if (n < 2) throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);
        if (Hk(t), !t.length) return [];
        let r = 0;
        const s = [], i = Array.from(t, (a)=>{
            if (_J(a), a < 0 || a >= e) throw new Error(`invalid integer: ${a}`);
            return a;
        }), o = i.length;
        for(;;){
            let a = 0, c = !0;
            for(let l = r; l < o; l++){
                const u = i[l], d = e * a, f = d + u;
                if (!Number.isSafeInteger(f) || d / e !== a || f - u !== d) throw new Error("convertRadix: carry overflow");
                const p = f / n;
                a = f % n;
                const h = Math.floor(p);
                if (i[l] = h, !Number.isSafeInteger(h) || h * n + a !== f) throw new Error("convertRadix: carry overflow");
                if (c) h ? c = !1 : r = l;
                else continue;
            }
            if (s.push(a), c) break;
        }
        for(let a = 0; a < t.length - 1 && t[a] === 0; a++)s.push(0);
        return s.reverse();
    }
    function Bze(t) {
        _J(t);
        const e = 2 ** 8;
        return {
            encode: (n)=>{
                if (!Mze(n)) throw new Error("radix.encode input should be Uint8Array");
                return XV(Array.from(n), e, t);
            },
            decode: (n)=>(Rze("radix.decode", n), Uint8Array.from(XV(n, t, e)))
        };
    }
    const Fze = (t)=>Nze(Bze(58), Vze(t), Dze("")), Lze = Fze("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
    function zze({ coder: t, ipfs: e }, n) {
        return (r, s)=>(n(r, s), t.decode(s ? r.substring(1) : r));
    }
    function Uze({ coder: t, ipfs: e }) {
        return (n, r)=>{
            const s = t.encode(Dt(n));
            return e && r ? `${e}${s}` : s;
        };
    }
    function Hze({ chars: t, ipfs: e, type: n, withPadding: r }) {
        return (s, i)=>{
            if (typeof s != "string") throw new Error(`Expected ${n} string input`);
            if (i && !s.startsWith(e)) throw new Error(`Expected ipfs-compatible ${n} to start with '${e}'`);
            for(let o = i ? 1 : 0, a = s.length; o < a; o++)if (!t.includes(s[o])) if (r && s[o] === "=") {
                if (o !== a - 1) {
                    if (s[o + 1] !== "=") throw new Error(`Invalid ${n} padding sequence "${s[o]}${s[o + 1]}" at index ${o}`);
                }
            } else throw new Error(`Invalid ${n} character "${s[o]}" (0x${s.charCodeAt(o).toString(16)}) at index ${o}`);
            return !0;
        };
    }
    const vA = {
        chars: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",
        coder: Lze,
        ipfs: "z",
        type: "base58"
    }, jze = Hze(vA), qze = zze(vA, jze), Wze = Uze(vA);
    function Kze(t) {
        return (...e)=>nn(t(...e));
    }
    function $ze(t, e) {
        return (n, r = 256, s)=>{
            const i = Dt(n);
            return !j3 || !s && L1() ? t[r](i) : e[r](i);
        };
    }
    function Gl(t, e = 256, n, r) {
        const s = Math.ceil(e / 8), i = Dt(t);
        return !j3 || !r && L1() ? Cze(i, Dt(n), s) : n ? UO(i, {
            dkLen: s,
            key: n
        }) : UO(i, {
            dkLen: s
        });
    }
    const cm = Kze(Gl), Xze = ja("SS58PRE");
    function vJ(t) {
        return Gl(Ai(Xze, t), 512);
    }
    function Gze(t) {
        const e = t[0] & 64 ? 2 : 1, n = e === 1 ? t[0] : (t[0] & 63) << 2 | t[1] >> 6 | (t[1] & 63) << 8, r = [
            34 + e,
            35 + e
        ].includes(t.length), s = t.length - (r ? 2 : 1), i = vJ(t.subarray(0, s));
        return [
            (t[0] & 128) === 0 && ![
                46,
                47
            ].includes(t[0]) && (r ? t[t.length - 2] === i[0] && t[t.length - 1] === i[1] : t[t.length - 1] === i[0]),
            s,
            e,
            n
        ];
    }
    const Zze = [
        {
            prefix: 0,
            network: "polkadot",
            displayName: "Polkadot Relay Chain",
            symbols: [
                "DOT"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://polkadot.network"
        },
        {
            prefix: 1,
            network: "BareSr25519",
            displayName: "Bare 32-bit Schnorr/Ristretto (S/R 25519) public key.",
            symbols: [],
            decimals: [],
            standardAccount: "Sr25519",
            website: null
        },
        {
            prefix: 2,
            network: "kusama",
            displayName: "Kusama Relay Chain",
            symbols: [
                "KSM"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://kusama.network"
        },
        {
            prefix: 3,
            network: "BareEd25519",
            displayName: "Bare 32-bit Ed25519 public key.",
            symbols: [],
            decimals: [],
            standardAccount: "Ed25519",
            website: null
        },
        {
            prefix: 4,
            network: "katalchain",
            displayName: "Katal Chain",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: null
        },
        {
            prefix: 5,
            network: "astar",
            displayName: "Astar Network",
            symbols: [
                "ASTR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://astar.network"
        },
        {
            prefix: 6,
            network: "bifrost",
            displayName: "Bifrost",
            symbols: [
                "BNC"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://bifrost.finance/"
        },
        {
            prefix: 7,
            network: "edgeware",
            displayName: "Edgeware",
            symbols: [
                "EDG"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://edgewa.re"
        },
        {
            prefix: 8,
            network: "karura",
            displayName: "Karura",
            symbols: [
                "KAR"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://karura.network/"
        },
        {
            prefix: 9,
            network: "reynolds",
            displayName: "Laminar Reynolds Canary",
            symbols: [
                "REY"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "http://laminar.network/"
        },
        {
            prefix: 10,
            network: "acala",
            displayName: "Acala",
            symbols: [
                "ACA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://acala.network/"
        },
        {
            prefix: 11,
            network: "laminar",
            displayName: "Laminar",
            symbols: [
                "LAMI"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "http://laminar.network/"
        },
        {
            prefix: 12,
            network: "polymesh",
            displayName: "Polymesh",
            symbols: [
                "POLYX"
            ],
            decimals: [
                6
            ],
            standardAccount: "*25519",
            website: "https://polymath.network/"
        },
        {
            prefix: 13,
            network: "integritee",
            displayName: "Integritee",
            symbols: [
                "TEER"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://integritee.network"
        },
        {
            prefix: 14,
            network: "totem",
            displayName: "Totem",
            symbols: [
                "TOTEM"
            ],
            decimals: [
                0
            ],
            standardAccount: "*25519",
            website: "https://totemaccounting.com"
        },
        {
            prefix: 15,
            network: "synesthesia",
            displayName: "Synesthesia",
            symbols: [
                "SYN"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://synesthesia.network/"
        },
        {
            prefix: 16,
            network: "kulupu",
            displayName: "Kulupu",
            symbols: [
                "KLP"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://kulupu.network/"
        },
        {
            prefix: 17,
            network: "dark",
            displayName: "Dark Mainnet",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: null
        },
        {
            prefix: 18,
            network: "darwinia",
            displayName: "Darwinia Network",
            symbols: [
                "RING"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://darwinia.network"
        },
        {
            prefix: 19,
            network: "watr",
            displayName: "Watr Protocol",
            symbols: [
                "WATR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://www.watr.org"
        },
        {
            prefix: 20,
            network: "stafi",
            displayName: "Stafi",
            symbols: [
                "FIS"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://stafi.io"
        },
        {
            prefix: 21,
            network: "karmachain",
            displayName: "Karmacoin",
            symbols: [
                "KCOIN"
            ],
            decimals: [
                6
            ],
            standardAccount: "*25519",
            website: "https://karmaco.in"
        },
        {
            prefix: 22,
            network: "dock-pos-mainnet",
            displayName: "Dock Mainnet",
            symbols: [
                "DCK"
            ],
            decimals: [
                6
            ],
            standardAccount: "*25519",
            website: "https://dock.io"
        },
        {
            prefix: 23,
            network: "shift",
            displayName: "ShiftNrg",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: null
        },
        {
            prefix: 24,
            network: "zero",
            displayName: "ZERO",
            symbols: [
                "ZERO"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://zero.io"
        },
        {
            prefix: 25,
            network: "zero-alphaville",
            displayName: "ZERO Alphaville",
            symbols: [
                "ZERO"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://zero.io"
        },
        {
            prefix: 26,
            network: "jupiter",
            displayName: "Jupiter",
            symbols: [
                "jDOT"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://jupiter.patract.io"
        },
        {
            prefix: 27,
            network: "kabocha",
            displayName: "Kabocha",
            symbols: [
                "KAB"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://kabocha.network"
        },
        {
            prefix: 28,
            network: "subsocial",
            displayName: "Subsocial",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: null
        },
        {
            prefix: 29,
            network: "cord",
            displayName: "CORD Network",
            symbols: [
                "DHI",
                "WAY"
            ],
            decimals: [
                12,
                12
            ],
            standardAccount: "*25519",
            website: "https://cord.network/"
        },
        {
            prefix: 30,
            network: "phala",
            displayName: "Phala Network",
            symbols: [
                "PHA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://phala.network"
        },
        {
            prefix: 31,
            network: "litentry",
            displayName: "Litentry Network",
            symbols: [
                "LIT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://litentry.com/"
        },
        {
            prefix: 32,
            network: "robonomics",
            displayName: "Robonomics",
            symbols: [
                "XRT"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://robonomics.network"
        },
        {
            prefix: 33,
            network: "datahighway",
            displayName: "DataHighway",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: null
        },
        {
            prefix: 34,
            network: "ares",
            displayName: "Ares Protocol",
            symbols: [
                "ARES"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://www.aresprotocol.com/"
        },
        {
            prefix: 35,
            network: "vln",
            displayName: "Valiu Liquidity Network",
            symbols: [
                "USDv"
            ],
            decimals: [
                15
            ],
            standardAccount: "*25519",
            website: "https://valiu.com/"
        },
        {
            prefix: 36,
            network: "centrifuge",
            displayName: "Centrifuge Chain",
            symbols: [
                "CFG"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://centrifuge.io/"
        },
        {
            prefix: 37,
            network: "nodle",
            displayName: "Nodle Chain",
            symbols: [
                "NODL"
            ],
            decimals: [
                11
            ],
            standardAccount: "*25519",
            website: "https://nodle.io/"
        },
        {
            prefix: 38,
            network: "kilt",
            displayName: "KILT Spiritnet",
            symbols: [
                "KILT"
            ],
            decimals: [
                15
            ],
            standardAccount: "*25519",
            website: "https://kilt.io/"
        },
        {
            prefix: 39,
            network: "mathchain",
            displayName: "MathChain mainnet",
            symbols: [
                "MATH"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://mathwallet.org"
        },
        {
            prefix: 40,
            network: "mathchain-testnet",
            displayName: "MathChain testnet",
            symbols: [
                "MATH"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://mathwallet.org"
        },
        {
            prefix: 41,
            network: "polimec",
            displayName: "Polimec Protocol",
            symbols: [
                "PLMC"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://www.polimec.org/"
        },
        {
            prefix: 42,
            network: "substrate",
            displayName: "Substrate",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: "https://substrate.io/"
        },
        {
            prefix: 43,
            network: "BareSecp256k1",
            displayName: "Bare 32-bit ECDSA SECP-256k1 public key.",
            symbols: [],
            decimals: [],
            standardAccount: "secp256k1",
            website: null
        },
        {
            prefix: 44,
            network: "chainx",
            displayName: "ChainX",
            symbols: [
                "PCX"
            ],
            decimals: [
                8
            ],
            standardAccount: "*25519",
            website: "https://chainx.org/"
        },
        {
            prefix: 45,
            network: "uniarts",
            displayName: "UniArts Network",
            symbols: [
                "UART",
                "UINK"
            ],
            decimals: [
                12,
                12
            ],
            standardAccount: "*25519",
            website: "https://uniarts.me"
        },
        {
            prefix: 46,
            network: "reserved46",
            displayName: "This prefix is reserved.",
            symbols: [],
            decimals: [],
            standardAccount: null,
            website: null
        },
        {
            prefix: 47,
            network: "reserved47",
            displayName: "This prefix is reserved.",
            symbols: [],
            decimals: [],
            standardAccount: null,
            website: null
        },
        {
            prefix: 48,
            network: "neatcoin",
            displayName: "Neatcoin Mainnet",
            symbols: [
                "NEAT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://neatcoin.org"
        },
        {
            prefix: 49,
            network: "picasso",
            displayName: "Picasso",
            symbols: [
                "PICA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://picasso.composable.finance"
        },
        {
            prefix: 50,
            network: "composable",
            displayName: "Composable Finance",
            symbols: [
                "LAYR"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://composable.finance"
        },
        {
            prefix: 51,
            network: "oak",
            displayName: "OAK Network",
            symbols: [
                "OAK",
                "TUR"
            ],
            decimals: [
                10,
                10
            ],
            standardAccount: "*25519",
            website: "https://oak.tech"
        },
        {
            prefix: 52,
            network: "KICO",
            displayName: "KICO",
            symbols: [
                "KICO"
            ],
            decimals: [
                14
            ],
            standardAccount: "*25519",
            website: "https://dico.io"
        },
        {
            prefix: 53,
            network: "DICO",
            displayName: "DICO",
            symbols: [
                "DICO"
            ],
            decimals: [
                14
            ],
            standardAccount: "*25519",
            website: "https://dico.io"
        },
        {
            prefix: 54,
            network: "cere",
            displayName: "Cere Network",
            symbols: [
                "CERE"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://cere.network"
        },
        {
            prefix: 55,
            network: "xxnetwork",
            displayName: "xx network",
            symbols: [
                "XX"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://xx.network"
        },
        {
            prefix: 56,
            network: "pendulum",
            displayName: "Pendulum chain",
            symbols: [
                "PEN"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://pendulumchain.org/"
        },
        {
            prefix: 57,
            network: "amplitude",
            displayName: "Amplitude chain",
            symbols: [
                "AMPE"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://pendulumchain.org/"
        },
        {
            prefix: 58,
            network: "eternal-civilization",
            displayName: "Eternal Civilization",
            symbols: [
                "ECC"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "http://www.ysknfr.cn/"
        },
        {
            prefix: 63,
            network: "hydradx",
            displayName: "Hydration",
            symbols: [
                "HDX"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://hydration.net"
        },
        {
            prefix: 65,
            network: "aventus",
            displayName: "Aventus Mainnet",
            symbols: [
                "AVT"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://aventus.io"
        },
        {
            prefix: 66,
            network: "crust",
            displayName: "Crust Network",
            symbols: [
                "CRU"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://crust.network"
        },
        {
            prefix: 67,
            network: "genshiro",
            displayName: "Genshiro Network",
            symbols: [
                "GENS",
                "EQD",
                "LPT0"
            ],
            decimals: [
                9,
                9,
                9
            ],
            standardAccount: "*25519",
            website: "https://genshiro.equilibrium.io"
        },
        {
            prefix: 68,
            network: "equilibrium",
            displayName: "Equilibrium Network",
            symbols: [
                "EQ"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://equilibrium.io"
        },
        {
            prefix: 69,
            network: "sora",
            displayName: "SORA Network",
            symbols: [
                "XOR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://sora.org"
        },
        {
            prefix: 71,
            network: "p3d",
            displayName: "3DP network",
            symbols: [
                "P3D"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://3dpass.org"
        },
        {
            prefix: 72,
            network: "p3dt",
            displayName: "3DP test network",
            symbols: [
                "P3Dt"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://3dpass.org"
        },
        {
            prefix: 73,
            network: "zeitgeist",
            displayName: "Zeitgeist",
            symbols: [
                "ZTG"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://zeitgeist.pm"
        },
        {
            prefix: 77,
            network: "manta",
            displayName: "Manta network",
            symbols: [
                "MANTA"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://manta.network"
        },
        {
            prefix: 78,
            network: "calamari",
            displayName: "Calamari: Manta Canary Network",
            symbols: [
                "KMA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://manta.network"
        },
        {
            prefix: 81,
            network: "sora_dot_para",
            displayName: "SORA Polkadot Parachain",
            symbols: [
                "XOR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://sora.org"
        },
        {
            prefix: 88,
            network: "polkadex",
            displayName: "Polkadex Mainnet",
            symbols: [
                "PDEX"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://polkadex.trade"
        },
        {
            prefix: 89,
            network: "polkadexparachain",
            displayName: "Polkadex Parachain",
            symbols: [
                "PDEX"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://polkadex.trade"
        },
        {
            prefix: 90,
            network: "frequency",
            displayName: "Frequency",
            symbols: [
                "FRQCY"
            ],
            decimals: [
                8
            ],
            standardAccount: "*25519",
            website: "https://www.frequency.xyz"
        },
        {
            prefix: 92,
            network: "anmol",
            displayName: "Anmol Network",
            symbols: [
                "ANML"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://anmol.network/"
        },
        {
            prefix: 93,
            network: "fragnova",
            displayName: "Fragnova Network",
            symbols: [
                "NOVA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://fragnova.com"
        },
        {
            prefix: 98,
            network: "polkasmith",
            displayName: "PolkaSmith Canary Network",
            symbols: [
                "PKS"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://polkafoundry.com"
        },
        {
            prefix: 99,
            network: "polkafoundry",
            displayName: "PolkaFoundry Network",
            symbols: [
                "PKF"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://polkafoundry.com"
        },
        {
            prefix: 100,
            network: "ibtida",
            displayName: "Anmol Network Ibtida Canary network",
            symbols: [
                "IANML"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://anmol.network/"
        },
        {
            prefix: 101,
            network: "origintrail-parachain",
            displayName: "OriginTrail Parachain",
            symbols: [
                "OTP"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://parachain.origintrail.io/"
        },
        {
            prefix: 105,
            network: "pontem-network",
            displayName: "Pontem Network",
            symbols: [
                "PONT"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://pontem.network"
        },
        {
            prefix: 110,
            network: "heiko",
            displayName: "Heiko",
            symbols: [
                "HKO"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://parallel.fi/"
        },
        {
            prefix: 113,
            network: "integritee-incognito",
            displayName: "Integritee Incognito",
            symbols: [],
            decimals: [],
            standardAccount: "*25519",
            website: "https://integritee.network"
        },
        {
            prefix: 117,
            network: "tinker",
            displayName: "Tinker",
            symbols: [
                "TNKR"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://invarch.network"
        },
        {
            prefix: 126,
            network: "joystream",
            displayName: "Joystream",
            symbols: [
                "JOY"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://www.joystream.org"
        },
        {
            prefix: 128,
            network: "clover",
            displayName: "Clover Finance",
            symbols: [
                "CLV"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://clover.finance"
        },
        {
            prefix: 129,
            network: "dorafactory-polkadot",
            displayName: "Dorafactory Polkadot Network",
            symbols: [
                "DORA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://dorafactory.org"
        },
        {
            prefix: 131,
            network: "litmus",
            displayName: "Litmus Network",
            symbols: [
                "LIT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://litentry.com/"
        },
        {
            prefix: 136,
            network: "altair",
            displayName: "Altair",
            symbols: [
                "AIR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://centrifuge.io/"
        },
        {
            prefix: 137,
            network: "vara",
            displayName: "Vara Network",
            symbols: [
                "VARA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://vara.network/"
        },
        {
            prefix: 172,
            network: "parallel",
            displayName: "Parallel",
            symbols: [
                "PARA"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://parallel.fi/"
        },
        {
            prefix: 252,
            network: "social-network",
            displayName: "Social Network",
            symbols: [
                "NET"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://social.network"
        },
        {
            prefix: 255,
            network: "quartz_mainnet",
            displayName: "QUARTZ by UNIQUE",
            symbols: [
                "QTZ"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://unique.network"
        },
        {
            prefix: 268,
            network: "pioneer_network",
            displayName: "Pioneer Network by Bit.Country",
            symbols: [
                "NEER"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://bit.country"
        },
        {
            prefix: 420,
            network: "sora_kusama_para",
            displayName: "SORA Kusama Parachain",
            symbols: [
                "XOR"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://sora.org"
        },
        {
            prefix: 440,
            network: "allfeat_network",
            displayName: "Allfeat Network",
            symbols: [
                "AFT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://allfeat.network"
        },
        {
            prefix: 666,
            network: "metaquity_network",
            displayName: "Metaquity Network",
            symbols: [
                "MQTY"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://metaquity.xyz/"
        },
        {
            prefix: 777,
            network: "curio",
            displayName: "Curio",
            symbols: [
                "CGT"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://parachain.capitaldex.exchange/"
        },
        {
            prefix: 789,
            network: "geek",
            displayName: "GEEK Network",
            symbols: [
                "GEEK"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://geek.gl"
        },
        {
            prefix: 995,
            network: "ternoa",
            displayName: "Ternoa",
            symbols: [
                "CAPS"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://www.ternoa.network"
        },
        {
            prefix: 1110,
            network: "efinity",
            displayName: "Efinity",
            symbols: [
                "EFI"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://efinity.io/"
        },
        {
            prefix: 1221,
            network: "peaq",
            displayName: "Peaq Network",
            symbols: [
                "PEAQ"
            ],
            decimals: [
                18
            ],
            standardAccount: "Sr25519",
            website: "https://www.peaq.network/"
        },
        {
            prefix: 1222,
            network: "krest",
            displayName: "Krest Network",
            symbols: [
                "KREST"
            ],
            decimals: [
                18
            ],
            standardAccount: "Sr25519",
            website: "https://www.peaq.network/"
        },
        {
            prefix: 1284,
            network: "moonbeam",
            displayName: "Moonbeam",
            symbols: [
                "GLMR"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://moonbeam.network"
        },
        {
            prefix: 1285,
            network: "moonriver",
            displayName: "Moonriver",
            symbols: [
                "MOVR"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://moonbeam.network"
        },
        {
            prefix: 1328,
            network: "ajuna",
            displayName: "Ajuna Network",
            symbols: [
                "AJUN"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://ajuna.io"
        },
        {
            prefix: 1337,
            network: "bajun",
            displayName: "Bajun Network",
            symbols: [
                "BAJU"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://ajuna.io"
        },
        {
            prefix: 1516,
            network: "societal",
            displayName: "Societal",
            symbols: [
                "SCTL"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://www.sctl.xyz"
        },
        {
            prefix: 1985,
            network: "seals",
            displayName: "Seals Network",
            symbols: [
                "SEAL"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://seals.app"
        },
        {
            prefix: 2007,
            network: "kapex",
            displayName: "Kapex",
            symbols: [
                "KAPEX"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://totemaccounting.com"
        },
        {
            prefix: 2009,
            network: "cloudwalk_mainnet",
            displayName: "CloudWalk Network Mainnet",
            symbols: [
                "CWN"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://explorer.mainnet.cloudwalk.io"
        },
        {
            prefix: 2021,
            network: "logion",
            displayName: "logion network",
            symbols: [
                "LGNT"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://logion.network"
        },
        {
            prefix: 2024,
            network: "vow-chain",
            displayName: "Enigmatic Smile",
            symbols: [
                "VOW"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://www.vow.foundation/"
        },
        {
            prefix: 2032,
            network: "interlay",
            displayName: "Interlay",
            symbols: [
                "INTR"
            ],
            decimals: [
                10
            ],
            standardAccount: "*25519",
            website: "https://interlay.io/"
        },
        {
            prefix: 2092,
            network: "kintsugi",
            displayName: "Kintsugi",
            symbols: [
                "KINT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://interlay.io/"
        },
        {
            prefix: 2106,
            network: "bitgreen",
            displayName: "Bitgreen",
            symbols: [
                "BBB"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://bitgreen.org/"
        },
        {
            prefix: 2112,
            network: "chainflip",
            displayName: "Chainflip",
            symbols: [
                "FLIP"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://chainflip.io/"
        },
        {
            prefix: 2199,
            network: "moonsama",
            displayName: "Moonsama",
            symbols: [
                "SAMA"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://moonsama.com"
        },
        {
            prefix: 2206,
            network: "ICE",
            displayName: "ICE Network",
            symbols: [
                "ICY"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://icenetwork.io"
        },
        {
            prefix: 2207,
            network: "SNOW",
            displayName: "SNOW: ICE Canary Network",
            symbols: [
                "ICZ"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://icenetwork.io"
        },
        {
            prefix: 2254,
            network: "subspace_testnet",
            displayName: "Subspace testnet",
            symbols: [
                "tSSC"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://subspace.network"
        },
        {
            prefix: 3333,
            network: "peerplays",
            displayName: "Peerplays",
            symbols: [
                "PPY"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://www.peerplays.com/"
        },
        {
            prefix: 4450,
            network: "g1",
            displayName: "Ğ1",
            symbols: [
                "G1"
            ],
            decimals: [
                2
            ],
            standardAccount: "*25519",
            website: "https://duniter.org"
        },
        {
            prefix: 5234,
            network: "humanode",
            displayName: "Humanode Network",
            symbols: [
                "HMND"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://humanode.io"
        },
        {
            prefix: 5845,
            network: "tangle",
            displayName: "Tangle Network",
            symbols: [
                "TNT"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://www.tangle.tools/"
        },
        {
            prefix: 6094,
            network: "autonomys",
            displayName: "Autonomys",
            symbols: [
                "AI3"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://autonomys.xyz"
        },
        {
            prefix: 7007,
            network: "tidefi",
            displayName: "Tidefi",
            symbols: [
                "TDFY"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://tidefi.com"
        },
        {
            prefix: 7013,
            network: "gm",
            displayName: "GM",
            symbols: [
                "FREN",
                "GM",
                "GN"
            ],
            decimals: [
                12,
                0,
                0
            ],
            standardAccount: "*25519",
            website: "https://gmordie.com"
        },
        {
            prefix: 7306,
            network: "krigan",
            displayName: "Krigan Network",
            symbols: [
                "KRGN"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://krigan.network"
        },
        {
            prefix: 7391,
            network: "unique_mainnet",
            displayName: "Unique Network",
            symbols: [
                "UNQ"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://unique.network"
        },
        {
            prefix: 8866,
            network: "golden_gate",
            displayName: "Golden Gate",
            symbols: [
                "GGX"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://ggxchain.io/"
        },
        {
            prefix: 8883,
            network: "sapphire_mainnet",
            displayName: "Sapphire by Unique",
            symbols: [
                "QTZ"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://unique.network"
        },
        {
            prefix: 8886,
            network: "golden_gate_sydney",
            displayName: "Golden Gate Sydney",
            symbols: [
                "GGXT"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://ggxchain.io/"
        },
        {
            prefix: 9072,
            network: "hashed",
            displayName: "Hashed Network",
            symbols: [
                "HASH"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://hashed.network"
        },
        {
            prefix: 9807,
            network: "dentnet",
            displayName: "DENTNet",
            symbols: [
                "DENTX"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://www.dentnet.io"
        },
        {
            prefix: 9935,
            network: "t3rn",
            displayName: "t3rn",
            symbols: [
                "TRN"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://t3rn.io/"
        },
        {
            prefix: 10041,
            network: "basilisk",
            displayName: "Basilisk",
            symbols: [
                "BSX"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://bsx.fi"
        },
        {
            prefix: 11330,
            network: "cess-testnet",
            displayName: "CESS Testnet",
            symbols: [
                "TCESS"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://cess.cloud"
        },
        {
            prefix: 11331,
            network: "cess",
            displayName: "CESS",
            symbols: [
                "CESS"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://cess.cloud"
        },
        {
            prefix: 11486,
            network: "luhn",
            displayName: "Luhn Network",
            symbols: [
                "LUHN"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://luhn.network"
        },
        {
            prefix: 11820,
            network: "contextfree",
            displayName: "Automata ContextFree",
            symbols: [
                "CTX"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://ata.network"
        },
        {
            prefix: 12155,
            network: "impact",
            displayName: "Impact Protocol Network",
            symbols: [
                "BSTY"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://impactprotocol.network/"
        },
        {
            prefix: 12191,
            network: "nftmart",
            displayName: "NFTMart",
            symbols: [
                "NMT"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://nftmart.io"
        },
        {
            prefix: 12850,
            network: "analog-timechain",
            displayName: "Analog Timechain",
            symbols: [
                "ANLOG"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://analog.one"
        },
        {
            prefix: 13116,
            network: "bittensor",
            displayName: "Bittensor",
            symbols: [
                "TAO"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://bittensor.com"
        },
        {
            prefix: 14697,
            network: "goro",
            displayName: "GORO Network",
            symbols: [
                "GORO"
            ],
            decimals: [
                9
            ],
            standardAccount: "*25519",
            website: "https://goro.network"
        },
        {
            prefix: 14998,
            network: "mosaic-chain",
            displayName: "Mosaic Chain",
            symbols: [
                "MOS"
            ],
            decimals: [
                18
            ],
            standardAccount: "*25519",
            website: "https://mosaicchain.io"
        },
        {
            prefix: 29972,
            network: "mythos",
            displayName: "Mythos",
            symbols: [
                "MYTH"
            ],
            decimals: [
                18
            ],
            standardAccount: "secp256k1",
            website: "https://mythos.foundation"
        },
        {
            prefix: 8888,
            network: "xcavate",
            displayName: "Xcavate Protocol",
            symbols: [
                "XCAV"
            ],
            decimals: [
                12
            ],
            standardAccount: "*25519",
            website: "https://xcavate.io/"
        }
    ], Jze = {
        acala: [
            "0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c"
        ],
        ajuna: [
            "0xe358eb1d11b31255a286c12e44fe6780b7edb171d657905a97e39f71d9c6c3ee"
        ],
        "aleph-node": [
            "0x70255b4d28de0fc4e1a193d7e175ad1ccef431598211c55538f1018651a0344e"
        ],
        astar: [
            "0x9eb76c5184c4ab8679d2d5d819fdf90b9c001403e9e17da2e14b6d8aec4029c6"
        ],
        basilisk: [
            "0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755"
        ],
        bifrost: [
            "0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b"
        ],
        "bifrost-kusama": [
            "0x9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed"
        ],
        bittensor: [
            "0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03"
        ],
        centrifuge: [
            "0xb3db41421702df9a7fcac62b53ffeac85f7853cc4e689e0b93aeb3db18c09d82",
            "0x67dddf2673b69e5f875f6f25277495834398eafd67f492e09f3f3345e003d1b5"
        ],
        cere: [
            "0x81443836a9a24caaa23f1241897d1235717535711d1d3fe24eae4fdc942c092c"
        ],
        composable: [
            "0xdaab8df776eb52ec604a5df5d388bb62a050a0aaec4556a64265b9d42755552d"
        ],
        creditcoin3: [
            "0x4436a7d64e363df85e065a894721002a86643283f9707338bf195d360ba2ee71",
            "0xfc4ec97a1c1f119c4353aecb4a17c7c0cf7b40d5d660143d8bad9117e9866572",
            "0xfc9df99a665f964aed6649f275055e54df5e3420489538ed31d7788f53d11ef6"
        ],
        darwinia: [
            "0xe71578b37a7c799b0ab4ee87ffa6f059a6b98f71f06fb8c84a8d88013a548ad6"
        ],
        dentnet: [
            "0x0313f6a011d128d22f996703cbab05162e2fdc9e031493314fe6db79979c5ca7"
        ],
        "dock-mainnet": [
            "0x6bfe24dca2a3be10f22212678ac13a6446ec764103c0f3471c71609eac384aae",
            "0xf73467c6544aa68df2ee546b135f955c46b90fa627e9b5d7935f41061bb8a5a9"
        ],
        edgeware: [
            "0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b"
        ],
        encointer: [
            "0x7dd99936c1e9e6d1ce7d90eb6f33bea8393b4bf87677d675aa63c9cb3e8c5b5b"
        ],
        enjin: [
            "0xd8761d3c88f26dc12875c00d3165f7d67243d56fc85b4cf19937601a7916e5a9"
        ],
        equilibrium: [
            "0x6f1a800de3daff7f5e037ddf66ab22ce03ab91874debeddb1086f5f7dbd48925"
        ],
        frequency: [
            "0x4a587bf17a404e3572747add7aab7bbe56e805a5479c6c436f07f36fcc8d3ae1"
        ],
        genshiro: [
            "0x9b8cefc0eb5c568b527998bdd76c184e2b76ae561be76e4667072230217ea243"
        ],
        hydradx: [
            "0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d",
            "0xd2a620c27ec5cbc5621ff9a522689895074f7cca0d08e7134a7804e1a3ba86fc",
            "0x10af6e84234477d84dc572bac0789813b254aa490767ed06fb9591191d1073f9",
            "0x3d75507dd46301767e601265791da1d9cb47b6ebc94e87347b635e5bf58bd047",
            "0x0ed32bfcab4a83517fac88f2aa7cbc2f88d3ab93be9a12b6188a036bf8a943c2"
        ],
        integritee: [
            "0xcdedc8eadbfa209d3f207bba541e57c3c58a667b05a2e1d1e86353c9000758da",
            "0xe13e7af377c64e83f95e0d70d5e5c3c01d697a84538776c5b9bbe0e7d7b6034c"
        ],
        "interlay-parachain": [
            "0xbf88efe70e9e0e916416e8bed61f2b45717f517d7f3523e33c7b001e5ffcbc72"
        ],
        karura: [
            "0xbaf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b"
        ],
        khala: [
            "0xd43540ba6d3eb4897c28a77d48cb5b729fea37603cbbfc7a86a73b72adb3be8d"
        ],
        kulupu: [
            "0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba"
        ],
        kusama: [
            "0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",
            "0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636",
            "0x3fd7b9eb6a00376e5be61f01abb429ffb0b104be05eaff4d458da48fcd425baf"
        ],
        liberland: [
            "0x6bd89e052d67a45bb60a9a23e8581053d5e0d619f15cb9865946937e690c42d6"
        ],
        matrixchain: [
            "0x3af4ff48ec76d2efc8476730f423ac07e25ad48f5f4c9dc39c778b164d808615"
        ],
        mythos: [
            "0xf6ee56e9c5277df5b4ce6ae9983ee88f3cbed27d31beeb98f9f84f997a1ab0b9"
        ],
        nodle: [
            "0x97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21"
        ],
        origintrail: [
            "0xe7e0962324a3b86c83404dbea483f25fb5dab4c224791c81b756cfc948006174"
        ],
        p3d: [
            "0x6c5894837ad89b6d92b114a2fb3eafa8fe3d26a54848e3447015442cd6ef4e66"
        ],
        parallel: [
            "0xe61a41c53f5dcd0beb09df93b34402aada44cb05117b71059cce40a2723a4e97"
        ],
        peaq: [
            "0xd2a5d385932d1f650dae03ef8e2748983779ee342c614f80854d32b8cd8fa48c"
        ],
        pendulum: [
            "0x5d3c298622d5634ed019bf61ea4b71655030015bde9beb0d6a24743714462c86"
        ],
        phala: [
            "0x1bb969d85965e4bb5a651abbedf21a54b6b31a21f66b5401cc3f1e286268d736"
        ],
        picasso: [
            "0x6811a339673c9daa897944dcdac99c6e2939cc88245ed21951a0a3c9a2be75bc",
            "0xe8e7f0f4c4f5a00720b4821dbfddefea7490bcf0b19009961cc46957984e2c1c"
        ],
        polimec: [
            "0x7eb9354488318e7549c722669dcbdcdc526f1fef1420e7944667212f3601fdbd"
        ],
        polkadex: [
            "0x3920bcb4960a1eef5580cd5367ff3f430eef052774f78468852f7b9cb39f8a3c"
        ],
        polkadot: [
            "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"
        ],
        polymesh: [
            "0x6fbd74e5e1d0a61d52ccfe9d4adaed16dd3a7caa37c6bc4d0c2fa12e8b2f4063"
        ],
        quartz: [
            "0xcd4d732201ebe5d6b014edda071c4203e16867305332301dc8d092044b28e554"
        ],
        rococo: [
            "0x6408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063e",
            "0xaaf2cd1b74b5f726895921259421b534124726263982522174147046b8827897",
            "0x037f5f3c8e67b314062025fc886fcd6238ea25a4a9b45dce8d246815c9ebe770",
            "0xc196f81260cf1686172b47a79cf002120735d7cb0eb1474e8adce56618456fff",
            "0xf6e9983c37baf68846fedafe21e56718790e39fb1c582abc408b81bc7b208f9a",
            "0x5fce687da39305dfe682b117f0820b319348e8bb37eb16cf34acbf6a202de9d9",
            "0xe7c3d5edde7db964317cd9b51a3a059d7cd99f81bdbce14990047354334c9779",
            "0x1611e1dbf0405379b861e2e27daa90f480b2e6d3682414a80835a52e8cb8a215",
            "0x343442f12fa715489a8714e79a7b264ea88c0d5b8c66b684a7788a516032f6b9",
            "0x78bcd530c6b3a068bc17473cf5d2aff9c287102bed9af3ae3c41c33b9d6c6147",
            "0x47381ee0697153d64404fc578392c8fd5cba9073391908f46c888498415647bd",
            "0x19c0e4fa8ab75f5ac7865e0b8f74ff91eb9a100d336f423cd013a8befba40299"
        ],
        sora: [
            "0x7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5"
        ],
        stafi: [
            "0x290a4149f09ea0e402c74c1c7e96ae4239588577fe78932f94f5404c68243d80"
        ],
        statemine: [
            "0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"
        ],
        statemint: [
            "0x68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f"
        ],
        subsocial: [
            "0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8"
        ],
        ternoa: [
            "0x6859c81ca95ef624c9dfe4dc6e3381c33e5d6509e35e147092bfbc780f777c4e"
        ],
        unique: [
            "0x84322d9cddbf35088f1e54e9a85c967a41a56a4f43445768125e61af166c7d31"
        ],
        vara: [
            "0xfe1b4c55fd4d668101126434206571a7838a8b6b93a6d1b95d607e78e6c53763"
        ],
        vtb: [
            "0x286bc8414c7000ce1d6ee6a834e29a54c1784814b76243eb77ed0b2c5573c60f",
            "0x7483b89572fb2bd687c7b9a93b242d0b237f9aba463aba07ec24503931038aaa"
        ],
        westend: [
            "0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"
        ],
        xxnetwork: [
            "0x50dd5d206917bf10502c68fb4d18a59fc8aa31586f4e8856b493e43544aa82aa"
        ],
        zeitgeist: [
            "0x1bf2a2ecb4a868de66ea8610f2ce7c8c43706561b6476031315f6640fe38e060"
        ]
    }, Yze = {
        centrifuge: "polkadot",
        kusama: "polkadot",
        polkadot: "polkadot",
        sora: "polkadot",
        statemine: "polkadot",
        statemint: "polkadot",
        westmint: "polkadot"
    }, Qze = {
        acala: 787,
        ajuna: 354,
        "aleph-node": 643,
        astar: 810,
        bifrost: 788,
        "bifrost-kusama": 788,
        bittensor: 354,
        centrifuge: 747,
        composable: 354,
        creditcoin3: 354,
        darwinia: 354,
        dentnet: 734,
        "dock-mainnet": 594,
        edgeware: 523,
        encointer: 434,
        enjin: 1155,
        equilibrium: 99999997,
        frequency: 2091,
        genshiro: 99999996,
        hydradx: 354,
        integritee: 2015,
        "interlay-parachain": 354,
        karura: 686,
        khala: 434,
        kusama: 434,
        liberland: 767,
        matrixchain: 1155,
        mythos: 60,
        nodle: 1003,
        origintrail: 354,
        parallel: 354,
        peaq: 3338,
        pendulum: 354,
        phala: 354,
        picasso: 434,
        polimec: 3344,
        polkadex: 799,
        polkadot: 354,
        polymesh: 595,
        quartz: 631,
        sora: 617,
        stafi: 907,
        statemine: 434,
        statemint: 354,
        ternoa: 995,
        unique: 661,
        vara: 4976,
        vtb: 694,
        xxnetwork: 1955,
        zeitgeist: 354
    }, eUe = {
        "": !0,
        "cess-testnet": !0,
        "dock-testnet": !0,
        jupiter: !0,
        "mathchain-testnet": !0,
        p3dt: !0,
        subspace_testnet: !0,
        "zero-alphaville": !0
    }, GV = [
        0,
        2,
        42
    ], tUe = [
        "testnet"
    ];
    function nUe(t) {
        const e = t.network || "", n = e.replace(/_/g, "-").split("-"), r = t;
        return r.slip44 = Qze[e], r.hasLedgerSupport = !!r.slip44, r.genesisHash = Jze[e] || [], r.icon = Yze[e] || "substrate", r.isTestnet = !!eUe[e] || tUe.includes(n[n.length - 1]), r.isIgnored = r.isTestnet || !(t.standardAccount && t.decimals?.length && t.symbols?.length) && t.prefix !== 42, r;
    }
    function rUe({ genesisHash: t, prefix: e }) {
        return !!t.length || e === 42;
    }
    function sUe(t) {
        return !t.isIgnored && !!t.network;
    }
    function iUe(t, e) {
        const n = GV.includes(t.prefix), r = GV.includes(e.prefix);
        return n === r ? n ? 0 : t.displayName.localeCompare(e.displayName) : n ? -1 : 1;
    }
    const oUe = Zze.map(nUe), SJ = oUe.filter(sUe).sort(iUe), aUe = SJ.filter(rUe), W_ = {
        allowedDecodedLengths: [
            1,
            2,
            4,
            8,
            32,
            33
        ],
        allowedEncodedLengths: [
            3,
            4,
            6,
            10,
            35,
            36,
            37,
            38
        ],
        allowedPrefix: SJ.map(({ prefix: t })=>t),
        prefix: 42
    };
    function Xd(t, e, n = -1) {
        if (!t) throw new Error("Invalid empty address passed");
        if (Bt(t) || Fn(t)) return Dt(t);
        try {
            const r = qze(t);
            if (!W_.allowedEncodedLengths.includes(r.length)) throw new Error("Invalid decoded address length");
            const [s, i, o, a] = Gze(r);
            if (!s && !e) throw new Error("Invalid decoded address checksum");
            if (n !== -1 && n !== a) throw new Error(`Expected ss58Format ${n}, received ${a}`);
            return r.slice(o, i);
        } catch (r) {
            throw new Error(`Decoding ${t}: ${r.message}`);
        }
    }
    const ZV = {
        bitLength: 256,
        isLe: !1
    };
    const JV = (t, e)=>(t + (t >= 0 ? e : -e) / kJ) / e;
    function cUe(t, e, n) {
        const [[r, s], [i, o]] = e, a = JV(o * t, n), c = JV(-s * t, n);
        let l = t - a * r - c * i, u = -a * s - c * o;
        const d = l < Vl, f = u < Vl;
        d && (l = -l), f && (u = -u);
        const p = pU(Math.ceil(one(n) / 2)) + e0;
        if (l < Vl || l >= p || u < Vl || u >= p) throw new Error("splitScalar (endomorphism): failed, k=" + t);
        return {
            k1neg: d,
            k1: l,
            k2neg: f,
            k2: u
        };
    }
    function jk(t) {
        if (![
            "compact",
            "recovered",
            "der"
        ].includes(t)) throw new Error('Signature format must be "compact", "recovered", or "der"');
        return t;
    }
    function hS(t, e) {
        const n = {};
        for (let r of Object.keys(e))n[r] = t[r] === void 0 ? e[r] : t[r];
        return s2(n.lowS, "lowS"), s2(n.prehash, "prehash"), n.format !== void 0 && jk(n.format), n;
    }
    class lUe extends Error {
        constructor(e = ""){
            super(e);
        }
    }
    const Sl = {
        Err: lUe,
        _tlv: {
            encode: (t, e)=>{
                const { Err: n } = Sl;
                if (t < 0 || t > 256) throw new n("tlv.encode: wrong tag");
                if (e.length & 1) throw new n("tlv.encode: unpadded data");
                const r = e.length / 2, s = Sw(r);
                if (s.length / 2 & 128) throw new n("tlv.encode: long form length too big");
                const i = r > 127 ? Sw(s.length / 2 | 128) : "";
                return Sw(t) + i + s + e;
            },
            decode (t, e) {
                const { Err: n } = Sl;
                let r = 0;
                if (t < 0 || t > 256) throw new n("tlv.encode: wrong tag");
                if (e.length < 2 || e[r++] !== t) throw new n("tlv.decode: wrong tlv");
                const s = e[r++], i = !!(s & 128);
                let o = 0;
                if (!i) o = s;
                else {
                    const c = s & 127;
                    if (!c) throw new n("tlv.decode(long): indefinite length not supported");
                    if (c > 4) throw new n("tlv.decode(long): byte length is too big");
                    const l = e.subarray(r, r + c);
                    if (l.length !== c) throw new n("tlv.decode: length bytes not complete");
                    if (l[0] === 0) throw new n("tlv.decode(long): zero leftmost byte");
                    for (const u of l)o = o << 8 | u;
                    if (r += c, o < 128) throw new n("tlv.decode(long): not minimal encoding");
                }
                const a = e.subarray(r, r + o);
                if (a.length !== o) throw new n("tlv.decode: wrong value length");
                return {
                    v: a,
                    l: e.subarray(r + o)
                };
            }
        },
        _int: {
            encode (t) {
                const { Err: e } = Sl;
                if (t < Vl) throw new e("integer: negative integers are not allowed");
                let n = Sw(t);
                if (Number.parseInt(n[0], 16) & 8 && (n = "00" + n), n.length & 1) throw new e("unexpected DER parsing assertion: unpadded hex");
                return n;
            },
            decode (t) {
                const { Err: e } = Sl;
                if (t[0] & 128) throw new e("invalid signature integer: negative");
                if (t[0] === 0 && !(t[1] & 128)) throw new e("invalid signature integer: unnecessary leading zero");
                return fU(t);
            }
        },
        toSig (t) {
            const { Err: e, _int: n, _tlv: r } = Sl, s = Hi("signature", t), { v: i, l: o } = r.decode(48, s);
            if (o.length) throw new e("invalid signature: left bytes after parsing");
            const { v: a, l: c } = r.decode(2, i), { v: l, l: u } = r.decode(2, c);
            if (u.length) throw new e("invalid signature: left bytes after parsing");
            return {
                r: n.decode(a),
                s: n.decode(l)
            };
        },
        hexFromSig (t) {
            const { _tlv: e, _int: n } = Sl, r = e.encode(2, n.encode(t.r)), s = e.encode(2, n.encode(t.s)), i = r + s;
            return e.encode(48, i);
        }
    }, Vl = BigInt(0), e0 = BigInt(1), kJ = BigInt(2), Kw = BigInt(3), uUe = BigInt(4);
    function Fh(t, e) {
        const { BYTES: n } = t;
        let r;
        if (typeof e == "bigint") r = e;
        else {
            let s = Hi("private key", e);
            try {
                r = t.fromBytes(s);
            } catch  {
                throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`);
            }
        }
        if (!t.isValidNot0(r)) throw new Error("invalid private key: out of range [1..N-1]");
        return r;
    }
    function dUe(t, e = {}) {
        const n = Gte("weierstrass", t, e), { Fp: r, Fn: s } = n;
        let i = n.CURVE;
        const { h: o, n: a } = i;
        uU(e, {}, {
            allowInfinityPoint: "boolean",
            clearCofactor: "function",
            isTorsionFree: "function",
            fromBytes: "function",
            toBytes: "function",
            endo: "object",
            wrapPrivateKey: "boolean"
        });
        const { endo: c } = e;
        if (c && (!r.is0(i.a) || typeof c.beta != "bigint" || !Array.isArray(c.basises))) throw new Error('invalid endo: expected "beta": bigint and "basises": array');
        const l = CJ(r, s);
        function u() {
            if (!r.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
        }
        function d(Y, M, g) {
            const { x: y, y: C } = M.toAffine(), R = r.toBytes(y);
            if (s2(g, "isCompressed"), g) {
                u();
                const N = !r.isOdd(C);
                return vf(TJ(N), R);
            } else return vf(Uint8Array.of(4), R, r.toBytes(C));
        }
        function f(Y) {
            If(Y, void 0, "Point");
            const { publicKey: M, publicKeyUncompressed: g } = l, y = Y.length, C = Y[0], R = Y.subarray(1);
            if (y === M && (C === 2 || C === 3)) {
                const N = r.fromBytes(R);
                if (!r.isValid(N)) throw new Error("bad point: is not on curve, wrong x");
                const L = m(N);
                let z;
                try {
                    z = r.sqrt(L);
                } catch (O) {
                    const q = O instanceof Error ? ": " + O.message : "";
                    throw new Error("bad point: is not on curve, sqrt error" + q);
                }
                u();
                const B = r.isOdd(z);
                return (C & 1) === 1 !== B && (z = r.neg(z)), {
                    x: N,
                    y: z
                };
            } else if (y === g && C === 4) {
                const N = r.BYTES, L = r.fromBytes(R.subarray(0, N)), z = r.fromBytes(R.subarray(N, N * 2));
                if (!w(L, z)) throw new Error("bad point: is not on curve");
                return {
                    x: L,
                    y: z
                };
            } else throw new Error(`bad point: got length ${y}, expected compressed=${M} or uncompressed=${g}`);
        }
        const p = e.toBytes || d, h = e.fromBytes || f;
        function m(Y) {
            const M = r.sqr(Y), g = r.mul(M, Y);
            return r.add(r.add(g, r.mul(Y, i.a)), i.b);
        }
        function w(Y, M) {
            const g = r.sqr(M), y = m(Y);
            return r.eql(g, y);
        }
        if (!w(i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
        const v = r.mul(r.pow(i.a, Kw), uUe), k = r.mul(r.sqr(i.b), BigInt(27));
        if (r.is0(r.add(v, k))) throw new Error("bad curve params: a or b");
        function _(Y, M, g = !1) {
            if (!r.isValid(M) || g && r.is0(M)) throw new Error(`bad point coordinate ${Y}`);
            return M;
        }
        function A(Y) {
            if (!(Y instanceof G)) throw new Error("ProjectivePoint expected");
        }
        function P(Y) {
            if (!c || !c.basises) throw new Error("no endo");
            return cUe(Y, c.basises, s.ORDER);
        }
        const U = jO((Y, M)=>{
            const { X: g, Y: y, Z: C } = Y;
            if (r.eql(C, r.ONE)) return {
                x: g,
                y
            };
            const R = Y.is0();
            M == null && (M = R ? r.ONE : r.inv(C));
            const N = r.mul(g, M), L = r.mul(y, M), z = r.mul(C, M);
            if (R) return {
                x: r.ZERO,
                y: r.ZERO
            };
            if (!r.eql(z, r.ONE)) throw new Error("invZ was invalid");
            return {
                x: N,
                y: L
            };
        }), K = jO((Y)=>{
            if (Y.is0()) {
                if (e.allowInfinityPoint && !r.is0(Y.Y)) return;
                throw new Error("bad point: ZERO");
            }
            const { x: M, y: g } = Y.toAffine();
            if (!r.isValid(M) || !r.isValid(g)) throw new Error("bad point: x or y not field elements");
            if (!w(M, g)) throw new Error("bad point: equation left != right");
            if (!Y.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
            return !0;
        });
        function X(Y, M, g, y, C) {
            return g = new G(r.mul(g.X, Y), g.Y, g.Z), M = qO(y, M), g = qO(C, g), M.add(g);
        }
        class G {
            constructor(M, g, y){
                this.X = _("x", M), this.Y = _("y", g, !0), this.Z = _("z", y), Object.freeze(this);
            }
            static CURVE() {
                return i;
            }
            static fromAffine(M) {
                const { x: g, y } = M || {};
                if (!M || !r.isValid(g) || !r.isValid(y)) throw new Error("invalid affine point");
                if (M instanceof G) throw new Error("projective point not allowed");
                return r.is0(g) && r.is0(y) ? G.ZERO : new G(g, y, r.ONE);
            }
            static fromBytes(M) {
                const g = G.fromAffine(h(If(M, void 0, "point")));
                return g.assertValidity(), g;
            }
            static fromHex(M) {
                return G.fromBytes(Hi("pointHex", M));
            }
            get x() {
                return this.toAffine().x;
            }
            get y() {
                return this.toAffine().y;
            }
            precompute(M = 8, g = !0) {
                return ie.createCache(this, M), g || this.multiply(Kw), this;
            }
            assertValidity() {
                K(this);
            }
            hasEvenY() {
                const { y: M } = this.toAffine();
                if (!r.isOdd) throw new Error("Field doesn't support isOdd");
                return !r.isOdd(M);
            }
            equals(M) {
                A(M);
                const { X: g, Y: y, Z: C } = this, { X: R, Y: N, Z: L } = M, z = r.eql(r.mul(g, L), r.mul(R, C)), B = r.eql(r.mul(y, L), r.mul(N, C));
                return z && B;
            }
            negate() {
                return new G(this.X, r.neg(this.Y), this.Z);
            }
            double() {
                const { a: M, b: g } = i, y = r.mul(g, Kw), { X: C, Y: R, Z: N } = this;
                let L = r.ZERO, z = r.ZERO, B = r.ZERO, x = r.mul(C, C), O = r.mul(R, R), q = r.mul(N, N), H = r.mul(C, R);
                return H = r.add(H, H), B = r.mul(C, N), B = r.add(B, B), L = r.mul(M, B), z = r.mul(y, q), z = r.add(L, z), L = r.sub(O, z), z = r.add(O, z), z = r.mul(L, z), L = r.mul(H, L), B = r.mul(y, B), q = r.mul(M, q), H = r.sub(x, q), H = r.mul(M, H), H = r.add(H, B), B = r.add(x, x), x = r.add(B, x), x = r.add(x, q), x = r.mul(x, H), z = r.add(z, x), q = r.mul(R, N), q = r.add(q, q), x = r.mul(q, H), L = r.sub(L, x), B = r.mul(q, O), B = r.add(B, B), B = r.add(B, B), new G(L, z, B);
            }
            add(M) {
                A(M);
                const { X: g, Y: y, Z: C } = this, { X: R, Y: N, Z: L } = M;
                let z = r.ZERO, B = r.ZERO, x = r.ZERO;
                const O = i.a, q = r.mul(i.b, Kw);
                let H = r.mul(g, R), Z = r.mul(y, N), te = r.mul(C, L), J = r.add(g, y), se = r.add(R, N);
                J = r.mul(J, se), se = r.add(H, Z), J = r.sub(J, se), se = r.add(g, C);
                let fe = r.add(R, L);
                return se = r.mul(se, fe), fe = r.add(H, te), se = r.sub(se, fe), fe = r.add(y, C), z = r.add(N, L), fe = r.mul(fe, z), z = r.add(Z, te), fe = r.sub(fe, z), x = r.mul(O, se), z = r.mul(q, te), x = r.add(z, x), z = r.sub(Z, x), x = r.add(Z, x), B = r.mul(z, x), Z = r.add(H, H), Z = r.add(Z, H), te = r.mul(O, te), se = r.mul(q, se), Z = r.add(Z, te), te = r.sub(H, te), te = r.mul(O, te), se = r.add(se, te), H = r.mul(Z, se), B = r.add(B, H), H = r.mul(fe, se), z = r.mul(J, z), z = r.sub(z, H), H = r.mul(J, Z), x = r.mul(fe, x), x = r.add(x, H), new G(z, B, x);
            }
            subtract(M) {
                return this.add(M.negate());
            }
            is0() {
                return this.equals(G.ZERO);
            }
            multiply(M) {
                const { endo: g } = e;
                if (!s.isValidNot0(M)) throw new Error("invalid scalar: out of range");
                let y, C;
                const R = (N)=>ie.cached(this, N, (L)=>s5(G, L));
                if (g) {
                    const { k1neg: N, k1: L, k2neg: z, k2: B } = P(M), { p: x, f: O } = R(L), { p: q, f: H } = R(B);
                    C = O.add(H), y = X(g.beta, x, q, N, z);
                } else {
                    const { p: N, f: L } = R(M);
                    y = N, C = L;
                }
                return s5(G, [
                    y,
                    C
                ])[0];
            }
            multiplyUnsafe(M) {
                const { endo: g } = e, y = this;
                if (!s.isValid(M)) throw new Error("invalid scalar: out of range");
                if (M === Vl || y.is0()) return G.ZERO;
                if (M === e0) return y;
                if (ie.hasCache(this)) return this.multiply(M);
                if (g) {
                    const { k1neg: C, k1: R, k2neg: N, k2: L } = P(M), { p1: z, p2: B } = ene(G, y, R, L);
                    return X(g.beta, z, B, C, N);
                } else return ie.unsafe(y, M);
            }
            multiplyAndAddUnsafe(M, g, y) {
                const C = this.multiplyUnsafe(g).add(M.multiplyUnsafe(y));
                return C.is0() ? void 0 : C;
            }
            toAffine(M) {
                return U(this, M);
            }
            isTorsionFree() {
                const { isTorsionFree: M } = e;
                return o === e0 ? !0 : M ? M(G, this) : ie.unsafe(this, a).is0();
            }
            clearCofactor() {
                const { clearCofactor: M } = e;
                return o === e0 ? this : M ? M(G, this) : this.multiplyUnsafe(o);
            }
            isSmallOrder() {
                return this.multiplyUnsafe(o).is0();
            }
            toBytes(M = !0) {
                return s2(M, "isCompressed"), this.assertValidity(), p(G, this, M);
            }
            toHex(M = !0) {
                return m_(this.toBytes(M));
            }
            toString() {
                return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
            }
            get px() {
                return this.X;
            }
            get py() {
                return this.X;
            }
            get pz() {
                return this.Z;
            }
            toRawBytes(M = !0) {
                return this.toBytes(M);
            }
            _setWindowSize(M) {
                this.precompute(M);
            }
            static normalizeZ(M) {
                return s5(G, M);
            }
            static msm(M, g) {
                return tne(G, s, M, g);
            }
            static fromPrivateKey(M) {
                return G.BASE.multiply(Fh(s, M));
            }
        }
        G.BASE = new G(i.Gx, i.Gy, r.ONE), G.ZERO = new G(r.ZERO, r.ONE, r.ZERO), G.Fp = r, G.Fn = s;
        const ce = s.BITS, ie = new Zte(G, e.endo ? Math.ceil(ce / 2) : ce);
        return G.BASE.precompute(8), G;
    }
    function TJ(t) {
        return Uint8Array.of(t ? 2 : 3);
    }
    function CJ(t, e) {
        return {
            secretKey: e.BYTES,
            publicKey: 1 + t.BYTES,
            publicKeyUncompressed: 1 + 2 * t.BYTES,
            publicKeyHasPrefix: !0,
            signature: 2 * e.BYTES
        };
    }
    function fUe(t, e = {}) {
        const { Fn: n } = t, r = e.randomBytes || dU, s = Object.assign(CJ(t.Fp, n), {
            seed: nne(n.ORDER)
        });
        function i(p) {
            try {
                return !!Fh(n, p);
            } catch  {
                return !1;
            }
        }
        function o(p, h) {
            const { publicKey: m, publicKeyUncompressed: w } = s;
            try {
                const v = p.length;
                return h === !0 && v !== m || h === !1 && v !== w ? !1 : !!t.fromBytes(p);
            } catch  {
                return !1;
            }
        }
        function a(p = r(s.seed)) {
            return sne(If(p, s.seed, "seed"), n.ORDER);
        }
        function c(p, h = !0) {
            return t.BASE.multiply(Fh(n, p)).toBytes(h);
        }
        function l(p) {
            const h = a(p);
            return {
                secretKey: h,
                publicKey: c(h)
            };
        }
        function u(p) {
            if (typeof p == "bigint") return !1;
            if (p instanceof t) return !0;
            const { secretKey: h, publicKey: m, publicKeyUncompressed: w } = s;
            if (n.allowedLengths || h === m) return;
            const v = Hi("key", p).length;
            return v === m || v === w;
        }
        function d(p, h, m = !0) {
            if (u(p) === !0) throw new Error("first arg must be private key");
            if (u(h) === !1) throw new Error("second arg must be public key");
            const w = Fh(n, p);
            return t.fromHex(h).multiply(w).toBytes(m);
        }
        return Object.freeze({
            getPublicKey: c,
            getSharedSecret: d,
            keygen: l,
            Point: t,
            utils: {
                isValidSecretKey: i,
                isValidPublicKey: o,
                randomSecretKey: a,
                isValidPrivateKey: i,
                randomPrivateKey: a,
                normPrivateKeyToScalar: (p)=>Fh(n, p),
                precompute (p = 8, h = t.BASE) {
                    return h.precompute(p, !1);
                }
            },
            lengths: s
        });
    }
    function pUe(t, e, n = {}) {
        Jte(e), uU(n, {}, {
            hmac: "function",
            lowS: "boolean",
            randomBytes: "function",
            bits2int: "function",
            bits2int_modN: "function"
        });
        const r = n.randomBytes || dU, s = n.hmac || ((g, ...y)=>Yte(e, g, vf(...y))), { Fp: i, Fn: o } = t, { ORDER: a, BITS: c } = o, { keygen: l, getPublicKey: u, getSharedSecret: d, utils: f, lengths: p } = fUe(t, n), h = {
            prehash: !1,
            lowS: typeof n.lowS == "boolean" ? n.lowS : !1,
            format: void 0,
            extraEntropy: !1
        }, m = "compact";
        function w(g) {
            const y = a >> e0;
            return g > y;
        }
        function v(g, y) {
            if (!o.isValidNot0(y)) throw new Error(`invalid signature ${g}: out of range 1..Point.Fn.ORDER`);
            return y;
        }
        function k(g, y) {
            jk(y);
            const C = p.signature, R = y === "compact" ? C : y === "recovered" ? C + 1 : void 0;
            return If(g, R, `${y} signature`);
        }
        class _ {
            constructor(y, C, R){
                this.r = v("r", y), this.s = v("s", C), R != null && (this.recovery = R), Object.freeze(this);
            }
            static fromBytes(y, C = m) {
                k(y, C);
                let R;
                if (C === "der") {
                    const { r: B, s: x } = Sl.toSig(If(y));
                    return new _(B, x);
                }
                C === "recovered" && (R = y[0], C = "compact", y = y.subarray(1));
                const N = o.BYTES, L = y.subarray(0, N), z = y.subarray(N, N * 2);
                return new _(o.fromBytes(L), o.fromBytes(z), R);
            }
            static fromHex(y, C) {
                return this.fromBytes(HO(y), C);
            }
            addRecoveryBit(y) {
                return new _(this.r, this.s, y);
            }
            recoverPublicKey(y) {
                const C = i.ORDER, { r: R, s: N, recovery: L } = this;
                if (L == null || ![
                    0,
                    1,
                    2,
                    3
                ].includes(L)) throw new Error("recovery id invalid");
                if (a * kJ < C && L > 1) throw new Error("recovery id is ambiguous for h>1 curve");
                const B = L === 2 || L === 3 ? R + a : R;
                if (!i.isValid(B)) throw new Error("recovery id 2 or 3 invalid");
                const x = i.toBytes(B), O = t.fromBytes(vf(TJ((L & 1) === 0), x)), q = o.inv(B), H = P(Hi("msgHash", y)), Z = o.create(-H * q), te = o.create(N * q), J = t.BASE.multiplyUnsafe(Z).add(O.multiplyUnsafe(te));
                if (J.is0()) throw new Error("point at infinify");
                return J.assertValidity(), J;
            }
            hasHighS() {
                return w(this.s);
            }
            toBytes(y = m) {
                if (jk(y), y === "der") return HO(Sl.hexFromSig(this));
                const C = o.toBytes(this.r), R = o.toBytes(this.s);
                if (y === "recovered") {
                    if (this.recovery == null) throw new Error("recovery bit must be present");
                    return vf(Uint8Array.of(this.recovery), C, R);
                }
                return vf(C, R);
            }
            toHex(y) {
                return m_(this.toBytes(y));
            }
            assertValidity() {}
            static fromCompact(y) {
                return _.fromBytes(Hi("sig", y), "compact");
            }
            static fromDER(y) {
                return _.fromBytes(Hi("sig", y), "der");
            }
            normalizeS() {
                return this.hasHighS() ? new _(this.r, o.neg(this.s), this.recovery) : this;
            }
            toDERRawBytes() {
                return this.toBytes("der");
            }
            toDERHex() {
                return m_(this.toBytes("der"));
            }
            toCompactRawBytes() {
                return this.toBytes("compact");
            }
            toCompactHex() {
                return m_(this.toBytes("compact"));
            }
        }
        const A = n.bits2int || function(y) {
            if (y.length > 8192) throw new Error("input is too large");
            const C = fU(y), R = y.length * 8 - c;
            return R > 0 ? C >> BigInt(R) : C;
        }, P = n.bits2int_modN || function(y) {
            return o.create(A(y));
        }, U = pU(c);
        function K(g) {
            return ane("num < 2^" + c, g, Vl, U), o.toBytes(g);
        }
        function X(g, y) {
            return If(g, void 0, "message"), y ? If(e(g), void 0, "prehashed message") : g;
        }
        function G(g, y, C) {
            if ([
                "recovered",
                "canonical"
            ].some((Z)=>Z in C)) throw new Error("sign() legacy options not supported");
            const { lowS: R, prehash: N, extraEntropy: L } = hS(C, h);
            g = X(g, N);
            const z = P(g), B = Fh(o, y), x = [
                K(B),
                K(z)
            ];
            if (L != null && L !== !1) {
                const Z = L === !0 ? r(p.secretKey) : L;
                x.push(Hi("extraEntropy", Z));
            }
            const O = vf(...x), q = z;
            function H(Z) {
                const te = A(Z);
                if (!o.isValidNot0(te)) return;
                const J = o.inv(te), se = t.BASE.multiply(te).toAffine(), fe = o.create(se.x);
                if (fe === Vl) return;
                const ge = o.create(J * o.create(q + fe * B));
                if (ge === Vl) return;
                let Ce = (se.x === fe ? 0 : 2) | Number(se.y & e0), Ue = ge;
                return R && w(ge) && (Ue = o.neg(ge), Ce ^= 1), new _(fe, Ue, Ce);
            }
            return {
                seed: O,
                k2sig: H
            };
        }
        function ce(g, y, C = {}) {
            g = Hi("message", g);
            const { seed: R, k2sig: N } = G(g, y, C);
            return rne(e.outputLen, o.BYTES, s)(R, N);
        }
        function ie(g) {
            let y;
            const C = typeof g == "string" || ine(g), R = !C && g !== null && typeof g == "object" && typeof g.r == "bigint" && typeof g.s == "bigint";
            if (!C && !R) throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
            if (R) y = new _(g.r, g.s);
            else if (C) {
                try {
                    y = _.fromBytes(Hi("sig", g), "der");
                } catch (N) {
                    if (!(N instanceof Sl.Err)) throw N;
                }
                if (!y) try {
                    y = _.fromBytes(Hi("sig", g), "compact");
                } catch  {
                    return !1;
                }
            }
            return y || !1;
        }
        function Y(g, y, C, R = {}) {
            const { lowS: N, prehash: L, format: z } = hS(R, h);
            if (C = Hi("publicKey", C), y = X(Hi("message", y), L), "strict" in R) throw new Error("options.strict was renamed to lowS");
            const B = z === void 0 ? ie(g) : _.fromBytes(Hi("sig", g), z);
            if (B === !1) return !1;
            try {
                const x = t.fromBytes(C);
                if (N && B.hasHighS()) return !1;
                const { r: O, s: q } = B, H = P(y), Z = o.inv(q), te = o.create(H * Z), J = o.create(O * Z), se = t.BASE.multiplyUnsafe(te).add(x.multiplyUnsafe(J));
                return se.is0() ? !1 : o.create(se.x) === O;
            } catch  {
                return !1;
            }
        }
        function M(g, y, C = {}) {
            const { prehash: R } = hS(C, h);
            return y = X(y, R), _.fromBytes(g, "recovered").recoverPublicKey(y).toBytes();
        }
        return Object.freeze({
            keygen: l,
            getPublicKey: u,
            getSharedSecret: d,
            utils: f,
            lengths: p,
            Point: t,
            sign: ce,
            verify: Y,
            recoverPublicKey: M,
            Signature: _,
            hash: e
        });
    }
    function hUe(t) {
        const e = {
            a: t.a,
            b: t.b,
            p: t.Fp.ORDER,
            n: t.n,
            h: t.h,
            Gx: t.Gx,
            Gy: t.Gy
        }, n = t.Fp;
        let r = t.allowedPrivateKeyLengths ? Array.from(new Set(t.allowedPrivateKeyLengths.map((o)=>Math.ceil(o / 2)))) : void 0;
        const s = hU(e.n, {
            BITS: t.nBitLength,
            allowedLengths: r,
            modFromBytes: t.wrapPrivateKey
        }), i = {
            Fp: n,
            Fn: s,
            allowInfinityPoint: t.allowInfinityPoint,
            endo: t.endo,
            isTorsionFree: t.isTorsionFree,
            clearCofactor: t.clearCofactor,
            fromBytes: t.fromBytes,
            toBytes: t.toBytes
        };
        return {
            CURVE: e,
            curveOpts: i
        };
    }
    function gUe(t) {
        const { CURVE: e, curveOpts: n } = hUe(t), r = {
            hmac: t.hmac,
            randomBytes: t.randomBytes,
            lowS: t.lowS,
            bits2int: t.bits2int,
            bits2int_modN: t.bits2int_modN
        };
        return {
            CURVE: e,
            curveOpts: n,
            hash: t.hash,
            ecdsaOpts: r
        };
    }
    function bUe(t, e) {
        const n = e.Point;
        return Object.assign({}, e, {
            ProjectivePoint: n,
            CURVE: Object.assign({}, t, Qte(n.Fn.ORDER, n.Fn.BITS))
        });
    }
    function mUe(t) {
        const { CURVE: e, curveOpts: n, hash: r, ecdsaOpts: s } = gUe(t), i = dUe(e, n), o = pUe(i, r, s);
        return bUe(t, o);
    }
    function yUe(t, e) {
        const n = (r)=>mUe({
                ...t,
                hash: r
            });
        return {
            ...n(e),
            create: n
        };
    }
    const SA = {
        p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
        n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
        h: BigInt(1),
        a: BigInt(0),
        b: BigInt(7),
        Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
        Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
    }, wUe = {
        beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
        basises: [
            [
                BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
                -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")
            ],
            [
                BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
                BigInt("0x3086d221a7d46bcde86c90e49284eb15")
            ]
        ]
    }, YV = BigInt(2);
    function _Ue(t) {
        const e = SA.p, n = BigInt(3), r = BigInt(6), s = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = t * t * t % e, u = l * l * t % e, d = Vo(u, n, e) * u % e, f = Vo(d, n, e) * u % e, p = Vo(f, YV, e) * l % e, h = Vo(p, s, e) * p % e, m = Vo(h, i, e) * h % e, w = Vo(m, a, e) * m % e, v = Vo(w, c, e) * w % e, k = Vo(v, a, e) * m % e, _ = Vo(k, n, e) * u % e, A = Vo(_, o, e) * h % e, P = Vo(A, r, e) * l % e, U = Vo(P, YV, e);
        if (!qk.eql(qk.sqr(U), t)) throw new Error("Cannot find square root");
        return U;
    }
    const qk = hU(SA.p, {
        sqrt: _Ue
    }), xUe = yUe({
        ...SA,
        Fp: qk,
        lowS: !0,
        endo: wUe
    }, cne), vUe = BigInt(0), Ob = BigInt(1), SUe = BigInt(2), kUe = BigInt(7), TUe = BigInt(256), CUe = BigInt(113), EJ = [], IJ = [], AJ = [];
    for(let t = 0, e = Ob, n = 1, r = 0; t < 24; t++){
        [n, r] = [
            r,
            (2 * n + 3 * r) % 5
        ], EJ.push(2 * (5 * r + n)), IJ.push((t + 1) * (t + 2) / 2 % 64);
        let s = vUe;
        for(let i = 0; i < 7; i++)e = (e << Ob ^ (e >> kUe) * CUe) % TUe, e & SUe && (s ^= Ob << (Ob << BigInt(i)) - Ob);
        AJ.push(s);
    }
    const PJ = yne(AJ, !0), EUe = PJ[0], IUe = PJ[1], QV = (t, e, n)=>n > 32 ? hne(t, e, n) : gne(t, e, n), eD = (t, e, n)=>n > 32 ? bne(t, e, n) : mne(t, e, n);
    function AUe(t, e = 24) {
        const n = new Uint32Array(10);
        for(let r = 24 - e; r < 24; r++){
            for(let o = 0; o < 10; o++)n[o] = t[o] ^ t[o + 10] ^ t[o + 20] ^ t[o + 30] ^ t[o + 40];
            for(let o = 0; o < 10; o += 2){
                const a = (o + 8) % 10, c = (o + 2) % 10, l = n[c], u = n[c + 1], d = QV(l, u, 1) ^ n[a], f = eD(l, u, 1) ^ n[a + 1];
                for(let p = 0; p < 50; p += 10)t[o + p] ^= d, t[o + p + 1] ^= f;
            }
            let s = t[2], i = t[3];
            for(let o = 0; o < 24; o++){
                const a = IJ[o], c = QV(s, i, a), l = eD(s, i, a), u = EJ[o];
                s = t[u], i = t[u + 1], t[u] = c, t[u + 1] = l;
            }
            for(let o = 0; o < 50; o += 10){
                for(let a = 0; a < 10; a++)n[a] = t[o + a];
                for(let a = 0; a < 10; a++)t[o + a] ^= ~n[(a + 2) % 10] & n[(a + 4) % 10];
            }
            t[0] ^= EUe[r], t[1] ^= IUe[r];
        }
        gU(n);
    }
    class kA extends une {
        constructor(e, n, r, s = !1, i = 24){
            if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = i, WO(r), !(0 < e && e < 200)) throw new Error("only keccak-f1600 function is supported");
            this.state = new Uint8Array(200), this.state32 = dne(this.state);
        }
        clone() {
            return this._cloneInto();
        }
        keccak() {
            KO(this.state32), AUe(this.state32, this.rounds), KO(this.state32), this.posOut = 0, this.pos = 0;
        }
        update(e) {
            $O(this), e = fne(e), XO(e);
            const { blockLen: n, state: r } = this, s = e.length;
            for(let i = 0; i < s;){
                const o = Math.min(n - this.pos, s - i);
                for(let a = 0; a < o; a++)r[this.pos++] ^= e[i++];
                this.pos === n && this.keccak();
            }
            return this;
        }
        finish() {
            if (this.finished) return;
            this.finished = !0;
            const { state: e, suffix: n, pos: r, blockLen: s } = this;
            e[r] ^= n, (n & 128) !== 0 && r === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
        }
        writeInto(e) {
            $O(this, !1), XO(e), this.finish();
            const n = this.state, { blockLen: r } = this;
            for(let s = 0, i = e.length; s < i;){
                this.posOut >= r && this.keccak();
                const o = Math.min(r - this.posOut, i - s);
                e.set(n.subarray(this.posOut, this.posOut + o), s), this.posOut += o, s += o;
            }
            return e;
        }
        xofInto(e) {
            if (!this.enableXOF) throw new Error("XOF is not possible for this instance");
            return this.writeInto(e);
        }
        xof(e) {
            return WO(e), this.xofInto(new Uint8Array(e));
        }
        digestInto(e) {
            if (pne(e, this), this.finished) throw new Error("digest() was already called");
            return this.writeInto(e), this.destroy(), e;
        }
        digest() {
            return this.digestInto(new Uint8Array(this.outputLen));
        }
        destroy() {
            this.destroyed = !0, gU(this.state);
        }
        _cloneInto(e) {
            const { blockLen: n, suffix: r, outputLen: s, rounds: i, enableXOF: o } = this;
            return e || (e = new kA(n, r, s, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = r, e.outputLen = s, e.enableXOF = o, e.destroyed = this.destroyed, e;
        }
    }
    let OJ, OUe;
    OJ = (t, e, n)=>lne(()=>new kA(e, t, n));
    PUe = OJ(1, 136, 256 / 8);
    OUe = OJ(1, 72, 512 / 8);
    function MJ(t, e = W_.prefix) {
        const n = Xd(t);
        if (e < 0 || e > 16383 && !MUe.includes(e) || [
            46,
            47
        ].includes(e)) throw new Error("Out of range ss58Format specified");
        if (!W_.allowedDecodedLengths.includes(n.length)) throw new Error(`Expected a valid key to convert, with length ${W_.allowedDecodedLengths.join(", ")}`);
        const r = Ai(e < 64 ? [
            e
        ] : [
            (e & 252) >> 2 | 64,
            e >> 8 | (e & 3) << 6
        ], n);
        return Wze(Ai(r, vJ(r).subarray(0, [
            32,
            33
        ].includes(n.length) ? 2 : 1)));
    }
    const MUe = [
        29972
    ], TA = $ze({
        256: Eze,
        512: Ize
    }, {
        256: PUe,
        512: OUe
    });
    function RUe(t, e) {
        if (![
            33,
            65
        ].includes(t.length)) throw new Error(`Invalid publicKey provided, received ${t.length} bytes input`);
        if (t.length === 65) return t.subarray(1);
        if (!j3 || L1()) return Tze(t).subarray(1);
        const { x: n, y: r } = xUe.ProjectivePoint.fromHex(t);
        return Ai($l(n, ZV), $l(r, ZV));
    }
    function NUe(t) {
        return [
            33,
            65
        ].includes(t.length) && (t = TA(RUe(t))), t.slice(-20);
    }
    function VUe(t) {
        if (!t) return "0x";
        const e = Dt(t);
        if (![
            20,
            32,
            33,
            65
        ].includes(e.length)) throw new Error(`Invalid address or publicKey provided, received ${e.length} bytes input`);
        const n = nn(NUe(e), -1, !1), r = nn(TA(n), -1, !1);
        let s = "";
        for(let i = 0; i < 40; i++)s = `${s}${parseInt(r[i], 16) > 7 ? n[i].toUpperCase() : n[i]}`;
        return `0x${s}`;
    }
    function DUe(t, e) {
        return t !== (e > 7 ? t.toUpperCase() : t.toLowerCase());
    }
    function BUe(t) {
        const e = t.replace("0x", ""), n = nn(TA(e.toLowerCase()), -1, !1);
        for(let r = 0; r < 40; r++)if (DUe(e[r], parseInt(n[r], 16))) return !1;
        return !0;
    }
    function FUe(t) {
        return !t || t.length !== 42 || !Fn(t) ? !1 : /^(0x)?[0-9a-f]{40}$/.test(t) || /^(0x)?[0-9A-F]{40}$/.test(t) ? !0 : BUe(t);
    }
    const hi = cr("11400714785074694791"), wc = cr("14029467366897019727"), tD = cr("1609587929392839161"), Mb = cr("9650029242287828579"), nD = cr("2870177450012600261"), _l = cr("0xffffffffffffffff"), LUe = cr(7), zUe = cr(11), UUe = cr(12), HUe = cr(16), jUe = cr(18), qUe = cr(23), WUe = cr(27), KUe = cr(29), Rh = cr(31), $Ue = cr(32), XUe = cr(33), GUe = cr(64), rD = cr(256);
    function oo(t, e) {
        const n = t & _l;
        return (n << e | n >> GUe - e) & _l;
    }
    function Wk(t, e, n) {
        const r = new Array(n);
        let s = 0;
        for(let o = 0; o < n; o++, s += 2)r[o] = cr(t[e + s] | t[e + 1 + s] << 8);
        let i = aLe;
        for(let o = n - 1; o >= 0; o--)i = (i << HUe) + r[o];
        return i;
    }
    function ZUe(t, e) {
        const n = {
            seed: t,
            u8a: new Uint8Array(32),
            u8asize: 0,
            v1: t + hi + wc,
            v2: t + wc,
            v3: t,
            v4: t - hi
        };
        if (e.length < 32) return n.u8a.set(e), n.u8asize = e.length, n;
        const r = e.length - 32;
        let s = 0;
        if (r >= 0) {
            const i = (o)=>hi * oo(o + wc * Wk(e, s, 4), Rh);
            do n.v1 = i(n.v1), s += 8, n.v2 = i(n.v2), s += 8, n.v3 = i(n.v3), s += 8, n.v4 = i(n.v4), s += 8;
            while (s <= r);
        }
        return s < e.length && (n.u8a.set(e.subarray(s, e.length)), n.u8asize = e.length - s), n;
    }
    function JUe(t, e) {
        const { seed: n, u8a: r, u8asize: s, v1: i, v2: o, v3: a, v4: c } = ZUe(cr(e), t);
        let l = 0, u = _l & cr(t.length) + (t.length >= 32 ? ((((oo(i, cLe) + oo(o, LUe) + oo(a, UUe) + oo(c, jUe) ^ hi * oo(i * wc, Rh)) * hi + Mb ^ hi * oo(o * wc, Rh)) * hi + Mb ^ hi * oo(a * wc, Rh)) * hi + Mb ^ hi * oo(c * wc, Rh)) * hi + Mb : n + nD);
        for(; l <= s - 8;)u = _l & Mb + hi * oo(u ^ hi * oo(wc * Wk(r, l, 4), Rh), WUe), l += 8;
        for(l + 4 <= s && (u = _l & tD + wc * oo(u ^ hi * Wk(r, l, 2), qUe), l += 4); l < s;)u = _l & hi * oo(u ^ nD * cr(r[l++]), zUe);
        u = _l & wc * (u ^ u >> XUe), u = _l & tD * (u ^ u >> KUe), u = _l & (u ^ u >> $Ue);
        const d = new Uint8Array(8);
        for(let f = 7; f >= 0; f--)d[f] = Number(u % rD), u = u / rD;
        return d;
    }
    function t0(t, e = 64, n) {
        const r = Math.ceil(e / 64), s = Dt(t);
        if (!j3 || !n && L1()) return Aze(s, r);
        const i = new Uint8Array(r * 8);
        for(let o = 0; o < r; o++)i.set(JUe(s, o).reverse(), o * 8);
        return i;
    }
    const sD = -99999;
    function Rb(t, e, n) {
        Object.defineProperty(t, e, {
            configurable: !0,
            enumerable: !1,
            value: n
        });
    }
    class YUe extends Error {
        code;
        data;
        message;
        name;
        stack;
        constructor(e = "", n = sD, r){
            if (super(), Rb(this, "message", String(e)), Rb(this, "name", this.constructor.name), Rb(this, "data", r), Rb(this, "code", n), Mt(Error.captureStackTrace)) Error.captureStackTrace(this, this.constructor);
            else {
                const { stack: s } = new Error(e);
                s && Rb(this, "stack", s);
            }
        }
        static CODES = {
            ASSERT: -90009,
            INVALID_JSONRPC: -99998,
            METHOD_NOT_FOUND: -32601,
            UNKNOWN: sD
        };
    }
    function QUe(t) {
        if (Rr(t)) return "";
        const e = `: ${br(t) ? t.replace(/Error\("/g, "").replace(/\("/g, "(").replace(/"\)/g, ")").replace(/\(/g, ", ").replace(/\)/g, "") : vn(t)}`;
        return e.length <= 256 ? e : `${e.substring(0, 255)}…`;
    }
    function iD(t) {
        if (t) {
            const { code: e, data: n, message: r } = t;
            throw new YUe(`${e}: ${r}${QUe(n)}`, e, n);
        }
    }
    class eHe {
        #e = 0;
        decodeResponse(e) {
            if (!e || e.jsonrpc !== "2.0") throw new Error("Invalid jsonrpc field in decoded object");
            const n = !Rr(e.params) && !Rr(e.method);
            if (!Xn(e.id) && (!n || !Xn(e.params.subscription) && !br(e.params.subscription))) throw new Error("Invalid id field in decoded object");
            if (iD(e.error), e.result === void 0 && !n) throw new Error("No result found in jsonrpc response");
            return n ? (iD(e.params.error), e.params.result) : e.result;
        }
        encodeJson(e, n) {
            const [r, s] = this.encodeObject(e, n);
            return [
                r,
                vn(s)
            ];
        }
        encodeObject(e, n) {
            const r = ++this.#e;
            return [
                r,
                {
                    id: r,
                    jsonrpc: "2.0",
                    method: e,
                    params: n
                }
            ];
        }
    }
    const tHe = "ws://127.0.0.1:9944", nHe = {
        WS_URL: tHe
    }, Kk = 1024, RJ = 3e4, oD = 18e5, rHe = 31536e6;
    class gS {
        key;
        #e;
        #t;
        createdAt;
        next;
        prev;
        constructor(e, n){
            this.key = e, this.#t = n, this.#e = Date.now() + n, this.createdAt = Date.now(), this.next = this.prev = this;
        }
        refresh() {
            this.#e = Date.now() + this.#t;
        }
        get expiry() {
            return this.#e;
        }
    }
    class NJ {
        capacity;
        #e = new Map;
        #t = new Map;
        #n = 0;
        #r;
        #s;
        #i;
        constructor(e = Kk, n = RJ){
            if (!Number.isInteger(e) || e < 0) throw new Error(`LRUCache initialization error: 'capacity' must be a non-negative integer. Received: ${e}`);
            if (n !== null && (!Number.isFinite(n) || n < 0 || n > oD)) throw new Error(`LRUCache initialization error: 'ttl' must be between 0 and ${oD} ms or null to disable. Received: ${n}`);
            this.capacity = e, n ? this.#i = n : this.#i = rHe, this.#r = this.#s = new gS("<empty>", this.#i);
        }
        get ttl() {
            return this.#i;
        }
        get length() {
            return this.#n;
        }
        get lengthData() {
            return this.#e.size;
        }
        get lengthRefs() {
            return this.#t.size;
        }
        entries() {
            const e = this.keys(), n = e.length, r = new Array(n);
            for(let s = 0; s < n; s++){
                const i = e[s];
                r[s] = [
                    i,
                    this.#e.get(i)
                ];
            }
            return r;
        }
        keys() {
            const e = [];
            if (this.#n) {
                let n = this.#r;
                for(; n !== this.#s;)e.push(n.key), n = n.next;
                e.push(n.key);
            }
            return e;
        }
        get(e) {
            const n = this.#e.get(e);
            return n ? (this.#a(e), this.#o(), n) : (this.#o(), null);
        }
        set(e, n) {
            if (this.#e.has(e)) this.#a(e);
            else {
                const r = new gS(e, this.#i);
                this.#t.set(r.key, r), this.length === 0 ? this.#r = this.#s = r : (this.#r.prev = r, r.next = this.#r, this.#r = r), this.#n === this.capacity ? (this.#e.delete(this.#s.key), this.#t.delete(this.#s.key), this.#s = this.#s.prev, this.#s.next = this.#r) : this.#n += 1;
            }
            this.#o(), this.#e.set(e, n);
        }
        #o() {
            for(; this.#s.expiry && this.#s.expiry < Date.now() && this.#n > 0;)this.#t.delete(this.#s.key), this.#e.delete(this.#s.key), this.#n -= 1, this.#s = this.#s.prev, this.#s.next = this.#r;
            this.#n === 0 && (this.#r = this.#s = new gS("<empty>", this.#i));
        }
        #a(e) {
            const n = this.#t.get(e);
            n && n !== this.#r && (n.refresh(), n.prev.next = n.next, n.next.prev = n.prev, n.next = this.#r, this.#r.prev = n, this.#r = n);
        }
    }
    var bS = {
        exports: {}
    }, aD;
    function sHe() {
        return aD || (aD = 1, (function(t) {
            var e = Object.prototype.hasOwnProperty, n = "~";
            function r() {}
            Object.create && (r.prototype = Object.create(null), new r().__proto__ || (n = !1));
            function s(c, l, u) {
                this.fn = c, this.context = l, this.once = u || !1;
            }
            function i(c, l, u, d, f) {
                if (typeof u != "function") throw new TypeError("The listener must be a function");
                var p = new s(u, d || c, f), h = n ? n + l : l;
                return c._events[h] ? c._events[h].fn ? c._events[h] = [
                    c._events[h],
                    p
                ] : c._events[h].push(p) : (c._events[h] = p, c._eventsCount++), c;
            }
            function o(c, l) {
                --c._eventsCount === 0 ? c._events = new r : delete c._events[l];
            }
            function a() {
                this._events = new r, this._eventsCount = 0;
            }
            a.prototype.eventNames = function() {
                var l = [], u, d;
                if (this._eventsCount === 0) return l;
                for(d in u = this._events)e.call(u, d) && l.push(n ? d.slice(1) : d);
                return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(u)) : l;
            }, a.prototype.listeners = function(l) {
                var u = n ? n + l : l, d = this._events[u];
                if (!d) return [];
                if (d.fn) return [
                    d.fn
                ];
                for(var f = 0, p = d.length, h = new Array(p); f < p; f++)h[f] = d[f].fn;
                return h;
            }, a.prototype.listenerCount = function(l) {
                var u = n ? n + l : l, d = this._events[u];
                return d ? d.fn ? 1 : d.length : 0;
            }, a.prototype.emit = function(l, u, d, f, p, h) {
                var m = n ? n + l : l;
                if (!this._events[m]) return !1;
                var w = this._events[m], v = arguments.length, k, _;
                if (w.fn) {
                    switch(w.once && this.removeListener(l, w.fn, void 0, !0), v){
                        case 1:
                            return w.fn.call(w.context), !0;
                        case 2:
                            return w.fn.call(w.context, u), !0;
                        case 3:
                            return w.fn.call(w.context, u, d), !0;
                        case 4:
                            return w.fn.call(w.context, u, d, f), !0;
                        case 5:
                            return w.fn.call(w.context, u, d, f, p), !0;
                        case 6:
                            return w.fn.call(w.context, u, d, f, p, h), !0;
                    }
                    for(_ = 1, k = new Array(v - 1); _ < v; _++)k[_ - 1] = arguments[_];
                    w.fn.apply(w.context, k);
                } else {
                    var A = w.length, P;
                    for(_ = 0; _ < A; _++)switch(w[_].once && this.removeListener(l, w[_].fn, void 0, !0), v){
                        case 1:
                            w[_].fn.call(w[_].context);
                            break;
                        case 2:
                            w[_].fn.call(w[_].context, u);
                            break;
                        case 3:
                            w[_].fn.call(w[_].context, u, d);
                            break;
                        case 4:
                            w[_].fn.call(w[_].context, u, d, f);
                            break;
                        default:
                            if (!k) for(P = 1, k = new Array(v - 1); P < v; P++)k[P - 1] = arguments[P];
                            w[_].fn.apply(w[_].context, k);
                    }
                }
                return !0;
            }, a.prototype.on = function(l, u, d) {
                return i(this, l, u, d, !1);
            }, a.prototype.once = function(l, u, d) {
                return i(this, l, u, d, !0);
            }, a.prototype.removeListener = function(l, u, d, f) {
                var p = n ? n + l : l;
                if (!this._events[p]) return this;
                if (!u) return o(this, p), this;
                var h = this._events[p];
                if (h.fn) h.fn === u && (!f || h.once) && (!d || h.context === d) && o(this, p);
                else {
                    for(var m = 0, w = [], v = h.length; m < v; m++)(h[m].fn !== u || f && !h[m].once || d && h[m].context !== d) && w.push(h[m]);
                    w.length ? this._events[p] = w.length === 1 ? w[0] : w : o(this, p);
                }
                return this;
            }, a.prototype.removeAllListeners = function(l) {
                var u;
                return l ? (u = n ? n + l : l, this._events[u] && o(this, u)) : (this._events = new r, this._eventsCount = 0), this;
            }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = n, a.EventEmitter = a, t.exports = a;
        })(bS)), bS.exports;
    }
    var iHe = sHe();
    const VJ = mU(iHe), mS = da.WebSocket, oHe = {
        1e3: "Normal Closure",
        1001: "Going Away",
        1002: "Protocol Error",
        1003: "Unsupported Data",
        1004: "(For future)",
        1005: "No Status Received",
        1006: "Abnormal Closure",
        1007: "Invalid frame payload data",
        1008: "Policy Violation",
        1009: "Message too big",
        1010: "Missing Extension",
        1011: "Internal Error",
        1012: "Service Restart",
        1013: "Try Again Later",
        1014: "Bad Gateway",
        1015: "TLS Handshake"
    };
    function aHe(t) {
        if (t >= 0 && t <= 999) return "(Unused)";
        if (t >= 1016) {
            if (t <= 1999) return "(For WebSocket standard)";
            if (t <= 2999) return "(For WebSocket extensions)";
            if (t <= 3999) return "(For libraries and frameworks)";
            if (t <= 4999) return "(For applications)";
        }
        return oHe[t] || "(Unknown)";
    }
    const cHe = {
        chain_finalisedHead: "chain_finalizedHead",
        chain_subscribeFinalisedHeads: "chain_subscribeFinalizedHeads",
        chain_unsubscribeFinalisedHeads: "chain_unsubscribeFinalizedHeads"
    }, lHe = 2500, uHe = 60 * 1e3, dHe = 5e3, ro = ma("api-ws");
    function cD(t, e) {
        Object.keys(t).forEach((n)=>{
            e && e(t[n]), delete t[n];
        });
    }
    function yS() {
        return {
            bytesRecv: 0,
            bytesSent: 0,
            cached: 0,
            errors: 0,
            requests: 0,
            subscriptions: 0,
            timeout: 0
        };
    }
    class K3 {
        #e;
        #t;
        #n;
        #r;
        #s;
        #i = {};
        #o;
        #a;
        #l = {};
        #f;
        #y;
        #p;
        #h;
        #u;
        #b = !1;
        #d = {};
        #g = null;
        #c;
        #w;
        constructor(e = nHe.WS_URL, n = lHe, r = {}, s, i, o){
            const a = Array.isArray(e) ? e : [
                e
            ];
            if (a.length === 0) throw new Error("WsProvider requires at least one Endpoint");
            a.forEach((l)=>{
                if (!/^(wss|ws):\/\//.test(l)) throw new Error(`Endpoint should start with 'ws://', received '${l}'`);
            });
            const c = o === void 0 ? RJ : o;
            this.#e = new NJ(i === 0 ? 0 : i || Kk, c), this.#y = o, this.#f = i || Kk, this.#s = new VJ, this.#p = n || 0, this.#t = new eHe, this.#h = -1, this.#n = a, this.#r = r, this.#c = null, this.#a = {
                active: {
                    requests: 0,
                    subscriptions: 0
                },
                total: yS()
            }, this.#u = yS(), this.#w = s || uHe, n && n > 0 && this.connectWithRetry().catch(Xl), this.#o = new Promise((l)=>{
                this.#s.once("connected", ()=>{
                    l(this);
                });
            });
        }
        get hasSubscriptions() {
            return !0;
        }
        get isClonable() {
            return !0;
        }
        get isConnected() {
            return this.#b;
        }
        get isReady() {
            return this.#o;
        }
        get endpoint() {
            return this.#n[this.#h];
        }
        clone() {
            return new K3(this.#n);
        }
        selectEndpointIndex(e) {
            return (this.#h + 1) % e.length;
        }
        async connect() {
            if (this.#c) throw new Error("WebSocket is already connected");
            try {
                this.#h = this.selectEndpointIndex(this.#n), this.#c = typeof da.WebSocket < "u" && ULe(da.WebSocket, mS) ? new mS(this.endpoint) : new mS(this.endpoint, void 0, {
                    headers: this.#r
                }), this.#c && (this.#c.onclose = this.#x, this.#c.onerror = this.#v, this.#c.onmessage = this.#k, this.#c.onopen = this.#C), this.#g = setInterval(()=>this.#I(), dHe);
            } catch (e) {
                throw ro.error(e), this.#m("error", e), e;
            }
        }
        async connectWithRetry() {
            if (this.#p > 0) try {
                await this.connect();
            } catch  {
                setTimeout(()=>{
                    this.connectWithRetry().catch(Xl);
                }, this.#p);
            }
        }
        async disconnect() {
            this.#p = 0;
            try {
                this.#c && this.#c.close(1e3);
            } catch (e) {
                throw ro.error(e), this.#m("error", e), e;
            }
        }
        get stats() {
            return {
                active: {
                    requests: Object.keys(this.#i).length,
                    subscriptions: Object.keys(this.#d).length
                },
                total: this.#a.total
            };
        }
        get ttl() {
            return this.#y;
        }
        get endpointStats() {
            return this.#u;
        }
        on(e, n) {
            return this.#s.on(e, n), ()=>{
                this.#s.removeListener(e, n);
            };
        }
        send(e, n, r, s) {
            this.#u.requests++, this.#a.total.requests++;
            const [i, o] = this.#t.encodeJson(e, n);
            if (this.#f === 0) return this.#_(i, o, e, n, s);
            const a = r ? `${e}::${vn(n)}` : "";
            let c = r ? this.#e.get(a) : null;
            return c ? (this.#u.cached++, this.#a.total.cached++) : (c = this.#_(i, o, e, n, s), r && this.#e.set(a, c)), c;
        }
        async #_(e, n, r, s, i) {
            return new Promise((o, a)=>{
                try {
                    if (!this.isConnected || this.#c === null) throw new Error("WebSocket is not connected");
                    const c = (u, d)=>{
                        u ? a(u) : o(d);
                    };
                    ro.debug(()=>[
                            "calling",
                            r,
                            n
                        ]), this.#i[e] = {
                        callback: c,
                        method: r,
                        params: s,
                        start: Date.now(),
                        subscription: i
                    };
                    const l = n.length;
                    this.#u.bytesSent += l, this.#a.total.bytesSent += l, this.#c.send(n);
                } catch (c) {
                    this.#u.errors++, this.#a.total.errors++;
                    const l = c, u = `
Failed WS Request: ${JSON.stringify({
                        method: r,
                        params: s
                    })}`;
                    l.message = `${l.message}${u}`, a(l);
                }
            });
        }
        subscribe(e, n, r, s) {
            return this.#u.subscriptions++, this.#a.total.subscriptions++, this.send(n, r, !1, {
                callback: s,
                type: e
            });
        }
        async unsubscribe(e, n, r) {
            const s = `${e}::${r}`;
            if (Rr(this.#d[s])) return ro.debug(()=>`Unable to find active subscription=${s}`), !1;
            delete this.#d[s];
            try {
                return this.isConnected && !Gf(this.#c) ? this.send(n, [
                    r
                ]) : !0;
            } catch  {
                return !1;
            }
        }
        #m = (e, ...n)=>{
            this.#s.emit(e, ...n);
        };
        #x = (e)=>{
            const n = new Error(`disconnected from ${this.endpoint}: ${e.code}:: ${e.reason || aHe(e.code)}`);
            this.#p > 0 && ro.error(n.message), this.#b = !1, this.#c && (this.#c.onclose = null, this.#c.onerror = null, this.#c.onmessage = null, this.#c.onopen = null, this.#c = null), this.#g && (clearInterval(this.#g), this.#g = null), cD(this.#i, (r)=>{
                try {
                    r.callback(n, void 0);
                } catch (s) {
                    ro.error(s);
                }
            }), cD(this.#l), this.#u = yS(), this.#m("disconnected"), this.#p > 0 && setTimeout(()=>{
                this.connectWithRetry().catch(Xl);
            }, this.#p);
        };
        #v = (e)=>{
            ro.debug(()=>[
                    "socket error",
                    e
                ]), this.#m("error", e);
        };
        #k = (e)=>{
            ro.debug(()=>[
                    "received",
                    e.data
                ]);
            const n = e.data.length;
            this.#u.bytesRecv += n, this.#a.total.bytesRecv += n;
            const r = JSON.parse(e.data);
            return Rr(r.method) ? this.#T(r) : this.#S(r);
        };
        #T = (e)=>{
            const n = this.#i[e.id];
            if (!n) {
                ro.debug(()=>`Unable to find handler for id=${e.id}`);
                return;
            }
            try {
                const { method: r, params: s, subscription: i } = n, o = this.#t.decodeResponse(e);
                if (n.callback(null, o), i) {
                    const a = `${i.type}::${o}`;
                    this.#d[a] = Ye({}, i, {
                        method: r,
                        params: s
                    }), this.#l[a] && this.#S(this.#l[a]);
                }
            } catch (r) {
                this.#u.errors++, this.#a.total.errors++, n.callback(r, void 0);
            }
            delete this.#i[e.id];
        };
        #S = (e)=>{
            if (!e.method) throw new Error("No method found in JSONRPC response");
            const r = `${cHe[e.method] || e.method}::${e.params.subscription}`, s = this.#d[r];
            if (!s) {
                this.#l[r] = e, ro.debug(()=>`Unable to find handler for subscription=${r}`);
                return;
            }
            delete this.#l[r];
            try {
                const i = this.#t.decodeResponse(e);
                s.callback(null, i);
            } catch (i) {
                this.#u.errors++, this.#a.total.errors++, s.callback(i, void 0);
            }
        };
        #C = ()=>{
            if (this.#c === null) throw new Error("WebSocket cannot be null in onOpen");
            return ro.debug(()=>[
                    "connected to",
                    this.endpoint
                ]), this.#b = !0, this.#E(), this.#m("connected"), !0;
        };
        #E = ()=>{
            const e = this.#d;
            this.#d = {}, Promise.all(Object.keys(e).map(async (n)=>{
                const { callback: r, method: s, params: i, type: o } = e[n];
                if (!o.startsWith("author_")) try {
                    await this.subscribe(o, s, i, r);
                } catch (a) {
                    ro.error(a);
                }
            })).catch(ro.error);
        };
        #I = ()=>{
            const e = Date.now(), n = Object.keys(this.#i);
            for(let r = 0, s = n.length; r < s; r++){
                const i = this.#i[n[r]];
                if (e - i.start > this.#w) {
                    try {
                        i.callback(new Error(`No response received from RPC endpoint in ${this.#w / 1e3}s`), void 0);
                    } catch  {}
                    this.#u.timeout++, this.#a.total.timeout++, delete this.#i[n[r]];
                }
            }
        };
    }
    const fHe = ma("api/util");
    function pHe(t, { block: { extrinsics: e, header: n } }, r, s) {
        for (const [i, o] of e.entries())if (o.hash.eq(t)) return {
            blockNumber: cJ(n.number) ? n.number.unwrap() : n.number,
            events: r.filter(({ phase: a })=>a.isApplyExtrinsic && a.asApplyExtrinsic.eqn(i)),
            txIndex: i
        };
        if (s.isInBlock) {
            const i = e.map((o)=>o.hash.toHex());
            fHe.warn(`block ${n.hash.toHex()}: Unable to find extrinsic ${t.toHex()} inside ${i.join(", ")}`);
        }
        return {};
    }
    function wS(t) {
        return Mt(t.sign);
    }
    const hHe = {
        Blake2_128: null,
        Blake2_256: null,
        Blake2_128Concat: null,
        Twox128: null,
        Twox256: null,
        Twox64Concat: null,
        Identity: null
    }, lD = {
        metadata: {
            description: "Returns the metadata of a runtime",
            params: [],
            type: "OpaqueMetadata"
        }
    }, gHe = {
        Metadata: [
            {
                methods: {
                    metadata_at_version: {
                        description: "Returns the metadata at a given version.",
                        params: [
                            {
                                name: "version",
                                type: "u32"
                            }
                        ],
                        type: "Option<OpaqueMetadata>"
                    },
                    metadata_versions: {
                        description: "Returns the supported metadata versions.",
                        params: [],
                        type: "Vec<u32>"
                    },
                    ...lD
                },
                version: 2
            },
            {
                methods: {
                    ...lD
                },
                version: 1
            }
        ]
    }, bHe = {
        ErrorMetadataV9: {
            name: "Text",
            docs: "Vec<Text>"
        },
        EventMetadataV9: {
            name: "Text",
            args: "Vec<Type>",
            docs: "Vec<Text>"
        },
        FunctionArgumentMetadataV9: {
            name: "Text",
            type: "Type"
        },
        FunctionMetadataV9: {
            name: "Text",
            args: "Vec<FunctionArgumentMetadataV9>",
            docs: "Vec<Text>"
        },
        MetadataV9: {
            modules: "Vec<ModuleMetadataV9>"
        },
        ModuleConstantMetadataV9: {
            name: "Text",
            type: "Type",
            value: "Bytes",
            docs: "Vec<Text>"
        },
        ModuleMetadataV9: {
            name: "Text",
            storage: "Option<StorageMetadataV9>",
            calls: "Option<Vec<FunctionMetadataV9>>",
            events: "Option<Vec<EventMetadataV9>>",
            constants: "Vec<ModuleConstantMetadataV9>",
            errors: "Vec<ErrorMetadataV9>"
        },
        StorageEntryMetadataV9: {
            name: "Text",
            modifier: "StorageEntryModifierV9",
            type: "StorageEntryTypeV9",
            fallback: "Bytes",
            docs: "Vec<Text>"
        },
        StorageEntryModifierV9: {
            _enum: [
                "Optional",
                "Default",
                "Required"
            ]
        },
        StorageEntryTypeV9: {
            _enum: {
                Plain: "Type",
                Map: {
                    hasher: "StorageHasherV9",
                    key: "Type",
                    value: "Type",
                    linked: "bool"
                },
                DoubleMap: {
                    hasher: "StorageHasherV9",
                    key1: "Type",
                    key2: "Type",
                    value: "Type",
                    key2Hasher: "StorageHasherV9"
                }
            }
        },
        StorageHasherV9: {
            _enum: {
                Blake2_128: null,
                Blake2_256: null,
                Twox128: null,
                Twox256: null,
                Twox64Concat: null
            }
        },
        StorageMetadataV9: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV9>"
        }
    }, mHe = {
        ErrorMetadataV10: "ErrorMetadataV9",
        EventMetadataV10: "EventMetadataV9",
        FunctionArgumentMetadataV10: "FunctionArgumentMetadataV9",
        FunctionMetadataV10: "FunctionMetadataV9",
        MetadataV10: {
            modules: "Vec<ModuleMetadataV10>"
        },
        ModuleConstantMetadataV10: "ModuleConstantMetadataV9",
        ModuleMetadataV10: {
            name: "Text",
            storage: "Option<StorageMetadataV10>",
            calls: "Option<Vec<FunctionMetadataV10>>",
            events: "Option<Vec<EventMetadataV10>>",
            constants: "Vec<ModuleConstantMetadataV10>",
            errors: "Vec<ErrorMetadataV10>"
        },
        StorageEntryModifierV10: "StorageEntryModifierV9",
        StorageEntryMetadataV10: {
            name: "Text",
            modifier: "StorageEntryModifierV10",
            type: "StorageEntryTypeV10",
            fallback: "Bytes",
            docs: "Vec<Text>"
        },
        StorageEntryTypeV10: {
            _enum: {
                Plain: "Type",
                Map: {
                    hasher: "StorageHasherV10",
                    key: "Type",
                    value: "Type",
                    linked: "bool"
                },
                DoubleMap: {
                    hasher: "StorageHasherV10",
                    key1: "Type",
                    key2: "Type",
                    value: "Type",
                    key2Hasher: "StorageHasherV10"
                }
            }
        },
        StorageMetadataV10: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV10>"
        },
        StorageHasherV10: {
            _enum: {
                Blake2_128: null,
                Blake2_256: null,
                Blake2_128Concat: null,
                Twox128: null,
                Twox256: null,
                Twox64Concat: null
            }
        }
    }, yHe = {
        ErrorMetadataV11: "ErrorMetadataV10",
        EventMetadataV11: "EventMetadataV10",
        ExtrinsicMetadataV11: {
            version: "u8",
            signedExtensions: "Vec<Text>"
        },
        FunctionArgumentMetadataV11: "FunctionArgumentMetadataV10",
        FunctionMetadataV11: "FunctionMetadataV10",
        MetadataV11: {
            modules: "Vec<ModuleMetadataV11>",
            extrinsic: "ExtrinsicMetadataV11"
        },
        ModuleConstantMetadataV11: "ModuleConstantMetadataV10",
        ModuleMetadataV11: {
            name: "Text",
            storage: "Option<StorageMetadataV11>",
            calls: "Option<Vec<FunctionMetadataV11>>",
            events: "Option<Vec<EventMetadataV11>>",
            constants: "Vec<ModuleConstantMetadataV11>",
            errors: "Vec<ErrorMetadataV11>"
        },
        StorageEntryModifierV11: "StorageEntryModifierV10",
        StorageEntryMetadataV11: {
            name: "Text",
            modifier: "StorageEntryModifierV11",
            type: "StorageEntryTypeV11",
            fallback: "Bytes",
            docs: "Vec<Text>"
        },
        StorageEntryTypeV11: {
            _enum: {
                Plain: "Type",
                Map: {
                    hasher: "StorageHasherV11",
                    key: "Type",
                    value: "Type",
                    linked: "bool"
                },
                DoubleMap: {
                    hasher: "StorageHasherV11",
                    key1: "Type",
                    key2: "Type",
                    value: "Type",
                    key2Hasher: "StorageHasherV11"
                }
            }
        },
        StorageMetadataV11: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV11>"
        },
        StorageHasherV11: {
            _enum: hHe
        }
    }, wHe = {
        ErrorMetadataV12: "ErrorMetadataV11",
        EventMetadataV12: "EventMetadataV11",
        ExtrinsicMetadataV12: "ExtrinsicMetadataV11",
        FunctionArgumentMetadataV12: "FunctionArgumentMetadataV11",
        FunctionMetadataV12: "FunctionMetadataV11",
        MetadataV12: {
            modules: "Vec<ModuleMetadataV12>",
            extrinsic: "ExtrinsicMetadataV12"
        },
        ModuleConstantMetadataV12: "ModuleConstantMetadataV11",
        ModuleMetadataV12: {
            name: "Text",
            storage: "Option<StorageMetadataV12>",
            calls: "Option<Vec<FunctionMetadataV12>>",
            events: "Option<Vec<EventMetadataV12>>",
            constants: "Vec<ModuleConstantMetadataV12>",
            errors: "Vec<ErrorMetadataV12>",
            index: "u8"
        },
        StorageEntryModifierV12: "StorageEntryModifierV11",
        StorageEntryMetadataV12: "StorageEntryMetadataV11",
        StorageEntryTypeV12: "StorageEntryTypeV11",
        StorageMetadataV12: "StorageMetadataV11",
        StorageHasherV12: "StorageHasherV11"
    }, _He = {
        ErrorMetadataV13: "ErrorMetadataV12",
        EventMetadataV13: "EventMetadataV12",
        ExtrinsicMetadataV13: "ExtrinsicMetadataV12",
        FunctionArgumentMetadataV13: "FunctionArgumentMetadataV12",
        FunctionMetadataV13: "FunctionMetadataV12",
        MetadataV13: {
            modules: "Vec<ModuleMetadataV13>",
            extrinsic: "ExtrinsicMetadataV13"
        },
        ModuleConstantMetadataV13: "ModuleConstantMetadataV12",
        ModuleMetadataV13: {
            name: "Text",
            storage: "Option<StorageMetadataV13>",
            calls: "Option<Vec<FunctionMetadataV13>>",
            events: "Option<Vec<EventMetadataV13>>",
            constants: "Vec<ModuleConstantMetadataV13>",
            errors: "Vec<ErrorMetadataV13>",
            index: "u8"
        },
        StorageEntryModifierV13: "StorageEntryModifierV12",
        StorageEntryMetadataV13: {
            name: "Text",
            modifier: "StorageEntryModifierV13",
            type: "StorageEntryTypeV13",
            fallback: "Bytes",
            docs: "Vec<Text>"
        },
        StorageEntryTypeV13: {
            _enum: {
                Plain: "Type",
                Map: {
                    hasher: "StorageHasherV13",
                    key: "Type",
                    value: "Type",
                    linked: "bool"
                },
                DoubleMap: {
                    hasher: "StorageHasherV13",
                    key1: "Type",
                    key2: "Type",
                    value: "Type",
                    key2Hasher: "StorageHasherV13"
                },
                NMap: {
                    keyVec: "Vec<Type>",
                    hashers: "Vec<StorageHasherV13>",
                    value: "Type"
                }
            }
        },
        StorageMetadataV13: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV13>"
        },
        StorageHasherV13: "StorageHasherV12"
    }, K_ = {
        name: "Text",
        fields: "Vec<Si1Field>",
        index: "u8",
        docs: "Vec<Text>"
    }, xHe = {
        Si1Field: {
            name: "Option<Text>",
            type: "Si1LookupTypeId",
            typeName: "Option<Text>",
            docs: "Vec<Text>"
        },
        Si1LookupTypeId: "Compact<u32>",
        Si1Path: "Si0Path",
        Si1Type: {
            path: "Si1Path",
            params: "Vec<Si1TypeParameter>",
            def: "Si1TypeDef",
            docs: "Vec<Text>"
        },
        Si1TypeDef: {
            _enum: {
                Composite: "Si1TypeDefComposite",
                Variant: "Si1TypeDefVariant",
                Sequence: "Si1TypeDefSequence",
                Array: "Si1TypeDefArray",
                Tuple: "Si1TypeDefTuple",
                Primitive: "Si1TypeDefPrimitive",
                Compact: "Si1TypeDefCompact",
                BitSequence: "Si1TypeDefBitSequence",
                HistoricMetaCompat: "Type"
            }
        },
        Si1TypeDefArray: {
            len: "u32",
            type: "Si1LookupTypeId"
        },
        Si1TypeDefBitSequence: {
            bitStoreType: "Si1LookupTypeId",
            bitOrderType: "Si1LookupTypeId"
        },
        Si1TypeDefCompact: {
            type: "Si1LookupTypeId"
        },
        Si1TypeDefComposite: {
            fields: "Vec<Si1Field>"
        },
        Si1TypeDefPrimitive: "Si0TypeDefPrimitive",
        Si1TypeDefSequence: {
            type: "Si1LookupTypeId"
        },
        Si1TypeDefTuple: "Vec<Si1LookupTypeId>",
        Si1TypeParameter: {
            name: "Text",
            type: "Option<Si1LookupTypeId>"
        },
        Si1TypeDefVariant: {
            variants: "Vec<Si1Variant>"
        },
        Si1Variant: K_
    }, vHe = {
        PortableTypeV14: {
            id: "Si1LookupTypeId",
            type: "Si1Type"
        },
        ErrorMetadataV14: {
            ...K_,
            args: "Vec<Type>"
        },
        EventMetadataV14: {
            ...K_,
            args: "Vec<Type>"
        },
        FunctionArgumentMetadataV14: {
            name: "Text",
            type: "Type",
            typeName: "Option<Type>"
        },
        FunctionMetadataV14: {
            ...K_,
            args: "Vec<FunctionArgumentMetadataV14>"
        },
        ExtrinsicMetadataV14: {
            type: "SiLookupTypeId",
            version: "u8",
            signedExtensions: "Vec<SignedExtensionMetadataV14>"
        },
        MetadataV14: {
            lookup: "PortableRegistry",
            pallets: "Vec<PalletMetadataV14>",
            extrinsic: "ExtrinsicMetadataV14",
            type: "SiLookupTypeId"
        },
        PalletCallMetadataV14: {
            type: "SiLookupTypeId"
        },
        PalletConstantMetadataV14: {
            name: "Text",
            type: "SiLookupTypeId",
            value: "Bytes",
            docs: "Vec<Text>"
        },
        PalletErrorMetadataV14: {
            type: "SiLookupTypeId"
        },
        PalletEventMetadataV14: {
            type: "SiLookupTypeId"
        },
        PalletMetadataV14: {
            name: "Text",
            storage: "Option<PalletStorageMetadataV14>",
            calls: "Option<PalletCallMetadataV14>",
            events: "Option<PalletEventMetadataV14>",
            constants: "Vec<PalletConstantMetadataV14>",
            errors: "Option<PalletErrorMetadataV14>",
            index: "u8"
        },
        PalletStorageMetadataV14: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV14>"
        },
        SignedExtensionMetadataV14: {
            identifier: "Text",
            type: "SiLookupTypeId",
            additionalSigned: "SiLookupTypeId"
        },
        StorageEntryMetadataV14: {
            name: "Text",
            modifier: "StorageEntryModifierV14",
            type: "StorageEntryTypeV14",
            fallback: "Bytes",
            docs: "Vec<Text>"
        },
        StorageEntryModifierV14: "StorageEntryModifierV13",
        StorageEntryTypeV14: {
            _enum: {
                Plain: "SiLookupTypeId",
                Map: {
                    hashers: "Vec<StorageHasherV14>",
                    key: "SiLookupTypeId",
                    value: "SiLookupTypeId"
                }
            }
        },
        StorageHasherV14: "StorageHasherV13"
    }, SHe = {
        CustomMetadata15: {
            map: "BTreeMap<Text, CustomValueMetadata15>"
        },
        CustomValueMetadata15: {
            type: "SiLookupTypeId",
            value: "Bytes"
        },
        ExtrinsicMetadataV15: {
            version: "u8",
            addressType: "SiLookupTypeId",
            callType: "SiLookupTypeId",
            signatureType: "SiLookupTypeId",
            extraType: "SiLookupTypeId",
            signedExtensions: "Vec<SignedExtensionMetadataV14>"
        },
        OuterEnums15: {
            callType: "SiLookupTypeId",
            eventType: "SiLookupTypeId",
            errorType: "SiLookupTypeId"
        },
        PalletMetadataV15: {
            name: "Text",
            storage: "Option<PalletStorageMetadataV14>",
            calls: "Option<PalletCallMetadataV14>",
            events: "Option<PalletEventMetadataV14>",
            constants: "Vec<PalletConstantMetadataV14>",
            errors: "Option<PalletErrorMetadataV14>",
            index: "u8",
            docs: "Vec<Text>"
        },
        RuntimeApiMetadataV15: {
            name: "Text",
            methods: "Vec<RuntimeApiMethodMetadataV15>",
            docs: "Vec<Text>"
        },
        RuntimeApiMethodMetadataV15: {
            name: "Text",
            inputs: "Vec<RuntimeApiMethodParamMetadataV15>",
            output: "SiLookupTypeId",
            docs: "Vec<Text>"
        },
        RuntimeApiMethodParamMetadataV15: {
            name: "Text",
            type: "SiLookupTypeId"
        },
        MetadataV15: {
            lookup: "PortableRegistry",
            pallets: "Vec<PalletMetadataV15>",
            extrinsic: "ExtrinsicMetadataV15",
            type: "SiLookupTypeId",
            apis: "Vec<RuntimeApiMetadataV15>",
            outerEnums: "OuterEnums15",
            custom: "CustomMetadata15"
        }
    }, kHe = {
        MetadataV16: {
            lookup: "PortableRegistry",
            pallets: "Vec<PalletMetadataV16>",
            extrinsic: "ExtrinsicMetadataV16",
            apis: "Vec<RuntimeApiMetadataV16>",
            outerEnums: "OuterEnums15",
            custom: "CustomMetadata15"
        },
        PalletMetadataV16: {
            name: "Text",
            storage: "Option<PalletStorageMetadataV16>",
            calls: "Option<PalletCallMetadataV16>",
            events: "Option<PalletEventMetadataV16>",
            constants: "Vec<PalletConstantMetadataV16>",
            errors: "Option<PalletErrorMetadataV16>",
            associatedTypes: "Vec<PalletAssociatedTypeMetadataV16>",
            viewFunctions: "Vec<PalletViewFunctionMetadataV16>",
            index: "u8",
            docs: "Vec<Text>",
            deprecationInfo: "ItemDeprecationInfoV16"
        },
        PalletStorageMetadataV16: {
            prefix: "Text",
            items: "Vec<StorageEntryMetadataV16>"
        },
        StorageEntryMetadataV16: {
            name: "Text",
            modifier: "StorageEntryModifierV14",
            type: "StorageEntryTypeV14",
            fallback: "Bytes",
            docs: "Vec<Text>",
            deprecationInfo: "ItemDeprecationInfoV16"
        },
        ItemDeprecationInfoV16: {
            _enum: {
                NotDeprecated: "Null",
                DeprecatedWithoutNote: "Null",
                Deprecated: {
                    note: "Text",
                    since: "Option<Text>"
                }
            }
        },
        PalletCallMetadataV16: {
            type: "SiLookupTypeId",
            deprecationInfo: "EnumDeprecationInfoV16"
        },
        EnumDeprecationInfoV16: "BTreeMap<u8, VariantDeprecationInfoV16>",
        VariantDeprecationInfoV16: {
            _enum: {
                DummyVariant: "Null",
                DeprecatedWithoutNote: "Null",
                Deprecated: {
                    note: "Text",
                    since: "Option<Text>"
                }
            }
        },
        PalletEventMetadataV16: {
            type: "SiLookupTypeId",
            deprecationInfo: "EnumDeprecationInfoV16"
        },
        PalletConstantMetadataV16: {
            name: "Text",
            type: "SiLookupTypeId",
            value: "Bytes",
            docs: "Vec<Text>",
            deprecationInfo: "ItemDeprecationInfoV16"
        },
        PalletErrorMetadataV16: {
            type: "SiLookupTypeId",
            deprecationInfo: "EnumDeprecationInfoV16"
        },
        PalletAssociatedTypeMetadataV16: {
            name: "Text",
            type: "SiLookupTypeId",
            docs: "Vec<Text>"
        },
        PalletViewFunctionMetadataV16: {
            id: "[u8; 32]",
            name: "Text",
            inputs: "Vec<RuntimeApiMethodParamMetadataV15>",
            output: "SiLookupTypeId",
            docs: "Vec<T::String>",
            deprecationInfo: "ItemDeprecationInfoV16"
        },
        ExtrinsicMetadataV16: {
            versions: "Vec<u8>",
            addressType: "SiLookupTypeId",
            callType: "SiLookupTypeId",
            signatureType: "SiLookupTypeId",
            transactionExtensionsByVersion: "BTreeMap<u8, Vec<Compact<u32>>>",
            transactionExtensions: "Vec<TransactionExtensionMetadataV16>"
        },
        TransactionExtensionMetadataV16: {
            identifier: "Text",
            type: "SiLookupTypeId",
            implicit: "SiLookupTypeId"
        },
        RuntimeApiMetadataV16: {
            name: "Text",
            methods: "Vec<RuntimeApiMethodMetadataV16>",
            docs: "Vec<Text>",
            version: "Compact<u32>",
            deprecationInfo: "ItemDeprecationInfoV16"
        },
        RuntimeApiMethodMetadataV16: {
            name: "Text",
            inputs: "Vec<RuntimeApiMethodParamMetadataV15>",
            output: "SiLookupTypeId",
            docs: "Vec<Text>",
            deprecationInfo: "ItemDeprecationInfoV16"
        }
    }, THe = {
        rpc: {},
        runtime: gHe,
        types: {
            ...bHe,
            ...mHe,
            ...yHe,
            ...wHe,
            ..._He,
            ...vHe,
            ...SHe,
            ...kHe,
            ErrorMetadataLatest: "ErrorMetadataV14",
            EventMetadataLatest: "EventMetadataV14",
            ExtrinsicMetadataLatest: "ExtrinsicMetadataV16",
            FunctionArgumentMetadataLatest: "FunctionArgumentMetadataV14",
            FunctionMetadataLatest: "FunctionMetadataV14",
            MetadataLatest: "MetadataV16",
            PalletCallMetadataLatest: "PalletCallMetadataV16",
            PalletConstantMetadataLatest: "PalletConstantMetadataV16",
            PalletErrorMetadataLatest: "PalletErrorMetadataV16",
            PalletEventMetadataLatest: "PalletEventMetadataV16",
            PalletMetadataLatest: "PalletMetadataV16",
            PalletStorageMetadataLatest: "PalletStorageMetadataV16",
            PortableType: "PortableTypeV14",
            RuntimeApiMetadataLatest: "RuntimeApiMetadataV16",
            SignedExtensionMetadataLatest: "SignedExtensionMetadataV14",
            TransactionExtensionMetadataLatest: "TransactionExtensionMetadataV16",
            StorageEntryMetadataLatest: "StorageEntryMetadataV16",
            StorageEntryModifierLatest: "StorageEntryModifierV14",
            StorageEntryTypeLatest: "StorageEntryTypeV14",
            StorageHasher: "StorageHasherV14",
            OpaqueMetadata: "Opaque<Bytes>",
            MetadataAll: {
                _enum: {
                    V0: "DoNotConstruct<MetadataV0>",
                    V1: "DoNotConstruct<MetadataV1>",
                    V2: "DoNotConstruct<MetadataV2>",
                    V3: "DoNotConstruct<MetadataV3>",
                    V4: "DoNotConstruct<MetadataV4>",
                    V5: "DoNotConstruct<MetadataV5>",
                    V6: "DoNotConstruct<MetadataV6>",
                    V7: "DoNotConstruct<MetadataV7>",
                    V8: "DoNotConstruct<MetadataV8>",
                    V9: "MetadataV9",
                    V10: "MetadataV10",
                    V11: "MetadataV11",
                    V12: "MetadataV12",
                    V13: "MetadataV13",
                    V14: "MetadataV14",
                    V15: "MetadataV15",
                    V16: "MetadataV16"
                }
            }
        }
    }, lm = {
        execute_block: {
            description: "Execute the given block.",
            params: [
                {
                    name: "block",
                    type: "Block"
                }
            ],
            type: "Null"
        }
    }, uD = {
        version: {
            description: "Returns the version of the runtime.",
            params: [],
            type: "RuntimeVersionPre3"
        }
    }, _S = {
        initialize_block: {
            description: "Initialize a block with the given header.",
            params: [
                {
                    name: "header",
                    type: "Header"
                }
            ],
            type: "Null"
        }
    }, dD = {
        version: {
            description: "Returns the version of the runtime.",
            params: [],
            type: "RuntimeVersion"
        }
    }, CHe = {
        ...lm,
        initialize_block: {
            description: "Initialize a block with the given header.",
            params: [
                {
                    name: "header",
                    type: "Header"
                }
            ],
            type: "ExtrinsicInclusionMode"
        }
    }, EHe = {
        Core: [
            {
                methods: {
                    ...dD,
                    ...CHe
                },
                version: 5
            },
            {
                methods: {
                    ...dD,
                    ...lm,
                    ..._S
                },
                version: 4
            },
            {
                methods: {
                    version: {
                        description: "Returns the version of the runtime.",
                        params: [],
                        type: "RuntimeVersionPre4"
                    },
                    ...lm,
                    ..._S
                },
                version: 3
            },
            {
                methods: {
                    ...uD,
                    ...lm,
                    ..._S
                },
                version: 2
            },
            {
                methods: {
                    initialise_block: {
                        description: "Initialize a block with the given header.",
                        params: [
                            {
                                name: "header",
                                type: "Header"
                            }
                        ],
                        type: "Null"
                    },
                    ...uD,
                    ...lm
                },
                version: 1
            }
        ]
    }, IHe = {
        Fixed64: "Int<64, Fixed64>",
        FixedI64: "Int<64, FixedI64>",
        FixedU64: "UInt<64, FixedU64>",
        Fixed128: "Int<128, Fixed128>",
        FixedI128: "Int<128, FixedI128>",
        FixedU128: "UInt<128, FixedU128>",
        I32F32: "Int<64, I32F32>",
        U32F32: "UInt<64, U32F32>",
        PerU16: "UInt<16, PerU16>",
        Perbill: "UInt<32, Perbill>",
        Percent: "UInt<8, Percent>",
        Permill: "UInt<32, Permill>",
        Perquintill: "UInt<64, Perquintill>"
    }, AHe = {
        Council: "CollectiveOrigin",
        System: "SystemOrigin",
        TechnicalCommittee: "CollectiveOrigin",
        Xcm: "XcmOrigin",
        XcmPallet: "XcmOrigin",
        Authority: "AuthorityOrigin",
        GeneralCouncil: "CollectiveOrigin"
    }, PHe = {
        rpc: {},
        runtime: EHe,
        types: {
            ...IHe,
            AccountId: "AccountId32",
            AccountId20: "GenericEthereumAccountId",
            AccountId32: "GenericAccountId32",
            AccountId33: "GenericAccountId33",
            AccountIdOf: "AccountId",
            AccountIndex: "GenericAccountIndex",
            Address: "MultiAddress",
            AssetId: "u32",
            Balance: "UInt<128, Balance>",
            BalanceOf: "Balance",
            Block: "GenericBlock",
            BlockNumber: "u32",
            BlockNumberFor: "BlockNumber",
            BlockNumberOf: "BlockNumber",
            Call: "GenericCall",
            CallHash: "Hash",
            CallHashOf: "CallHash",
            ChangesTrieConfiguration: {
                digestInterval: "u32",
                digestLevels: "u32"
            },
            ChangesTrieSignal: {
                _enum: {
                    NewConfiguration: "Option<ChangesTrieConfiguration>"
                }
            },
            ConsensusEngineId: "GenericConsensusEngineId",
            CodecHash: "Hash",
            CrateVersion: {
                major: "u16",
                minor: "u8",
                patch: "u8"
            },
            Digest: {
                logs: "Vec<DigestItem>"
            },
            DigestItem: {
                _enum: {
                    Other: "Bytes",
                    AuthoritiesChange: "Vec<AuthorityId>",
                    ChangesTrieRoot: "Hash",
                    SealV0: "SealV0",
                    Consensus: "Consensus",
                    Seal: "Seal",
                    PreRuntime: "PreRuntime",
                    ChangesTrieSignal: "ChangesTrieSignal",
                    RuntimeEnvironmentUpdated: "Null"
                }
            },
            ExtrinsicsWeight: {
                normal: "Weight",
                operational: "Weight"
            },
            H32: "[u8; 4; H32]",
            H64: "[u8; 8; H64]",
            H128: "[u8; 16; H128]",
            H160: "[u8; 20; H160]",
            H256: "[u8; 32; H256]",
            H512: "[u8; 64; H512]",
            H1024: "[u8; 128; H1024]",
            H2048: "[u8; 256; H2048]",
            Hash: "H256",
            Header: {
                parentHash: "Hash",
                number: "Compact<BlockNumber>",
                stateRoot: "Hash",
                extrinsicsRoot: "Hash",
                digest: "Digest"
            },
            HeaderPartial: {
                parentHash: "Hash",
                number: "BlockNumber"
            },
            IndicesLookupSource: "GenericLookupSource",
            Index: "u32",
            Justification: "(ConsensusEngineId, EncodedJustification)",
            EncodedJustification: "Bytes",
            Justifications: "Vec<Justification>",
            KeyValue: "(StorageKey, StorageData)",
            KeyTypeId: "u32",
            LockIdentifier: "[u8; 8]",
            LookupSource: "MultiAddress",
            LookupTarget: "AccountId",
            ModuleId: "LockIdentifier",
            MultiAddress: "GenericMultiAddress",
            MultiSigner: {
                _enum: {
                    Ed25519: "[u8; 32]",
                    Sr25519: "[u8; 32]",
                    Ecdsa: "[u8; 33]"
                }
            },
            Moment: "UInt<64, Moment>",
            OpaqueCall: "Bytes",
            Origin: "DoNotConstruct<Origin>",
            OriginCaller: {
                _enum: {
                    System: "SystemOrigin"
                }
            },
            PalletId: "LockIdentifier",
            PalletsOrigin: "OriginCaller",
            PalletVersion: {
                major: "u16",
                minor: "u8",
                patch: "u8"
            },
            Pays: {
                _enum: [
                    "Yes",
                    "No"
                ]
            },
            Phantom: "Null",
            PhantomData: "Null",
            Releases: {
                _enum: [
                    "V1",
                    "V2",
                    "V3",
                    "V4",
                    "V5",
                    "V6",
                    "V7",
                    "V8",
                    "V9",
                    "V10"
                ]
            },
            RuntimeCall: "Call",
            RuntimeEvent: "Event",
            RuntimeDbWeight: {
                read: "Weight",
                write: "Weight"
            },
            SignedBlock: "SignedBlockWithJustifications",
            SignedBlockWithJustification: {
                block: "Block",
                justification: "Option<EncodedJustification>"
            },
            SignedBlockWithJustifications: {
                block: "Block",
                justifications: "Option<Justifications>"
            },
            Slot: "u64",
            SlotDuration: "u64",
            StorageData: "Bytes",
            StorageInfo: {
                palletName: "Bytes",
                storage_name: "Bytes",
                prefix: "Bytes",
                maxValues: "Option<u32>",
                maxSize: "Option<u32>"
            },
            StorageProof: {
                trieNodes: "Vec<Bytes>"
            },
            TransactionPriority: "u64",
            TransactionLongevity: "u64",
            TransactionTag: "Bytes",
            TransactionInfo: {
                _alias: {
                    dataSize: "size"
                },
                chunkRoot: "H256",
                contentHash: "H256",
                dataSize: "u32",
                blockChunks: "u32"
            },
            TransactionStorageProof: {
                chunk: "Vec<u8>",
                proof: "Vec<Vec<u8>>"
            },
            ValidatorId: "AccountId",
            ValidatorIdOf: "ValidatorId",
            WeightV0: "u32",
            WeightV1: "u64",
            WeightV2: {
                refTime: "Compact<u64>",
                proofSize: "Compact<u64>"
            },
            Weight: "WeightV2",
            WeightMultiplier: "Fixed64",
            PreRuntime: "(ConsensusEngineId, Bytes)",
            SealV0: "(u64, Signature)",
            Seal: "(ConsensusEngineId, Bytes)",
            Consensus: "(ConsensusEngineId, Bytes)",
            ExtrinsicInclusionMode: {
                _enum: [
                    "AllExtrinsics",
                    "OnlyInherents"
                ]
            }
        }
    }, OHe = {
        Si0Field: {
            name: "Option<Text>",
            type: "Si0LookupTypeId",
            typeName: "Option<Text>",
            docs: "Vec<Text>"
        },
        Si0LookupTypeId: "u32",
        Si0Path: "Vec<Text>",
        Si0Type: {
            path: "Si0Path",
            params: "Vec<Si0LookupTypeId>",
            def: "Si0TypeDef"
        },
        Si0TypeDef: {
            _enum: {
                Composite: "Si0TypeDefComposite",
                Variant: "Si0TypeDefVariant",
                Sequence: "Si0TypeDefSequence",
                Array: "Si0TypeDefArray",
                Tuple: "Si0TypeDefTuple",
                Primitive: "Si0TypeDefPrimitive",
                Compact: "Si0TypeDefCompact",
                Phantom: "Si0TypeDefPhantom",
                BitSequence: "Si0TypeDefBitSequence"
            }
        },
        Si0TypeDefArray: {
            len: "u32",
            type: "Si0LookupTypeId"
        },
        Si0TypeDefBitSequence: {
            bitStoreType: "Si0LookupTypeId",
            bitOrderType: "Si0LookupTypeId"
        },
        Si0TypeDefCompact: {
            type: "Si0LookupTypeId"
        },
        Si0TypeDefComposite: {
            fields: "Vec<Si0Field>"
        },
        Si0TypeDefPhantom: "Null",
        Si0TypeDefVariant: {
            variants: "Vec<Si0Variant>"
        },
        Si0TypeDefPrimitive: {
            _enum: [
                "Bool",
                "Char",
                "Str",
                "U8",
                "U16",
                "U32",
                "U64",
                "U128",
                "U256",
                "I8",
                "I16",
                "I32",
                "I64",
                "I128",
                "I256"
            ]
        },
        Si0TypeDefSequence: {
            type: "Si0LookupTypeId"
        },
        Si0TypeDefTuple: "Vec<Si0LookupTypeId>",
        Si0TypeParameter: {
            name: "Text",
            type: "Option<Si0LookupTypeId>"
        },
        Si0Variant: {
            name: "Text",
            fields: "Vec<Si0Field>",
            index: "Option<u8>",
            discriminant: "Option<u64>",
            docs: "Vec<Text>"
        }
    }, MHe = {
        rpc: {},
        types: {
            ...OHe,
            ...xHe,
            SiField: "Si1Field",
            SiLookupTypeId: "Si1LookupTypeId",
            SiPath: "Si1Path",
            SiType: "Si1Type",
            SiTypeDef: "Si1TypeDef",
            SiTypeDefArray: "Si1TypeDefArray",
            SiTypeDefBitSequence: "Si1TypeDefBitSequence",
            SiTypeDefCompact: "Si1TypeDefCompact",
            SiTypeDefComposite: "Si1TypeDefComposite",
            SiTypeDefPrimitive: "Si1TypeDefPrimitive",
            SiTypeDefSequence: "Si1TypeDefSequence",
            SiTypeDefTuple: "Si1TypeDefTuple",
            SiTypeParameter: "Si1TypeParameter",
            SiTypeDefVariant: "Si1TypeDefVariant",
            SiVariant: "Si1Variant"
        }
    }, RHe = {
        AssetConversionApi: [
            {
                methods: {
                    get_reserves: {
                        description: "Get pool reserves",
                        params: [
                            {
                                name: "asset1",
                                type: "StagingXcmV3MultiLocation"
                            },
                            {
                                name: "asset2",
                                type: "StagingXcmV3MultiLocation"
                            }
                        ],
                        type: "Option<(Balance,Balance)>"
                    },
                    quote_price_exact_tokens_for_tokens: {
                        description: "Quote price: exact tokens for tokens",
                        params: [
                            {
                                name: "asset1",
                                type: "StagingXcmV3MultiLocation"
                            },
                            {
                                name: "asset2",
                                type: "StagingXcmV3MultiLocation"
                            },
                            {
                                name: "amount",
                                type: "u128"
                            },
                            {
                                name: "include_fee",
                                type: "bool"
                            }
                        ],
                        type: "Option<(Balance)>"
                    },
                    quote_price_tokens_for_exact_tokens: {
                        description: "Quote price: tokens for exact tokens",
                        params: [
                            {
                                name: "asset1",
                                type: "StagingXcmV3MultiLocation"
                            },
                            {
                                name: "asset2",
                                type: "StagingXcmV3MultiLocation"
                            },
                            {
                                name: "amount",
                                type: "u128"
                            },
                            {
                                name: "include_fee",
                                type: "bool"
                            }
                        ],
                        type: "Option<(Balance)>"
                    }
                },
                version: 1
            }
        ]
    }, NHe = {
        rpc: {},
        runtime: RHe,
        types: {
            TAssetConversion: "Option<MultiLocation>"
        }
    }, VHe = {
        AssetsApi: [
            {
                methods: {
                    account_balances: {
                        description: "Return the current set of authorities.",
                        params: [
                            {
                                name: "account",
                                type: "AccountId"
                            }
                        ],
                        type: "Vec<(u32, TAssetBalance)>"
                    }
                },
                version: 1
            }
        ]
    }, DHe = {
        rpc: {},
        runtime: VHe,
        types: {
            AssetApprovalKey: {
                owner: "AccountId",
                delegate: "AccountId"
            },
            AssetApproval: {
                amount: "TAssetBalance",
                deposit: "TAssetDepositBalance"
            },
            AssetBalance: {
                balance: "TAssetBalance",
                isFrozen: "bool",
                isSufficient: "bool"
            },
            AssetDestroyWitness: {
                accounts: "Compact<u32>",
                sufficients: "Compact<u32>",
                approvals: "Compact<u32>"
            },
            AssetDetails: {
                owner: "AccountId",
                issuer: "AccountId",
                admin: "AccountId",
                freezer: "AccountId",
                supply: "TAssetBalance",
                deposit: "TAssetDepositBalance",
                minBalance: "TAssetBalance",
                isSufficient: "bool",
                accounts: "u32",
                sufficients: "u32",
                approvals: "u32",
                isFrozen: "bool"
            },
            AssetMetadata: {
                deposit: "TAssetDepositBalance",
                name: "Vec<u8>",
                symbol: "Vec<u8>",
                decimals: "u8",
                isFrozen: "bool"
            },
            TAssetBalance: "u64",
            TAssetDepositBalance: "BalanceOf"
        }
    }, BHe = {
        AuraApi: [
            {
                methods: {
                    authorities: {
                        description: "Return the current set of authorities.",
                        params: [],
                        type: "Vec<AuthorityId>"
                    },
                    slot_duration: {
                        description: "Returns the slot duration for Aura.",
                        params: [],
                        type: "SlotDuration"
                    }
                },
                version: 1
            }
        ]
    }, FHe = {
        rpc: {},
        runtime: BHe,
        types: {
            RawAuraPreDigest: {
                slotNumber: "u64"
            }
        }
    }, LHe = {
        rpc: {},
        types: {
            UncleEntryItem: {
                _enum: {
                    InclusionHeight: "BlockNumber",
                    Uncle: "(Hash, Option<AccountId>)"
                }
            }
        }
    }, zHe = {
        epochAuthorship: {
            description: "Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore",
            isUnsafe: !0,
            params: [],
            type: "HashMap<AuthorityId, EpochAuthorship>"
        }
    }, fD = {
        current_epoch: {
            description: "Returns information regarding the current epoch.",
            params: [],
            type: "Epoch"
        },
        current_epoch_start: {
            description: "Returns the slot that started the current epoch.",
            params: [],
            type: "Slot"
        },
        generate_key_ownership_proof: {
            description: "Generates a proof of key ownership for the given authority in the current epoch.",
            params: [
                {
                    name: "slot",
                    type: "Slot"
                },
                {
                    name: "authorityId",
                    type: "AuthorityId"
                }
            ],
            type: "Option<OpaqueKeyOwnershipProof>"
        },
        next_epoch: {
            description: "Returns information regarding the next epoch (which was already previously announced).",
            params: [],
            type: "Epoch"
        },
        submit_report_equivocation_unsigned_extrinsic: {
            description: "Submits an unsigned extrinsic to report an equivocation.",
            params: [
                {
                    name: "equivocationProof",
                    type: "BabeEquivocationProof"
                },
                {
                    name: "keyOwnerProof",
                    type: "OpaqueKeyOwnershipProof"
                }
            ],
            type: "Option<Null>"
        }
    }, UHe = {
        BabeApi: [
            {
                methods: {
                    configuration: {
                        description: "Return the genesis configuration for BABE. The configuration is only read on genesis.",
                        params: [],
                        type: "BabeGenesisConfiguration"
                    },
                    ...fD
                },
                version: 2
            },
            {
                methods: {
                    configuration: {
                        description: "Return the configuration for BABE. Version 1.",
                        params: [],
                        type: "BabeGenesisConfigurationV1"
                    },
                    ...fD
                },
                version: 1
            }
        ]
    }, HHe = {
        rpc: zHe,
        runtime: UHe,
        types: {
            AllowedSlots: {
                _enum: [
                    "PrimarySlots",
                    "PrimaryAndSecondaryPlainSlots",
                    "PrimaryAndSecondaryVRFSlots"
                ]
            },
            BabeAuthorityWeight: "u64",
            BabeEpochConfiguration: {
                c: "(u64, u64)",
                allowedSlots: "AllowedSlots"
            },
            BabeBlockWeight: "u32",
            BabeEquivocationProof: {
                offender: "AuthorityId",
                slotNumber: "SlotNumber",
                firstHeader: "Header",
                secondHeader: "Header"
            },
            BabeGenesisConfiguration: {
                slotDuration: "u64",
                epochLength: "u64",
                c: "(u64, u64)",
                genesisAuthorities: "Vec<(AuthorityId, BabeAuthorityWeight)>",
                randomness: "Randomness",
                allowedSlots: "AllowedSlots"
            },
            BabeGenesisConfigurationV1: {
                slotDuration: "u64",
                epochLength: "u64",
                c: "(u64, u64)",
                genesisAuthorities: "Vec<(AuthorityId, BabeAuthorityWeight)>",
                randomness: "Randomness",
                secondarySlots: "bool"
            },
            BabeWeight: "u64",
            MaybeRandomness: "Option<Randomness>",
            MaybeVrf: "Option<VrfData>",
            Epoch: {
                epochIndex: "u64",
                startSlot: "Slot",
                duration: "u64",
                authorities: "Vec<(AuthorityId, BabeAuthorityWeight)>",
                randomness: "Hash",
                config: "BabeEpochConfiguration"
            },
            EpochAuthorship: {
                primary: "Vec<u64>",
                secondary: "Vec<u64>",
                secondary_vrf: "Vec<u64>"
            },
            NextConfigDescriptor: {
                _enum: {
                    V0: "Null",
                    V1: "NextConfigDescriptorV1"
                }
            },
            NextConfigDescriptorV1: {
                c: "(u64, u64)",
                allowedSlots: "AllowedSlots"
            },
            OpaqueKeyOwnershipProof: "Bytes",
            Randomness: "Hash",
            RawBabePreDigest: {
                _enum: {
                    Phantom: "Null",
                    Primary: "RawBabePreDigestPrimary",
                    SecondaryPlain: "RawBabePreDigestSecondaryPlain",
                    SecondaryVRF: "RawBabePreDigestSecondaryVRF"
                }
            },
            RawBabePreDigestPrimary: {
                authorityIndex: "u32",
                slotNumber: "SlotNumber",
                vrfOutput: "VrfOutput",
                vrfProof: "VrfProof"
            },
            RawBabePreDigestSecondaryPlain: {
                authorityIndex: "u32",
                slotNumber: "SlotNumber"
            },
            RawBabePreDigestSecondaryVRF: {
                authorityIndex: "u32",
                slotNumber: "SlotNumber",
                vrfOutput: "VrfOutput",
                vrfProof: "VrfProof"
            },
            RawBabePreDigestTo159: {
                _enum: {
                    Primary: "RawBabePreDigestPrimaryTo159",
                    Secondary: "RawBabePreDigestSecondaryTo159"
                }
            },
            RawBabePreDigestPrimaryTo159: {
                authorityIndex: "u32",
                slotNumber: "SlotNumber",
                weight: "BabeBlockWeight",
                vrfOutput: "VrfOutput",
                vrfProof: "VrfProof"
            },
            RawBabePreDigestSecondaryTo159: {
                authorityIndex: "u32",
                slotNumber: "SlotNumber",
                weight: "BabeBlockWeight"
            },
            RawBabePreDigestCompat: {
                _enum: {
                    Zero: "u32",
                    One: "u32",
                    Two: "u32",
                    Three: "u32"
                }
            },
            SlotNumber: "u64",
            VrfData: "[u8; 32]",
            VrfOutput: "[u8; 32]",
            VrfProof: "[u8; 64]"
        }
    }, jHe = {
        rpc: {},
        types: {
            AccountData: {
                free: "Balance",
                reserved: "Balance",
                miscFrozen: "Balance",
                feeFrozen: "Balance"
            },
            BalanceLockTo212: {
                id: "LockIdentifier",
                amount: "Balance",
                until: "BlockNumber",
                reasons: "WithdrawReasons"
            },
            BalanceLock: {
                id: "LockIdentifier",
                amount: "Balance",
                reasons: "Reasons"
            },
            BalanceStatus: {
                _enum: [
                    "Free",
                    "Reserved"
                ]
            },
            Reasons: {
                _enum: [
                    "Fee",
                    "Misc",
                    "All"
                ]
            },
            ReserveData: {
                id: "ReserveIdentifier",
                amount: "Balance"
            },
            ReserveIdentifier: "[u8; 8]",
            VestingSchedule: {
                offset: "Balance",
                perBlock: "Balance",
                startingBlock: "BlockNumber"
            },
            WithdrawReasons: {
                _set: {
                    TransactionPayment: 1,
                    Transfer: 2,
                    Reserve: 4,
                    Fee: 8,
                    Tip: 16
                }
            }
        }
    }, qHe = {
        getFinalizedHead: {
            description: "Returns hash of the latest BEEFY finalized block as seen by this client.",
            params: [],
            type: "H256"
        },
        subscribeJustifications: {
            description: "Returns the block most recently finalized by BEEFY, alongside its justification.",
            params: [],
            pubsub: [
                "justifications",
                "subscribeJustifications",
                "unsubscribeJustifications"
            ],
            type: "BeefyVersionedFinalityProof"
        }
    }, DJ = {
        beefy_genesis: {
            description: "Return the block number where BEEFY consensus is enabled/started",
            params: [],
            type: "Option<BlockNumber>"
        },
        generate_key_ownership_proof: {
            description: "Generates a proof of key ownership for the given authority in the given set.",
            params: [
                {
                    name: "setId",
                    type: "ValidatorSetId"
                },
                {
                    name: "authorityId",
                    type: "AuthorityId"
                }
            ],
            type: "Option<OpaqueKeyOwnershipProof>"
        },
        validator_set: {
            description: "Return the current active BEEFY validator set",
            params: [],
            type: "Option<ValidatorSet>"
        }
    }, xS = {
        ...DJ,
        submit_report_equivocation_unsigned_extrinsic: {
            description: "Submits an unsigned extrinsic to report an equivocation.",
            params: [
                {
                    name: "equivocationProof",
                    type: "BeefyEquivocationProof"
                },
                {
                    name: "keyOwnerProof",
                    type: "OpaqueKeyOwnershipProof"
                }
            ],
            type: "Option<Null>"
        }
    }, WHe = {
        ...DJ,
        submit_report_double_voting_unsigned_extrinsic: {
            description: "Submits an unsigned extrinsic to report a double voting equivocation.",
            params: [
                {
                    name: "equivocationProof",
                    type: "SpConsensusBeefyDoubleVotingProof"
                },
                {
                    name: "keyOwnerProof",
                    type: "OpaqueKeyOwnershipProof"
                }
            ],
            type: "Option<Null>"
        }
    }, KHe = {
        authority_set_proof: {
            description: "Return the currently active BEEFY authority set proof.",
            params: [],
            type: "BeefyAuthoritySet"
        },
        next_authority_set_proof: {
            description: "Return the next/queued BEEFY authority set proof.",
            params: [],
            type: "BeefyNextAuthoritySet"
        }
    }, $He = {
        BeefyApi: [
            {
                methods: WHe,
                version: 4
            },
            {
                methods: xS,
                version: 3
            },
            {
                methods: xS,
                version: 2
            },
            {
                methods: xS,
                version: 1
            }
        ],
        BeefyMmrApi: [
            {
                methods: KHe,
                version: 1
            }
        ]
    }, XHe = {
        rpc: qHe,
        runtime: $He,
        types: {
            BeefyAuthoritySet: {
                id: "u64",
                len: "u32",
                root: "H256"
            },
            BeefyCommitment: {
                payload: "BeefyPayload",
                blockNumber: "BlockNumber",
                validatorSetId: "ValidatorSetId"
            },
            BeefyId: "[u8; 33]",
            BeefyEquivocationProof: {
                first: "BeefyVoteMessage",
                second: "BeefyVoteMessage"
            },
            BeefyCompactSignedCommitment: {
                commitment: "BeefyCommitment",
                signaturesFrom: "Vec<u8>",
                validatorSetLen: "u32",
                signaturesCompact: "Vec<EcdsaSignature>"
            },
            BeefySignedCommitment: {
                commitment: "BeefyCommitment",
                signatures: "Vec<Option<EcdsaSignature>>"
            },
            BeefyVersionedFinalityProof: {
                _enum: {
                    V0: "Null",
                    V1: "BeefyCompactSignedCommitment"
                }
            },
            BeefyNextAuthoritySet: {
                id: "u64",
                len: "u32",
                root: "H256"
            },
            BeefyPayload: "Vec<(BeefyPayloadId, Bytes)>",
            BeefyPayloadId: "[u8;2]",
            BeefyVoteMessage: {
                commitment: "BeefyCommitment",
                id: "AuthorityId",
                signature: "Signature"
            },
            MmrRootHash: "H256",
            ValidatorSetId: "u64",
            ValidatorSet: {
                validators: "Vec<AuthorityId>",
                id: "ValidatorSetId"
            }
        }
    }, GHe = {
        Benchmark: [
            {
                methods: {
                    benchmark_metadata: {
                        description: "Get the benchmark metadata available for this runtime.",
                        params: [
                            {
                                name: "extra",
                                type: "bool"
                            }
                        ],
                        type: "(Vec<BenchmarkList>, Vec<StorageInfo>)"
                    },
                    dispatch_benchmark: {
                        description: "Dispatch the given benchmark.",
                        params: [
                            {
                                name: "config",
                                type: "BenchmarkConfig"
                            }
                        ],
                        type: "Result<Vec<BenchmarkBatch>, Text>"
                    }
                },
                version: 1
            }
        ]
    }, ZHe = {
        rpc: {},
        runtime: GHe,
        types: {
            BenchmarkBatch: {
                pallet: "Text",
                instance: "Text",
                benchmark: "Text",
                results: "Vec<BenchmarkResult>"
            },
            BenchmarkConfig: {
                pallet: "Bytes",
                benchmark: "Bytes",
                selectedComponents: "Vec<(BenchmarkParameter, u32)>",
                verify: "bool",
                internalRepeats: "u32"
            },
            BenchmarkList: {
                pallet: "Bytes",
                instance: "Bytes",
                benchmarks: "Vec<BenchmarkMetadata>"
            },
            BenchmarkMetadata: {
                name: "Bytes",
                components: "Vec<(BenchmarkParameter, u32, u32)>"
            },
            BenchmarkParameter: {
                _enum: [
                    "a",
                    "b",
                    "c",
                    "d",
                    "e",
                    "f",
                    "g",
                    "h",
                    "i",
                    "j",
                    "k",
                    "l",
                    "m",
                    "n",
                    "o",
                    "p",
                    "q",
                    "r",
                    "s",
                    "t",
                    "u",
                    "v",
                    "w",
                    "x",
                    "y",
                    "z"
                ]
            },
            BenchmarkResult: {
                components: "Vec<(BenchmarkParameter, u32)>",
                extrinsicTime: "u128",
                storageRootTime: "u128",
                reads: "u32",
                repeatReads: "u32",
                writes: "u32",
                repeatWrites: "u32",
                proofSize: "u32",
                benchKeys: "Vec<(Vec<u8>, u32, u32, bool)>"
            }
        }
    }, vS = {
        random_seed: {
            description: "Generate a random seed.",
            params: [],
            type: "Hash"
        }
    }, pD = {
        apply_extrinsic: {
            description: "Apply the given extrinsic.",
            params: [
                {
                    name: "extrinsic",
                    type: "Extrinsic"
                }
            ],
            type: "ApplyExtrinsicResultPre6"
        }
    }, Nb = {
        check_inherents: {
            description: "Check that the inherents are valid.",
            params: [
                {
                    name: "block",
                    type: "Block"
                },
                {
                    name: "data",
                    type: "InherentData"
                }
            ],
            type: "CheckInherentsResult"
        },
        inherent_extrinsics: {
            description: "Generate inherent extrinsics.",
            params: [
                {
                    name: "inherent",
                    type: "InherentData"
                }
            ],
            type: "Vec<Extrinsic>"
        }
    }, $w = {
        finalize_block: {
            description: "Finish the current block.",
            params: [],
            type: "Header"
        }
    }, JHe = {
        BlockBuilder: [
            {
                methods: {
                    apply_extrinsic: {
                        description: "Apply the given extrinsic.",
                        params: [
                            {
                                name: "extrinsic",
                                type: "Extrinsic"
                            }
                        ],
                        type: "ApplyExtrinsicResult"
                    },
                    ...Nb,
                    ...$w
                },
                version: 6
            },
            {
                methods: {
                    ...pD,
                    ...Nb,
                    ...$w
                },
                version: 5
            },
            {
                methods: {
                    ...vS,
                    ...pD,
                    ...Nb,
                    ...$w
                },
                version: 4
            },
            {
                methods: {
                    ...vS,
                    ...Nb,
                    ...$w
                },
                version: 3
            },
            {
                methods: {
                    finalise_block: {
                        description: "Finish the current block.",
                        params: [],
                        type: "Header"
                    },
                    ...vS,
                    ...Nb
                },
                version: 2
            }
        ]
    }, YHe = {
        rpc: {},
        runtime: JHe,
        types: {
            CheckInherentsResult: {
                okay: "bool",
                fatalError: "bool",
                errors: "InherentData"
            },
            InherentData: {
                data: "BTreeMap<InherentIdentifier, Bytes>"
            },
            InherentIdentifier: "[u8; 8]"
        }
    }, QHe = {
        rpc: {},
        types: {
            CollectiveOrigin: {
                _enum: {
                    Members: "(MemberCount, MemberCount)",
                    Member: "AccountId"
                }
            },
            MemberCount: "u32",
            ProposalIndex: "u32",
            VotesTo230: {
                index: "ProposalIndex",
                threshold: "MemberCount",
                ayes: "Vec<AccountId>",
                nays: "Vec<AccountId>"
            },
            Votes: {
                index: "ProposalIndex",
                threshold: "MemberCount",
                ayes: "Vec<AccountId>",
                nays: "Vec<AccountId>",
                end: "BlockNumber"
            }
        }
    }, eje = {
        rpc: {},
        types: {
            AuthorityId: "AccountId",
            RawVRFOutput: "[u8; 32]"
        }
    }, tje = {
        call: {
            deprecated: "Use the runtime interface `api.call.contractsApi.call` instead",
            description: "Executes a call to a contract",
            params: [
                {
                    name: "callRequest",
                    type: "ContractCallRequest"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "ContractExecResult"
        },
        getStorage: {
            deprecated: "Use the runtime interface `api.call.contractsApi.getStorage` instead",
            description: "Returns the value under a specified storage key in a contract",
            params: [
                {
                    name: "address",
                    type: "AccountId"
                },
                {
                    name: "key",
                    type: "H256"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Option<Bytes>"
        },
        instantiate: {
            deprecated: "Use the runtime interface `api.call.contractsApi.instantiate` instead",
            description: "Instantiate a new contract",
            params: [
                {
                    name: "request",
                    type: "InstantiateRequestV1"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "ContractInstantiateResult"
        },
        rentProjection: {
            deprecated: "Not available in newer versions of the contracts interfaces",
            description: "Returns the projected time a given contract will be able to sustain paying its rent",
            params: [
                {
                    name: "address",
                    type: "AccountId"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Option<BlockNumber>"
        },
        uploadCode: {
            deprecated: "Use the runtime interface `api.call.contractsApi.uploadCode` instead",
            description: "Upload new code without instantiating a contract from it",
            endpoint: "contracts_upload_code",
            params: [
                {
                    name: "uploadRequest",
                    type: "CodeUploadRequest"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "CodeUploadResult"
        }
    }, hD = {
        get_storage: {
            description: "Query a given storage key in a given contract.",
            params: [
                {
                    name: "address",
                    type: "AccountId"
                },
                {
                    name: "key",
                    type: "Bytes"
                }
            ],
            type: "Option<Bytes>"
        },
        upload_code: {
            description: "Upload new code without instantiating a contract from it.",
            params: [
                {
                    name: "origin",
                    type: "AccountId"
                },
                {
                    name: "code",
                    type: "Bytes"
                },
                {
                    name: "storageDepositLimit",
                    type: "Option<Balance>"
                }
            ],
            type: "CodeUploadResult"
        }
    }, nje = {
        ContractsApi: [
            {
                methods: {
                    call: {
                        description: "Perform a call from a specified account to a given contract.",
                        params: [
                            {
                                name: "origin",
                                type: "AccountId"
                            },
                            {
                                name: "dest",
                                type: "AccountId"
                            },
                            {
                                name: "value",
                                type: "Balance"
                            },
                            {
                                name: "gasLimit",
                                type: "Option<WeightV2>"
                            },
                            {
                                name: "storageDepositLimit",
                                type: "Option<Balance>"
                            },
                            {
                                name: "inputData",
                                type: "Vec<u8>"
                            }
                        ],
                        type: "ContractExecResult"
                    },
                    instantiate: {
                        description: "Instantiate a new contract.",
                        params: [
                            {
                                name: "origin",
                                type: "AccountId"
                            },
                            {
                                name: "value",
                                type: "Balance"
                            },
                            {
                                name: "gasLimit",
                                type: "Option<WeightV2>"
                            },
                            {
                                name: "storageDepositLimit",
                                type: "Option<Balance>"
                            },
                            {
                                name: "code",
                                type: "CodeSource"
                            },
                            {
                                name: "data",
                                type: "Bytes"
                            },
                            {
                                name: "salt",
                                type: "Bytes"
                            }
                        ],
                        type: "ContractInstantiateResult"
                    },
                    ...hD
                },
                version: 2
            },
            {
                methods: {
                    call: {
                        description: "Perform a call from a specified account to a given contract.",
                        params: [
                            {
                                name: "origin",
                                type: "AccountId"
                            },
                            {
                                name: "dest",
                                type: "AccountId"
                            },
                            {
                                name: "value",
                                type: "Balance"
                            },
                            {
                                name: "gasLimit",
                                type: "u64"
                            },
                            {
                                name: "storageDepositLimit",
                                type: "Option<Balance>"
                            },
                            {
                                name: "inputData",
                                type: "Vec<u8>"
                            }
                        ],
                        type: "ContractExecResultU64"
                    },
                    instantiate: {
                        description: "Instantiate a new contract.",
                        params: [
                            {
                                name: "origin",
                                type: "AccountId"
                            },
                            {
                                name: "value",
                                type: "Balance"
                            },
                            {
                                name: "gasLimit",
                                type: "u64"
                            },
                            {
                                name: "storageDepositLimit",
                                type: "Option<Balance>"
                            },
                            {
                                name: "code",
                                type: "CodeSource"
                            },
                            {
                                name: "data",
                                type: "Bytes"
                            },
                            {
                                name: "salt",
                                type: "Bytes"
                            }
                        ],
                        type: "ContractInstantiateResultU64"
                    },
                    ...hD
                },
                version: 1
            }
        ]
    }, rje = {
        rpc: tje,
        runtime: nje,
        types: {
            AliveContractInfo: {
                trieId: "TrieId",
                storageSize: "u32",
                pairCount: "u32",
                codeHash: "CodeHash",
                rentAllowance: "Balance",
                rentPaid: "Balance",
                deductBlock: "BlockNumber",
                lastWrite: "Option<BlockNumber>",
                _reserved: "Option<Null>"
            },
            CodeHash: "Hash",
            CodeSource: {
                _enum: {
                    Upload: "Bytes",
                    Existing: "Hash"
                }
            },
            CodeUploadRequest: {
                origin: "AccountId",
                code: "Bytes",
                storageDepositLimit: "Option<Balance>"
            },
            CodeUploadResult: "Result<CodeUploadResultValue, DispatchError>",
            CodeUploadResultValue: {
                codeHash: "CodeHash",
                deposit: "Balance"
            },
            ContractCallRequest: {
                origin: "AccountId",
                dest: "AccountId",
                value: "Balance",
                gasLimit: "u64",
                storageDepositLimit: "Option<Balance>",
                inputData: "Bytes"
            },
            ContractExecResultSuccessTo255: {
                status: "u8",
                data: "Raw"
            },
            ContractExecResultTo255: {
                _enum: {
                    Success: "ContractExecResultSuccessTo255",
                    Error: "Null"
                }
            },
            ContractExecResultSuccessTo260: {
                flags: "ContractReturnFlags",
                data: "Bytes",
                gasConsumed: "u64"
            },
            ContractExecResultTo260: {
                _enum: {
                    Success: "ContractExecResultSuccessTo260",
                    Error: "Null"
                }
            },
            ContractExecResultOk: {
                flags: "ContractReturnFlags",
                data: "Bytes"
            },
            ContractExecResultResult: "Result<ContractExecResultOk, DispatchError>",
            ContractExecResultTo267: {
                gasConsumed: "u64",
                debugMessage: "Text",
                result: "ContractExecResultResult"
            },
            ContractExecResult: {
                gasConsumed: "Weight",
                gasRequired: "Weight",
                storageDeposit: "StorageDeposit",
                debugMessage: "Text",
                result: "ContractExecResultResult"
            },
            ContractExecResultU64: {
                gasConsumed: "u64",
                gasRequired: "u64",
                storageDeposit: "StorageDeposit",
                debugMessage: "Text",
                result: "ContractExecResultResult"
            },
            ContractInfo: {
                _enum: {
                    Alive: "AliveContractInfo",
                    Tombstone: "TombstoneContractInfo"
                }
            },
            ContractCallFlags: {
                _set: {
                    _bitLength: 32,
                    ForwardInput: 1,
                    CloneInput: 2,
                    TailCall: 4,
                    AllowReentry: 8
                }
            },
            ContractReturnFlags: {
                _set: {
                    _bitLength: 32,
                    Revert: 1
                }
            },
            ContractStorageKey: "[u8; 32]",
            DeletedContract: {
                pairCount: "u32",
                trieId: "TrieId"
            },
            ExecReturnValue: {
                flags: "ContractReturnFlags",
                data: "Bytes"
            },
            Gas: "u64",
            HostFnWeightsTo264: {
                caller: "Weight",
                address: "Weight",
                gasLeft: "Weight",
                balance: "Weight",
                valueTransferred: "Weight",
                minimumBalance: "Weight",
                tombstoneDeposit: "Weight",
                rentAllowance: "Weight",
                blockNumber: "Weight",
                now: "Weight",
                weightToFee: "Weight",
                gas: "Weight",
                input: "Weight",
                inputPerByte: "Weight",
                return: "Weight",
                returnPerByte: "Weight",
                terminate: "Weight",
                restoreTo: "Weight",
                restoreToPerDelta: "Weight",
                random: "Weight",
                depositEvent: "Weight",
                depositEventPerTopic: "Weight",
                depositEventPerByte: "Weight",
                setRentAllowance: "Weight",
                setStorage: "Weight",
                setStoragePerByte: "Weight",
                clearStorage: "Weight",
                getStorage: "Weight",
                getStoragePerByte: "Weight",
                transfer: "Weight",
                call: "Weight",
                callTransferSurcharge: "Weight",
                callPerInputByte: "Weight",
                callPerOutputByte: "Weight",
                instantiate: "Weight",
                instantiatePerInputByte: "Weight",
                instantiatePerOutputByte: "Weight",
                hashSha2256: "Weight",
                hashSha2256PerByte: "Weight",
                hashKeccak256: "Weight",
                hashKeccak256PerByte: "Weight",
                hashBlake2256: "Weight",
                hashBlake2256PerByte: "Weight",
                hashBlake2128: "Weight",
                hashBlake2128PerByte: "Weight"
            },
            HostFnWeights: {
                caller: "Weight",
                address: "Weight",
                gasLeft: "Weight",
                balance: "Weight",
                valueTransferred: "Weight",
                minimumBalance: "Weight",
                tombstoneDeposit: "Weight",
                rentAllowance: "Weight",
                blockNumber: "Weight",
                now: "Weight",
                weightToFee: "Weight",
                gas: "Weight",
                input: "Weight",
                inputPerByte: "Weight",
                return: "Weight",
                returnPerByte: "Weight",
                terminate: "Weight",
                terminatePerCodeByte: "Weight",
                restoreTo: "Weight",
                restoreToPerCallerCodeByte: "Weight",
                restoreToPerTombstoneCodeByte: "Weight",
                restoreToPerDelta: "Weight",
                random: "Weight",
                depositEvent: "Weight",
                depositEventPerTopic: "Weight",
                depositEventPerByte: "Weight",
                setRentAllowance: "Weight",
                setStorage: "Weight",
                setStoragePerByte: "Weight",
                clearStorage: "Weight",
                getStorage: "Weight",
                getStoragePerByte: "Weight",
                transfer: "Weight",
                call: "Weight",
                callPerCodeByte: "Weight",
                callTransferSurcharge: "Weight",
                callPerInputByte: "Weight",
                callPerOutputByte: "Weight",
                instantiate: "Weight",
                instantiatePerCodeByte: "Weight",
                instantiatePerInputByte: "Weight",
                instantiatePerOutputByte: "Weight",
                instantiatePerSaltByte: "Weight",
                hashSha2256: "Weight",
                hashSha2256PerByte: "Weight",
                hashKeccak256: "Weight",
                hashKeccak256PerByte: "Weight",
                hashBlake2256: "Weight",
                hashBlake2256PerByte: "Weight",
                hashBlake2128: "Weight",
                hashBlake2128PerByte: "Weight",
                rentParams: "Weight"
            },
            InstantiateRequestV1: {
                origin: "AccountId",
                value: "Balance",
                gasLimit: "Gas",
                code: "Bytes",
                data: "Bytes",
                salt: "Bytes"
            },
            InstantiateRequestV2: {
                _fallback: "InstantiateRequestV1",
                origin: "AccountId",
                value: "Balance",
                gasLimit: "Gas",
                storageDepositLimit: "Option<Balance>",
                code: "Bytes",
                data: "Bytes",
                salt: "Bytes"
            },
            InstantiateRequest: {
                _fallback: "InstantiateRequestV2",
                origin: "AccountId",
                value: "Balance",
                gasLimit: "Gas",
                storageDepositLimit: "Option<Balance>",
                code: "CodeSource",
                data: "Bytes",
                salt: "Bytes"
            },
            ContractInstantiateResultTo267: "Result<InstantiateReturnValueTo267, Null>",
            ContractInstantiateResultTo299: "Result<InstantiateReturnValueOk, Null>",
            ContractInstantiateResult: {
                gasConsumed: "WeightV2",
                gasRequired: "WeightV2",
                storageDeposit: "StorageDeposit",
                debugMessage: "Text",
                result: "InstantiateReturnValue"
            },
            ContractInstantiateResultU64: {
                _fallback: "ContractInstantiateResultTo299",
                gasConsumed: "u64",
                gasRequired: "u64",
                storageDeposit: "StorageDeposit",
                debugMessage: "Text",
                result: "InstantiateReturnValue"
            },
            InstantiateReturnValueTo267: {
                result: "ExecReturnValue",
                accountId: "AccountId",
                rentProjection: "Option<RentProjection>"
            },
            InstantiateReturnValueOk: {
                result: "ExecReturnValue",
                accountId: "AccountId"
            },
            InstantiateReturnValue: "Result<InstantiateReturnValueOk, DispatchError>",
            InstructionWeights: {
                i64const: "u32",
                i64load: "u32",
                i64store: "u32",
                select: "u32",
                rIf: "u32",
                br: "u32",
                brIf: "u32",
                brIable: "u32",
                brIablePerEntry: "u32",
                call: "u32",
                callIndirect: "u32",
                callIndirectPerParam: "u32",
                localGet: "u32",
                localSet: "u32",
                local_tee: "u32",
                globalGet: "u32",
                globalSet: "u32",
                memoryCurrent: "u32",
                memoryGrow: "u32",
                i64clz: "u32",
                i64ctz: "u32",
                i64popcnt: "u32",
                i64eqz: "u32",
                i64extendsi32: "u32",
                i64extendui32: "u32",
                i32wrapi64: "u32",
                i64eq: "u32",
                i64ne: "u32",
                i64lts: "u32",
                i64ltu: "u32",
                i64gts: "u32",
                i64gtu: "u32",
                i64les: "u32",
                i64leu: "u32",
                i64ges: "u32",
                i64geu: "u32",
                i64add: "u32",
                i64sub: "u32",
                i64mul: "u32",
                i64divs: "u32",
                i64divu: "u32",
                i64rems: "u32",
                i64remu: "u32",
                i64and: "u32",
                i64or: "u32",
                i64xor: "u32",
                i64shl: "u32",
                i64shrs: "u32",
                i64shru: "u32",
                i64rotl: "u32",
                i64rotr: "u32"
            },
            LimitsTo264: {
                eventTopics: "u32",
                stackHeight: "u32",
                globals: "u32",
                parameters: "u32",
                memoryPages: "u32",
                tableSize: "u32",
                brTableSize: "u32",
                subjectLen: "u32",
                codeSize: "u32"
            },
            Limits: {
                eventTopics: "u32",
                stackHeight: "u32",
                globals: "u32",
                parameters: "u32",
                memoryPages: "u32",
                tableSize: "u32",
                brTableSize: "u32",
                subjectLen: "u32"
            },
            PrefabWasmModule: {
                scheduleVersion: "Compact<u32>",
                initial: "Compact<u32>",
                maximum: "Compact<u32>",
                refcount: "Compact<u64>",
                _reserved: "Option<Null>",
                code: "Bytes",
                originalCodeLen: "u32"
            },
            RentProjection: {
                _enum: {
                    EvictionAt: "BlockNumber",
                    NoEviction: "Null"
                }
            },
            ScheduleTo212: {
                version: "u32",
                putCodePerByteCost: "Gas",
                growMemCost: "Gas",
                regularOpCost: "Gas",
                returnDataPerByteCost: "Gas",
                eventDataPerByteCost: "Gas",
                eventPerTopicCost: "Gas",
                eventBaseCost: "Gas",
                sandboxDataReadCost: "Gas",
                sandboxDataWriteCost: "Gas",
                maxEventTopics: "u32",
                maxStackHeight: "u32",
                maxMemoryPages: "u32",
                enablePrintln: "bool",
                maxSubjectLen: "u32"
            },
            ScheduleTo258: {
                version: "u32",
                putCodePerByteCost: "Gas",
                growMemCost: "Gas",
                regularOpCost: "Gas",
                returnDataPerByteCost: "Gas",
                eventDataPerByteCost: "Gas",
                eventPerTopicCost: "Gas",
                eventBaseCost: "Gas",
                sandboxDataReadCost: "Gas",
                sandboxDataWriteCost: "Gas",
                transferCost: "Gas",
                maxEventTopics: "u32",
                maxStackHeight: "u32",
                maxMemoryPages: "u32",
                enablePrintln: "bool",
                maxSubjectLen: "u32"
            },
            ScheduleTo264: {
                version: "u32",
                enablePrintln: "bool",
                limits: "LimitsTo264",
                instructionWeights: "InstructionWeights",
                hostFnWeights: "HostFnWeightsTo264"
            },
            Schedule: {
                version: "u32",
                enablePrintln: "bool",
                limits: "Limits",
                instructionWeights: "InstructionWeights",
                hostFnWeights: "HostFnWeights"
            },
            SeedOf: "Hash",
            StorageDeposit: {
                _enum: {
                    Refund: "Balance",
                    Charge: "Balance"
                }
            },
            TombstoneContractInfo: "Hash",
            TrieId: "Bytes"
        }
    }, sje = [
        "None",
        "Locked1x",
        "Locked2x",
        "Locked3x",
        "Locked4x",
        "Locked5x",
        "Locked6x"
    ], ije = {
        rpc: {},
        types: {
            AccountVote: {
                _enum: {
                    Standard: "AccountVoteStandard",
                    Split: "AccountVoteSplit"
                }
            },
            AccountVoteSplit: {
                aye: "Balance",
                nay: "Balance"
            },
            AccountVoteStandard: {
                vote: "Vote",
                balance: "Balance"
            },
            Conviction: {
                _enum: sje
            },
            Delegations: {
                votes: "Balance",
                capital: "Balance"
            },
            PreimageStatus: {
                _enum: {
                    Missing: "BlockNumber",
                    Available: "PreimageStatusAvailable"
                }
            },
            PreimageStatusAvailable: {
                data: "Bytes",
                provider: "AccountId",
                deposit: "Balance",
                since: "BlockNumber",
                expiry: "Option<BlockNumber>"
            },
            PriorLock: "(BlockNumber, Balance)",
            PropIndex: "u32",
            Proposal: "Call",
            ProxyState: {
                _enum: {
                    Open: "AccountId",
                    Active: "AccountId"
                }
            },
            ReferendumIndex: "u32",
            ReferendumInfoTo239: {
                end: "BlockNumber",
                proposalHash: "Hash",
                threshold: "VoteThreshold",
                delay: "BlockNumber"
            },
            ReferendumInfo: {
                _enum: {
                    Ongoing: "ReferendumStatus",
                    Finished: "ReferendumInfoFinished"
                }
            },
            ReferendumInfoFinished: {
                approved: "bool",
                end: "BlockNumber"
            },
            ReferendumStatus: {
                end: "BlockNumber",
                proposalHash: "Hash",
                threshold: "VoteThreshold",
                delay: "BlockNumber",
                tally: "Tally"
            },
            Tally: {
                ayes: "Balance",
                nays: "Balance",
                turnout: "Balance"
            },
            Voting: {
                _enum: {
                    Direct: "VotingDirect",
                    Delegating: "VotingDelegating"
                }
            },
            VotingDirect: {
                votes: "Vec<VotingDirectVote>",
                delegations: "Delegations",
                prior: "PriorLock"
            },
            VotingDirectVote: "(ReferendumIndex, AccountVote)",
            VotingDelegating: {
                balance: "Balance",
                target: "AccountId",
                conviction: "Conviction",
                delegations: "Delegations",
                prior: "PriorLock"
            }
        }
    }, oje = {
        getBlockStats: {
            description: "Reexecute the specified `block_hash` and gather statistics while doing so",
            isUnsafe: !0,
            params: [
                {
                    isHistoric: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Option<BlockStats>"
        }
    }, aje = {
        rpc: oje,
        types: {
            BlockStats: {
                witnessLen: "u64",
                witnessCompactLen: "u64",
                blockLen: "u64",
                blockNumExtrinsics: "u64"
            }
        }
    }, cje = {
        AuthorityDiscoveryApi: [
            {
                methods: {
                    authorities: {
                        description: "Retrieve authority identifiers of the current and next authority set.",
                        params: [],
                        type: "Vec<AuthorityId>"
                    }
                },
                version: 1
            }
        ]
    }, lje = {
        rpc: {},
        runtime: cje,
        types: {}
    }, uje = {
        rpc: {},
        types: {
            ApprovalFlag: "u32",
            DefunctVoter: {
                who: "AccountId",
                voteCount: "Compact<u32>",
                candidateCount: "Compact<u32>"
            },
            Renouncing: {
                _enum: {
                    Member: "Null",
                    RunnerUp: "Null",
                    Candidate: "Compact<u32>"
                }
            },
            SetIndex: "u32",
            Vote: "GenericVote",
            VoteIndex: "u32",
            VoterInfo: {
                lastActive: "VoteIndex",
                lastWin: "VoteIndex",
                pot: "Balance",
                stake: "Balance"
            },
            VoteThreshold: {
                _enum: [
                    "Super Majority Approve",
                    "Super Majority Against",
                    "Simple Majority"
                ]
            }
        }
    }, dje = {
        createBlock: {
            description: "Instructs the manual-seal authorship task to create a new block",
            params: [
                {
                    name: "createEmpty",
                    type: "bool"
                },
                {
                    name: "finalize",
                    type: "bool"
                },
                {
                    isOptional: !0,
                    name: "parentHash",
                    type: "BlockHash"
                }
            ],
            type: "CreatedBlock"
        },
        finalizeBlock: {
            description: "Instructs the manual-seal authorship task to finalize a block",
            params: [
                {
                    name: "hash",
                    type: "BlockHash"
                },
                {
                    isOptional: !0,
                    name: "justification",
                    type: "Justification"
                }
            ],
            type: "bool"
        }
    }, fje = {
        rpc: dje,
        types: {
            CreatedBlock: {
                _alias: {
                    blockHash: "hash"
                },
                blockHash: "BlockHash",
                aux: "ImportedAux"
            },
            ImportedAux: {
                headerOnly: "bool",
                clearJustificationRequests: "bool",
                needsJustification: "bool",
                badJustification: "bool",
                needsFinalityProof: "bool",
                isNewBest: "bool"
            }
        }
    }, pje = {
        rpc: {},
        types: {
            EvmAccount: {
                nonce: "u256",
                balance: "u256"
            },
            EvmCallInfo: {
                exitReason: "ExitReason",
                value: "Bytes",
                usedGas: "U256",
                logs: "Vec<EvmLog>"
            },
            EvmCreateInfo: {
                exitReason: "ExitReason",
                value: "H160",
                usedGas: "U256",
                logs: "Vec<EvmLog>"
            },
            EvmCallInfoV2: {
                exitReason: "ExitReason",
                value: "Bytes",
                usedGas: "U256",
                weightInfo: "Option<EvmWeightInfo>",
                logs: "Vec<EvmLog>"
            },
            EvmCreateInfoV2: {
                exitReason: "ExitReason",
                value: "H160",
                usedGas: "U256",
                weightInfo: "Option<EvmWeightInfo>",
                logs: "Vec<EvmLog>"
            },
            EvmLog: {
                address: "H160",
                topics: "Vec<H256>",
                data: "Bytes"
            },
            EvmVicinity: {
                gasPrice: "u256",
                origin: "H160"
            },
            EvmWeightInfo: {
                refTimeLimit: "Option<u64>",
                proofSizeLimit: "Option<u64>",
                refTimeUsage: "Option<u64>",
                proofSizeUsage: "Option<u64>"
            },
            ExitError: {
                _enum: {
                    StackUnderflow: "Null",
                    StackOverflow: "Null",
                    InvalidJump: "Null",
                    InvalidRange: "Null",
                    DesignatedInvalid: "Null",
                    CallTooDeep: "Null",
                    CreateCollision: "Null",
                    CreateContractLimit: "Null",
                    OutOfOffset: "Null",
                    OutOfGas: "Null",
                    OutOfFund: "Null",
                    PCUnderflow: "Null",
                    CreateEmpty: "Null",
                    Other: "Text"
                }
            },
            ExitFatal: {
                _enum: {
                    NotSupported: "Null",
                    UnhandledInterrupt: "Null",
                    CallErrorAsFatal: "ExitError",
                    Other: "Text"
                }
            },
            ExitReason: {
                _enum: {
                    Succeed: "ExitSucceed",
                    Error: "ExitError",
                    Revert: "ExitRevert",
                    Fatal: "ExitFatal"
                }
            },
            ExitRevert: {
                _enum: [
                    "Reverted"
                ]
            },
            ExitSucceed: {
                _enum: [
                    "Stopped",
                    "Returned",
                    "Suicided"
                ]
            }
        }
    }, hje = {
        rpc: {},
        types: {
            Extrinsic: "GenericExtrinsic",
            ExtrinsicEra: "GenericExtrinsicEra",
            ExtrinsicPayload: "GenericExtrinsicPayload",
            ExtrinsicSignature: "MultiSignature",
            ExtrinsicV4: "GenericExtrinsicV4",
            ExtrinsicPayloadV4: "GenericExtrinsicPayloadV4",
            ExtrinsicSignatureV4: "GenericExtrinsicSignatureV4",
            ExtrinsicUnknown: "GenericExtrinsicUnknown",
            ExtrinsicPayloadUnknown: "GenericExtrinsicPayloadUnknown",
            ExtrinsicV5: "GenericExtrinsicV5",
            ExtrinsicPayloadV5: "GenericExtrinsicPayloadV5",
            ExtrinsicSignatureV5: "GenericExtrinsicSignatureV5",
            Era: "ExtrinsicEra",
            ImmortalEra: "GenericImmortalEra",
            MortalEra: "GenericMortalEra",
            AnySignature: "H512",
            MultiSignature: {
                _enum: {
                    Ed25519: "Ed25519Signature",
                    Sr25519: "Sr25519Signature",
                    Ecdsa: "EcdsaSignature"
                }
            },
            Signature: "H512",
            SignerPayload: "GenericSignerPayload",
            EcdsaSignature: "[u8; 65]",
            Ed25519Signature: "H512",
            Sr25519Signature: "H512"
        }
    }, gje = {
        FungiblesApi: [
            {
                methods: {
                    query_account_balances: {
                        description: "Returns the list of all `MultiAsset` that an `AccountId` has",
                        params: [
                            {
                                name: "account",
                                type: "AccountId"
                            }
                        ],
                        type: "Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>"
                    }
                },
                version: 1
            },
            {
                methods: {
                    query_account_balances: {
                        description: "Returns the list of all `MultiAsset` that an `AccountId` has",
                        params: [
                            {
                                name: "account",
                                type: "AccountId"
                            }
                        ],
                        type: "Result<XcmVersionedAssets, FungiblesAccessError>"
                    }
                },
                version: 2
            }
        ]
    }, bje = {
        rpc: {},
        runtime: gje,
        types: {
            FungiblesAccessError: {
                _enum: [
                    "AssetIdConversionFailed",
                    "AmountToBalanceConversionFailed"
                ]
            }
        }
    }, mje = {
        rpc: {},
        types: {
            AssetOptions: {
                initalIssuance: "Compact<Balance>",
                permissions: "PermissionLatest"
            },
            Owner: {
                _enum: {
                    None: "Null",
                    Address: "AccountId"
                }
            },
            PermissionsV1: {
                update: "Owner",
                mint: "Owner",
                burn: "Owner"
            },
            PermissionVersions: {
                _enum: {
                    V1: "PermissionsV1"
                }
            },
            PermissionLatest: "PermissionsV1"
        }
    }, yje = {
        GenesisBuilder: [
            {
                methods: {
                    build_config: {
                        description: "Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the storage.",
                        params: [
                            {
                                name: "json",
                                type: "Vec<u8>"
                            }
                        ],
                        type: "Result<(), GenesisBuildErr>"
                    },
                    create_default_config: {
                        description: "Creates the default `RuntimeGenesisConfig` and returns it as a JSON blob.",
                        params: [],
                        type: "Vec<u8>"
                    }
                },
                version: 1
            }
        ]
    }, wje = {
        rpc: {},
        runtime: yje,
        types: {
            GenesisBuildErr: "Text"
        }
    }, _je = {
        rpc: {},
        types: {
            ActiveGilt: {
                proportion: "Perquintill",
                amount: "Balance",
                who: "AccountId",
                expiry: "BlockNumber"
            },
            ActiveGiltsTotal: {
                frozen: "Balance",
                proportion: "Perquintill",
                index: "ActiveIndex",
                target: "Perquintill"
            },
            ActiveIndex: "u32",
            GiltBid: {
                amount: "Balance",
                who: "AccountId"
            }
        }
    }, xje = {
        proveFinality: {
            description: "Prove finality for the given block number, returning the Justification for the last block in the set.",
            params: [
                {
                    name: "blockNumber",
                    type: "BlockNumber"
                }
            ],
            type: "Option<EncodedFinalityProofs>"
        },
        roundState: {
            description: "Returns the state of the current best round state as well as the ongoing background rounds",
            params: [],
            type: "ReportedRoundStates"
        },
        subscribeJustifications: {
            description: "Subscribes to grandpa justifications",
            params: [],
            pubsub: [
                "justifications",
                "subscribeJustifications",
                "unsubscribeJustifications"
            ],
            type: "JustificationNotification"
        }
    }, gD = {
        generate_key_ownership_proof: {
            description: "Generates a proof of key ownership for the given authority in the given set.",
            params: [
                {
                    name: "setId",
                    type: "SetId"
                },
                {
                    name: "authorityId",
                    type: "AuthorityId"
                }
            ],
            type: "Option<OpaqueKeyOwnershipProof>"
        },
        grandpa_authorities: {
            description: "Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.",
            params: [],
            type: "AuthorityList"
        },
        submit_report_equivocation_unsigned_extrinsic: {
            description: "Submits an unsigned extrinsic to report an equivocation.",
            params: [
                {
                    name: "equivocationProof",
                    type: "GrandpaEquivocationProof"
                },
                {
                    name: "keyOwnerProof",
                    type: "OpaqueKeyOwnershipProof"
                }
            ],
            type: "Option<Null>"
        }
    }, vje = {
        GrandpaApi: [
            {
                methods: {
                    current_set_id: {
                        description: "Get current GRANDPA authority set id.",
                        params: [],
                        type: "SetId"
                    },
                    ...gD
                },
                version: 3
            },
            {
                methods: gD,
                version: 2
            }
        ]
    }, Sje = {
        rpc: xje,
        runtime: vje,
        types: {
            AuthorityIndex: "u64",
            AuthorityList: "Vec<NextAuthority>",
            AuthoritySet: {
                currentAuthorities: "AuthorityList",
                setId: "u64",
                pendingStandardChanges: "ForkTreePendingChange",
                pendingForcedChanges: "Vec<PendingChange>",
                authoritySetChanges: "AuthoritySetChanges"
            },
            ForkTreePendingChange: {
                roots: "Vec<ForkTreePendingChangeNode>",
                bestFinalizedNumber: "Option<BlockNumber>"
            },
            ForkTreePendingChangeNode: {
                hash: "BlockHash",
                number: "BlockNumber",
                data: "PendingChange",
                children: "Vec<ForkTreePendingChangeNode>"
            },
            AuthoritySetChange: "(U64, BlockNumber)",
            AuthoritySetChanges: "Vec<AuthoritySetChange>",
            AuthorityWeight: "u64",
            DelayKind: {
                _enum: {
                    Finalized: "Null",
                    Best: "DelayKindBest"
                }
            },
            DelayKindBest: {
                medianLastFinalized: "BlockNumber"
            },
            EncodedFinalityProofs: "Bytes",
            GrandpaEquivocation: {
                _enum: {
                    Prevote: "GrandpaEquivocationValue",
                    Precommit: "GrandpaEquivocationValue"
                }
            },
            GrandpaEquivocationProof: {
                setId: "SetId",
                equivocation: "GrandpaEquivocation"
            },
            GrandpaEquivocationValue: {
                roundNumber: "u64",
                identity: "AuthorityId",
                first: "(GrandpaPrevote, AuthoritySignature)",
                second: "(GrandpaPrevote, AuthoritySignature)"
            },
            GrandpaPrevote: {
                targetHash: "Hash",
                targetNumber: "BlockNumber"
            },
            GrandpaCommit: {
                targetHash: "BlockHash",
                targetNumber: "BlockNumber",
                precommits: "Vec<GrandpaSignedPrecommit>"
            },
            GrandpaPrecommit: {
                targetHash: "BlockHash",
                targetNumber: "BlockNumber"
            },
            GrandpaSignedPrecommit: {
                precommit: "GrandpaPrecommit",
                signature: "AuthoritySignature",
                id: "AuthorityId"
            },
            GrandpaJustification: {
                round: "u64",
                commit: "GrandpaCommit",
                votesAncestries: "Vec<Header>"
            },
            JustificationNotification: "Bytes",
            KeyOwnerProof: "MembershipProof",
            NextAuthority: "(AuthorityId, AuthorityWeight)",
            PendingChange: {
                nextAuthorities: "AuthorityList",
                delay: "BlockNumber",
                canonHeight: "BlockNumber",
                canonHash: "BlockHash",
                delayKind: "DelayKind"
            },
            PendingPause: {
                scheduledAt: "BlockNumber",
                delay: "BlockNumber"
            },
            PendingResume: {
                scheduledAt: "BlockNumber",
                delay: "BlockNumber"
            },
            Precommits: {
                currentWeight: "u32",
                missing: "BTreeSet<AuthorityId>"
            },
            Prevotes: {
                currentWeight: "u32",
                missing: "BTreeSet<AuthorityId>"
            },
            ReportedRoundStates: {
                setId: "u32",
                best: "RoundState",
                background: "Vec<RoundState>"
            },
            RoundState: {
                round: "u32",
                totalWeight: "u32",
                thresholdWeight: "u32",
                prevotes: "Prevotes",
                precommits: "Precommits"
            },
            SetId: "u64",
            StoredPendingChange: {
                scheduledAt: "BlockNumber",
                delay: "BlockNumber",
                nextAuthorities: "AuthorityList"
            },
            StoredState: {
                _enum: {
                    Live: "Null",
                    PendingPause: "PendingPause",
                    Paused: "Null",
                    PendingResume: "PendingResume"
                }
            }
        }
    }, kje = {
        rpc: {},
        types: {
            IdentityFields: {
                _set: {
                    _bitLength: 64,
                    Display: 1,
                    Legal: 2,
                    Web: 4,
                    Riot: 8,
                    Email: 16,
                    PgpFingerprint: 32,
                    Image: 64,
                    Twitter: 128
                }
            },
            IdentityInfoAdditional: "(Data, Data)",
            IdentityInfoTo198: {
                additional: "Vec<IdentityInfoAdditional>",
                display: "Data",
                legal: "Data",
                web: "Data",
                riot: "Data",
                email: "Data",
                pgpFingerprint: "Option<H160>",
                image: "Data"
            },
            IdentityInfo: {
                _fallback: "IdentityInfoTo198",
                additional: "Vec<IdentityInfoAdditional>",
                display: "Data",
                legal: "Data",
                web: "Data",
                riot: "Data",
                email: "Data",
                pgpFingerprint: "Option<H160>",
                image: "Data",
                twitter: "Data"
            },
            IdentityJudgement: {
                _enum: {
                    Unknown: "Null",
                    FeePaid: "Balance",
                    Reasonable: "Null",
                    KnownGood: "Null",
                    OutOfDate: "Null",
                    LowQuality: "Null",
                    Erroneous: "Null"
                }
            },
            RegistrationJudgement: "(RegistrarIndex, IdentityJudgement)",
            RegistrationTo198: {
                judgements: "Vec<RegistrationJudgement>",
                deposit: "Balance",
                info: "IdentityInfoTo198"
            },
            Registration: {
                _fallback: "RegistrationTo198",
                judgements: "Vec<RegistrationJudgement>",
                deposit: "Balance",
                info: "IdentityInfo"
            },
            RegistrarIndex: "u32",
            RegistrarInfo: {
                account: "AccountId",
                fee: "Balance",
                fields: "IdentityFields"
            }
        }
    }, Tje = {
        rpc: {},
        types: {
            AuthIndex: "u32",
            AuthoritySignature: "Signature",
            Heartbeat: {
                blockNumber: "BlockNumber",
                networkState: "OpaqueNetworkState",
                sessionIndex: "SessionIndex",
                authorityIndex: "AuthIndex",
                validatorsLen: "u32"
            },
            HeartbeatTo244: {
                blockNumber: "BlockNumber",
                networkState: "OpaqueNetworkState",
                sessionIndex: "SessionIndex",
                authorityIndex: "AuthIndex"
            },
            OpaqueMultiaddr: "Opaque<Bytes>",
            OpaquePeerId: "Opaque<Bytes>",
            OpaqueNetworkState: {
                peerId: "OpaquePeerId",
                externalAddresses: "Vec<OpaqueMultiaddr>"
            }
        }
    }, Cje = {
        rpc: {},
        types: {
            CallIndex: "(u8, u8)",
            LotteryConfig: {
                price: "Balance",
                start: "BlockNumber",
                length: "BlockNumber",
                delay: "BlockNumber",
                repeat: "bool"
            }
        }
    }, Eje = {
        MixnetApi: [
            {
                methods: {
                    current_mixnodes: {
                        description: "Get the index and phase of the current session.",
                        params: [],
                        type: "Result<Mixnode, MixnodesErr>"
                    },
                    maybe_register: {
                        description: "Try to register a mixnode for the next session.",
                        params: [
                            {
                                name: "session_index",
                                type: "u32"
                            },
                            {
                                name: "mixnode",
                                type: "Mixnode"
                            }
                        ],
                        type: "bool"
                    },
                    prev_mixnodes: {
                        description: "Get the index and phase of the current session.",
                        params: [],
                        type: "Result<Mixnode, MixnodesErr>"
                    },
                    session_status: {
                        description: "Get the index and phase of the current session.",
                        params: [],
                        type: "SessionStatus"
                    }
                },
                version: 1
            }
        ]
    }, Ije = {
        rpc: {},
        runtime: Eje,
        types: {
            Mixnode: {
                externalAddresses: "Vec<Bytes>",
                kxPublic: "[u8; 32]",
                peerId: "[u8; 32]"
            },
            MixnodesErr: {
                _enum: {
                    InsufficientRegistrations: {
                        min: "u32",
                        num: "u32"
                    }
                }
            },
            SessionPhase: {
                _enum: [
                    "CoverToCurrent",
                    "RequestsToCurrent",
                    "CoverToPrev",
                    "DisconnectFromPrev"
                ]
            },
            SessionStatus: {
                currentIndex: "u32",
                phase: "SessionPhase"
            }
        }
    }, Aje = {
        generateProof: {
            description: "Generate MMR proof for the given block numbers.",
            params: [
                {
                    name: "blockNumbers",
                    type: "Vec<u64>"
                },
                {
                    isOptional: !0,
                    name: "bestKnownBlockNumber",
                    type: "u64"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "MmrLeafBatchProof"
        },
        root: {
            description: "Get the MMR root hash for the current best block.",
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "MmrHash"
        },
        verifyProof: {
            description: "Verify an MMR proof",
            params: [
                {
                    name: "proof",
                    type: "MmrLeafBatchProof"
                }
            ],
            type: "bool"
        },
        verifyProofStateless: {
            description: "Verify an MMR proof statelessly given an mmr_root",
            params: [
                {
                    name: "root",
                    type: "MmrHash"
                },
                {
                    name: "proof",
                    type: "MmrLeafBatchProof"
                }
            ],
            type: "bool"
        }
    }, Pje = {
        generate_proof: {
            description: "Generate MMR proof for the given block numbers.",
            params: [
                {
                    name: "blockNumbers",
                    type: "Vec<BlockNumber>"
                },
                {
                    name: "bestKnownBlockNumber",
                    type: "Option<BlockNumber>"
                }
            ],
            type: "Result<(Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof), MmrError>"
        },
        mmr_leaf_count: {
            description: "Return the number of MMR blocks in the chain.",
            params: [],
            type: "Result<U64, MmrError>"
        },
        mmr_root: {
            description: "Return the on-chain MMR root hash.",
            params: [],
            type: "Result<Hash, MmrError>"
        },
        verify_proof: {
            description: "Verify MMR proof against on-chain MMR.",
            params: [
                {
                    name: "leaves",
                    type: "Vec<MmrEncodableOpaqueLeaf>"
                },
                {
                    name: "proof",
                    type: "MmrBatchProof"
                }
            ],
            type: "Result<(), MmrError>"
        },
        verify_proof_stateless: {
            description: "Verify MMR proof against given root hash.",
            params: [
                {
                    name: "root",
                    type: "Hash"
                },
                {
                    name: "leaves",
                    type: "Vec<MmrEncodableOpaqueLeaf>"
                },
                {
                    name: "proof",
                    type: "MmrBatchProof"
                }
            ],
            type: "Result<(), MmrError>"
        }
    }, Oje = {
        generate_batch_proof: {
            description: "Generate MMR proof for a series of leaves under given indices.",
            params: [
                {
                    name: "leafIndices",
                    type: "Vec<MmrLeafIndex>"
                }
            ],
            type: "Result<(Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof), MmrError>"
        },
        generate_proof: {
            description: "Generate MMR proof for a leaf under given index.",
            params: [
                {
                    name: "leafIndex",
                    type: "MmrLeafIndex"
                }
            ],
            type: "Result<(MmrEncodableOpaqueLeaf, MmrProof), MmrError>"
        },
        mmr_root: {
            description: "Return the on-chain MMR root hash.",
            params: [],
            type: "Result<Hash, MmrError>"
        },
        verify_batch_proof: {
            description: "Verify MMR proof against on-chain MMR for a batch of leaves.",
            params: [
                {
                    name: "leaves",
                    type: "Vec<MmrEncodableOpaqueLeaf>"
                },
                {
                    name: "proof",
                    type: "MmrBatchProof"
                }
            ],
            type: "Result<(), MmrError>"
        },
        verify_batch_proof_stateless: {
            description: "Verify MMR proof against given root hash or a batch of leaves.",
            params: [
                {
                    name: "root",
                    type: "Hash"
                },
                {
                    name: "leaves",
                    type: "Vec<MmrEncodableOpaqueLeaf>"
                },
                {
                    name: "proof",
                    type: "MmrBatchProof"
                }
            ],
            type: "Result<(), MmrError>"
        },
        verify_proof: {
            description: "Verify MMR proof against on-chain MMR.",
            params: [
                {
                    name: "leaf",
                    type: "MmrEncodableOpaqueLeaf"
                },
                {
                    name: "proof",
                    type: "MmrProof"
                }
            ],
            type: "Result<(), MmrError>"
        },
        verify_proof_stateless: {
            description: "Verify MMR proof against given root hash.",
            params: [
                {
                    name: "root",
                    type: "Hash"
                },
                {
                    name: "leaf",
                    type: "MmrEncodableOpaqueLeaf"
                },
                {
                    name: "proof",
                    type: "MmrProof"
                }
            ],
            type: "Result<(), MmrError>"
        }
    }, Mje = {
        MmrApi: [
            {
                methods: Pje,
                version: 2
            },
            {
                methods: Oje,
                version: 1
            }
        ]
    }, Rje = {
        rpc: Aje,
        runtime: Mje,
        types: {
            MmrBatchProof: {
                leafIndices: "Vec<MmrLeafIndex>",
                leafCount: "MmrNodeIndex",
                items: "Vec<Hash>"
            },
            MmrEncodableOpaqueLeaf: "Bytes",
            MmrError: {
                _enum: [
                    "InvalidNumericOp",
                    "Push",
                    "GetRoot",
                    "Commit",
                    "GenerateProof",
                    "Verify",
                    "LeafNotFound",
                    " PalletNotIncluded",
                    "InvalidLeafIndex",
                    "InvalidBestKnownBlock"
                ]
            },
            MmrHash: "Hash",
            MmrLeafBatchProof: {
                blockHash: "BlockHash",
                leaves: "Bytes",
                proof: "Bytes"
            },
            MmrLeafIndex: "u64",
            MmrLeafProof: {
                blockHash: "BlockHash",
                leaf: "Bytes",
                proof: "Bytes"
            },
            MmrNodeIndex: "u64",
            MmrProof: {
                leafIndex: "MmrLeafIndex",
                leafCount: "MmrNodeIndex",
                items: "Vec<Hash>"
            }
        }
    }, Nje = {
        NftsApi: [
            {
                methods: {
                    attribute: {
                        description: "An attribute",
                        params: [
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            },
                            {
                                name: "item",
                                type: "NftItemId"
                            },
                            {
                                name: "key",
                                type: "Bytes"
                            }
                        ],
                        type: "Option<Bytes>"
                    },
                    collection_attribute: {
                        description: "A collection attribute",
                        params: [
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            },
                            {
                                name: "key",
                                type: "Bytes"
                            }
                        ],
                        type: "Option<Bytes>"
                    },
                    collection_owner: {
                        description: "A collection owner",
                        params: [
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            }
                        ],
                        type: "Option<AccountId>"
                    },
                    custom_attribute: {
                        description: "A custom attribute",
                        params: [
                            {
                                name: "account",
                                type: "AccountId"
                            },
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            },
                            {
                                name: "item",
                                type: "NftItemId"
                            },
                            {
                                name: "key",
                                type: "Bytes"
                            }
                        ],
                        type: "Option<Bytes>"
                    },
                    owner: {
                        description: "Collection owner",
                        params: [
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            },
                            {
                                name: "item",
                                type: "NftItemId"
                            }
                        ],
                        type: "Option<AccountId>"
                    },
                    system_attribute: {
                        description: "System attribute",
                        params: [
                            {
                                name: "collection",
                                type: "NftCollectionId"
                            },
                            {
                                name: "item",
                                type: "NftItemId"
                            },
                            {
                                name: "key",
                                type: "Bytes"
                            }
                        ],
                        type: "Option<Bytes>"
                    }
                },
                version: 1
            }
        ]
    }, Vje = {
        rpc: {},
        runtime: Nje,
        types: {
            NftCollectionId: "u32",
            NftItemId: "u32"
        }
    }, Dje = {
        NominationPoolsApi: [
            {
                methods: {
                    balance_to_points: {
                        description: "Returns the equivalent points of `new_funds` for a given pool.",
                        params: [
                            {
                                name: "poolId",
                                type: "NpPoolId"
                            },
                            {
                                name: "newFunds",
                                type: "Balance"
                            }
                        ],
                        type: "Balance"
                    },
                    pending_rewards: {
                        description: "Returns the pending rewards for the given member.",
                        params: [
                            {
                                name: "member",
                                type: "AccountId"
                            }
                        ],
                        type: "Balance"
                    },
                    points_to_balance: {
                        description: "Returns the equivalent balance of `points` for a given pool.",
                        params: [
                            {
                                name: "poolId",
                                type: "NpPoolId"
                            },
                            {
                                name: "points",
                                type: "Balance"
                            }
                        ],
                        type: "Balance"
                    }
                },
                version: 1
            }
        ]
    }, Bje = {
        rpc: {},
        runtime: Dje,
        types: {
            NpApiError: {
                _enum: [
                    "MemberNotFound",
                    "OverflowInPendingRewards"
                ]
            },
            NpPoolId: "u32"
        }
    }, Fje = {
        rpc: {},
        types: {
            DeferredOffenceOf: "(Vec<OffenceDetails>, Vec<Perbill>, SessionIndex)",
            Kind: "[u8; 16]",
            OffenceDetails: {
                offender: "Offender",
                reporters: "Vec<Reporter>"
            },
            Offender: "IdentificationTuple",
            OpaqueTimeSlot: "Bytes",
            ReportIdOf: "Hash",
            Reporter: "AccountId"
        }
    }, Lje = {
        DifficultyApi: [
            {
                methods: {
                    difficulty: {
                        description: "Return the target difficulty of the next block.",
                        params: [],
                        type: "Raw"
                    }
                },
                version: 1
            }
        ],
        TimestampApi: [
            {
                methods: {
                    timestamp: {
                        description: "API necessary for timestamp-based difficulty adjustment algorithms.",
                        params: [],
                        type: "Moment"
                    }
                },
                version: 1
            }
        ]
    }, zje = {
        rpc: {},
        runtime: Lje,
        types: {}
    }, Uje = {
        rpc: {},
        types: {
            ProxyDefinition: {
                delegate: "AccountId",
                proxyType: "ProxyType",
                delay: "BlockNumber"
            },
            ProxyType: {
                _enum: [
                    "Any",
                    "NonTransfer",
                    "Governance",
                    "Staking"
                ]
            },
            ProxyAnnouncement: {
                real: "AccountId",
                callHash: "Hash",
                height: "BlockNumber"
            }
        }
    }, Hje = {
        rpc: {},
        types: {
            ActiveRecovery: {
                created: "BlockNumber",
                deposit: "Balance",
                friends: "Vec<AccountId>"
            },
            RecoveryConfig: {
                delayPeriod: "BlockNumber",
                deposit: "Balance",
                friends: "Vec<AccountId>",
                threshold: "u16"
            }
        }
    }, jje = {
        rpc: {},
        types: {
            Period: "(BlockNumber, u32)",
            Priority: "u8",
            SchedulePeriod: "Period",
            SchedulePriority: "Priority",
            Scheduled: {
                maybeId: "Option<Bytes>",
                priority: "SchedulePriority",
                call: "Call",
                maybePeriodic: "Option<SchedulePeriod>",
                origin: "PalletsOrigin"
            },
            ScheduledTo254: {
                maybeId: "Option<Bytes>",
                priority: "SchedulePriority",
                call: "Call",
                maybePeriodic: "Option<SchedulePeriod>"
            },
            TaskAddress: "(BlockNumber, u32)"
        }
    }, qje = {
        SessionKeys: [
            {
                methods: {
                    decode_session_keys: {
                        description: "Decode the given public session keys.",
                        params: [
                            {
                                name: "encoded",
                                type: "Bytes"
                            }
                        ],
                        type: "Option<Vec<(Bytes, KeyTypeId)>>"
                    },
                    generate_session_keys: {
                        description: "Generate a set of session keys with optionally using the given seed.",
                        params: [
                            {
                                name: "seed",
                                type: "Option<Bytes>"
                            }
                        ],
                        type: "Bytes"
                    }
                },
                version: 1
            }
        ]
    }, Wje = {
        BeefyKey: "[u8; 33]",
        Keys: "SessionKeys4",
        SessionKeys1: "(AccountId)",
        SessionKeys2: "(AccountId, AccountId)",
        SessionKeys3: "(AccountId, AccountId, AccountId)",
        SessionKeys4: "(AccountId, AccountId, AccountId, AccountId)",
        SessionKeys5: "(AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys6: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys6B: "(AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",
        SessionKeys7: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys7B: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",
        SessionKeys8: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys8B: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",
        SessionKeys9: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys9B: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",
        SessionKeys10: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",
        SessionKeys10B: "(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)"
    }, Kje = {
        rpc: {},
        runtime: qje,
        types: {
            ...Wje,
            FullIdentification: "Exposure",
            IdentificationTuple: "(ValidatorId, FullIdentification)",
            MembershipProof: {
                session: "SessionIndex",
                trieNodes: "Vec<Bytes>",
                validatorCount: "ValidatorCount"
            },
            SessionIndex: "u32",
            ValidatorCount: "u32"
        }
    }, $je = {
        rpc: {},
        types: {
            Bid: {
                who: "AccountId",
                kind: "BidKind",
                value: "Balance"
            },
            BidKind: {
                _enum: {
                    Deposit: "Balance",
                    Vouch: "(AccountId, Balance)"
                }
            },
            SocietyJudgement: {
                _enum: [
                    "Rebid",
                    "Reject",
                    "Approve"
                ]
            },
            SocietyVote: {
                _enum: [
                    "Skeptic",
                    "Reject",
                    "Approve"
                ]
            },
            StrikeCount: "u32",
            VouchingStatus: {
                _enum: [
                    "Vouching",
                    "Banned"
                ]
            }
        }
    }, Xje = {
        StakingApi: [
            {
                methods: {
                    nominations_quota: {
                        description: "Returns the nominations quota for a nominator with a given balance.",
                        params: [
                            {
                                name: "balance",
                                type: "Balance"
                            }
                        ],
                        type: "u32"
                    }
                },
                version: 1
            }
        ]
    }, Gje = {
        Points: "u32",
        EraPoints: {
            total: "Points",
            individual: "Vec<Points>"
        }
    }, Zje = {
        CompactAssignments: "CompactAssignmentsWith16",
        CompactAssignmentsWith16: {
            votes1: "Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",
            votes2: "Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",
            votes3: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",
            votes4: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",
            votes5: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",
            votes6: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",
            votes7: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",
            votes8: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",
            votes9: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",
            votes10: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",
            votes11: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",
            votes12: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",
            votes13: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",
            votes14: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",
            votes15: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",
            votes16: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>"
        },
        CompactAssignmentsWith24: {
            votes1: "Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",
            votes2: "Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",
            votes3: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",
            votes4: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",
            votes5: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",
            votes6: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",
            votes7: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",
            votes8: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",
            votes9: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",
            votes10: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",
            votes11: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",
            votes12: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",
            votes13: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",
            votes14: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",
            votes15: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",
            votes16: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>",
            votes17: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 16], ValidatorIndexCompact)>",
            votes18: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 17], ValidatorIndexCompact)>",
            votes19: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 18], ValidatorIndexCompact)>",
            votes20: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 19], ValidatorIndexCompact)>",
            votes21: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 20], ValidatorIndexCompact)>",
            votes22: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 21], ValidatorIndexCompact)>",
            votes23: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 22], ValidatorIndexCompact)>",
            votes24: "Vec<(NominatorIndexCompact, [CompactScoreCompact; 23], ValidatorIndexCompact)>"
        },
        CompactAssignmentsTo265: "CompactAssignmentsWith16",
        CompactAssignmentsTo257: {
            votes1: "Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>",
            votes2: "Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>",
            votes3: "Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>",
            votes4: "Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>",
            votes5: "Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>",
            votes6: "Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>",
            votes7: "Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>",
            votes8: "Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>",
            votes9: "Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>",
            votes10: "Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>",
            votes11: "Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>",
            votes12: "Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>",
            votes13: "Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>",
            votes14: "Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>",
            votes15: "Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>",
            votes16: "Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>"
        },
        CompactScore: "(ValidatorIndex, OffchainAccuracy)",
        CompactScoreCompact: "(ValidatorIndexCompact, OffchainAccuracyCompact)",
        ElectionCompute: {
            _enum: [
                "OnChain",
                "Signed",
                "Unsigned"
            ]
        },
        ElectionPhase: {
            _enum: {
                Off: null,
                Signed: null,
                Unsigned: "(bool, BlockNumber)",
                Emergency: null
            }
        },
        ElectionResult: {
            compute: "ElectionCompute",
            slotStake: "Balance",
            electedStashes: "Vec<AccountId>",
            exposures: "Vec<(AccountId, Exposure)>"
        },
        ElectionResultToSpec10: {
            electedStashes: "Vec<AccountId>",
            exposures: "Vec<(AccountId, Exposure<AccountId, Balance>)>",
            compute: "ElectionCompute"
        },
        ElectionScore: "[u128; 3]",
        ElectionSize: {
            validators: "Compact<ValidatorIndex>",
            nominators: "Compact<NominatorIndex>"
        },
        ElectionStatus: {
            _enum: {
                Close: "Null",
                Open: "BlockNumber"
            }
        },
        ExtendedBalance: "u128",
        RawSolution: "RawSolutionWith16",
        RawSolutionWith16: {
            compact: "CompactAssignmentsWith16",
            score: "ElectionScore",
            round: "u32"
        },
        RawSolutionWith24: {
            compact: "CompactAssignmentsWith24",
            score: "ElectionScore",
            round: "u32"
        },
        RawSolutionTo265: "RawSolutionWith16",
        ReadySolution: {
            supports: "SolutionSupports",
            score: "ElectionScore",
            compute: "ElectionCompute"
        },
        RoundSnapshot: {
            voters: "Vec<(AccountId, VoteWeight, Vec<AccountId>)>",
            targets: "Vec<AccountId>"
        },
        SeatHolder: {
            who: "AccountId",
            stake: "Balance",
            deposit: "Balance"
        },
        SignedSubmission: {
            _fallback: "SignedSubmissionTo276",
            who: "AccountId",
            deposit: "Balance",
            solution: "RawSolution",
            reward: "Balance"
        },
        SignedSubmissionTo276: {
            who: "AccountId",
            deposit: "Balance",
            solution: "RawSolution"
        },
        SignedSubmissionOf: "SignedSubmission",
        SolutionOrSnapshotSize: {
            voters: "Compact<u32>",
            targets: "Compact<u32>"
        },
        SolutionSupport: {
            total: "ExtendedBalance",
            voters: "Vec<(AccountId, ExtendedBalance)>"
        },
        SolutionSupports: "Vec<(AccountId, SolutionSupport)>",
        Supports: "SolutionSupports",
        SubmissionIndicesOf: "BTreeMap<ElectionScore, u32>",
        Voter: {
            votes: "Vec<AccountId>",
            stake: "Balance",
            deposit: "Balance"
        },
        VoteWeight: "u64"
    }, Jje = {
        rpc: {},
        runtime: Xje,
        types: {
            ...Gje,
            ...Zje,
            ActiveEraInfo: {
                index: "EraIndex",
                start: "Option<Moment>"
            },
            EraIndex: "u32",
            EraRewardPoints: {
                total: "RewardPoint",
                individual: "BTreeMap<AccountId, RewardPoint>"
            },
            EraRewards: {
                total: "u32",
                rewards: "Vec<u32>"
            },
            Exposure: {
                total: "Compact<Balance>",
                own: "Compact<Balance>",
                others: "Vec<IndividualExposure>"
            },
            Forcing: {
                _enum: [
                    "NotForcing",
                    "ForceNew",
                    "ForceNone",
                    "ForceAlways"
                ]
            },
            IndividualExposure: {
                who: "AccountId",
                value: "Compact<Balance>"
            },
            KeyType: "AccountId",
            MomentOf: "Moment",
            Nominations: {
                targets: "Vec<AccountId>",
                submittedIn: "EraIndex",
                suppressed: "bool"
            },
            NominatorIndex: "u32",
            NominatorIndexCompact: "Compact<NominatorIndex>",
            OffchainAccuracy: "PerU16",
            OffchainAccuracyCompact: "Compact<OffchainAccuracy>",
            PhragmenScore: "[u128; 3]",
            Points: "u32",
            RewardDestination: {
                _enum: {
                    Staked: "Null",
                    Stash: "Null",
                    Controller: "Null",
                    Account: "AccountId",
                    None: "Null"
                }
            },
            RewardPoint: "u32",
            SlashJournalEntry: {
                who: "AccountId",
                amount: "Balance",
                ownSlash: "Balance"
            },
            SlashingSpansTo204: {
                spanIndex: "SpanIndex",
                lastStart: "EraIndex",
                prior: "Vec<EraIndex>"
            },
            SlashingSpans: {
                spanIndex: "SpanIndex",
                lastStart: "EraIndex",
                lastNonzeroSlash: "EraIndex",
                prior: "Vec<EraIndex>"
            },
            SpanIndex: "u32",
            SpanRecord: {
                slashed: "Balance",
                paidOut: "Balance"
            },
            StakingLedgerTo223: {
                stash: "AccountId",
                total: "Compact<Balance>",
                active: "Compact<Balance>",
                unlocking: "Vec<UnlockChunk>"
            },
            StakingLedgerTo240: {
                _fallback: "StakingLedgerTo223",
                stash: "AccountId",
                total: "Compact<Balance>",
                active: "Compact<Balance>",
                unlocking: "Vec<UnlockChunk>",
                lastReward: "Option<EraIndex>"
            },
            StakingLedger: {
                stash: "AccountId",
                total: "Compact<Balance>",
                active: "Compact<Balance>",
                unlocking: "Vec<UnlockChunk>",
                claimedRewards: "Vec<EraIndex>"
            },
            UnappliedSlashOther: "(AccountId, Balance)",
            UnappliedSlash: {
                validator: "AccountId",
                own: "Balance",
                others: "Vec<UnappliedSlashOther>",
                reporters: "Vec<AccountId>",
                payout: "Balance"
            },
            UnlockChunk: {
                value: "Compact<Balance>",
                era: "Compact<BlockNumber>"
            },
            ValidatorIndex: "u16",
            ValidatorIndexCompact: "Compact<ValidatorIndex>",
            ValidatorPrefs: "ValidatorPrefsWithBlocked",
            ValidatorPrefsWithCommission: {
                commission: "Compact<Perbill>"
            },
            ValidatorPrefsWithBlocked: {
                commission: "Compact<Perbill>",
                blocked: "bool"
            },
            ValidatorPrefsTo196: {
                validatorPayment: "Compact<Balance>"
            },
            ValidatorPrefsTo145: {
                unstakeThreshold: "Compact<u32>",
                validatorPayment: "Compact<Balance>"
            }
        }
    }, Yje = {
        ValidateStatement: [
            {
                methods: {
                    valdate_statement: {
                        description: "Validate the statement.",
                        params: [
                            {
                                name: "source",
                                type: "StatementStoreStatementSource"
                            },
                            {
                                name: "statement",
                                type: "SpStatementStoreStatement"
                            }
                        ],
                        type: "Result<StatementStoreValidStatement, StatementStoreInvalidStatement>"
                    }
                },
                version: 1
            }
        ]
    }, Qje = {
        rpc: {},
        runtime: Yje,
        types: {
            StatementStoreStatementSource: {
                _enum: [
                    "Chain",
                    "Network",
                    "Local"
                ]
            },
            StatementStoreValidStatement: {
                maxCount: "u32",
                maxSize: "u32"
            },
            StatementStoreInvalidStatement: {
                _enum: [
                    "BadProof",
                    "NoProof",
                    "InternalError"
                ]
            }
        }
    }, eqe = {
        rpc: {},
        types: {
            WeightToFeeCoefficient: {
                coeffInteger: "Balance",
                coeffFrac: "Perbill",
                negative: "bool",
                degree: "u8"
            }
        }
    }, tqe = {
        genSyncSpec: {
            description: "Returns the json-serialized chainspec running the node, with a sync state.",
            endpoint: "sync_state_genSyncSpec",
            params: [
                {
                    name: "raw",
                    type: "bool"
                }
            ],
            type: "Json"
        }
    }, nqe = {
        rpc: tqe,
        types: {}
    }, rqe = {
        accountNextIndex: {
            alias: [
                "account_nextIndex"
            ],
            description: "Retrieves the next accountIndex as available on the node",
            params: [
                {
                    name: "accountId",
                    type: "AccountId"
                }
            ],
            type: "Index"
        },
        addLogFilter: {
            description: "Adds the supplied directives to the current log filter",
            isUnsafe: !0,
            params: [
                {
                    name: "directives",
                    type: "Text"
                }
            ],
            type: "Null"
        },
        addReservedPeer: {
            description: "Adds a reserved peer",
            isUnsafe: !0,
            params: [
                {
                    name: "peer",
                    type: "Text"
                }
            ],
            type: "Text"
        },
        chain: {
            description: "Retrieves the chain",
            params: [],
            type: "Text"
        },
        chainType: {
            description: "Retrieves the chain type",
            params: [],
            type: "ChainType"
        },
        dryRun: {
            alias: [
                "system_dryRunAt"
            ],
            description: "Dry run an extrinsic at a given block",
            isUnsafe: !0,
            params: [
                {
                    name: "extrinsic",
                    type: "Bytes"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "ApplyExtrinsicResult"
        },
        health: {
            description: "Return health status of the node",
            noErrorLog: !0,
            params: [],
            type: "Health"
        },
        localListenAddresses: {
            description: "The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example",
            params: [],
            type: "Vec<Text>"
        },
        localPeerId: {
            description: "Returns the base58-encoded PeerId of the node",
            params: [],
            type: "Text"
        },
        name: {
            description: "Retrieves the node name",
            params: [],
            type: "Text"
        },
        networkState: {
            alias: [
                "system_unstable_networkState"
            ],
            description: "Returns current state of the network",
            isUnsafe: !0,
            params: [],
            type: "NetworkState"
        },
        nodeRoles: {
            description: "Returns the roles the node is running as",
            params: [],
            type: "Vec<NodeRole>"
        },
        peers: {
            description: "Returns the currently connected peers",
            isUnsafe: !0,
            params: [],
            type: "Vec<PeerInfo>"
        },
        properties: {
            description: "Get a custom set of properties as a JSON object, defined in the chain spec",
            params: [],
            type: "ChainProperties"
        },
        removeReservedPeer: {
            description: "Remove a reserved peer",
            isUnsafe: !0,
            params: [
                {
                    name: "peerId",
                    type: "Text"
                }
            ],
            type: "Text"
        },
        reservedPeers: {
            description: "Returns the list of reserved peers",
            params: [],
            type: "Vec<Text>"
        },
        resetLogFilter: {
            description: "Resets the log filter to Substrate defaults",
            isUnsafe: !0,
            params: [],
            type: "Null"
        },
        syncState: {
            description: "Returns the state of the syncing of the node",
            params: [],
            type: "SyncState"
        },
        version: {
            description: "Retrieves the version of the node",
            params: [],
            type: "Text"
        }
    }, sqe = {
        AccountNonceApi: [
            {
                methods: {
                    account_nonce: {
                        description: "The API to query account nonce (aka transaction index)",
                        params: [
                            {
                                name: "accountId",
                                type: "AccountId"
                            }
                        ],
                        type: "Index"
                    }
                },
                version: 1
            }
        ]
    }, iqe = {
        rpc: rqe,
        runtime: sqe,
        types: {
            AccountInfo: "AccountInfoWithTripleRefCount",
            AccountInfoWithRefCountU8: {
                nonce: "Index",
                refcount: "u8",
                data: "AccountData"
            },
            AccountInfoWithRefCount: {
                _fallback: "AccountInfoWithRefCountU8",
                nonce: "Index",
                refcount: "RefCount",
                data: "AccountData"
            },
            AccountInfoWithDualRefCount: {
                _fallback: "AccountInfoWithRefCount",
                nonce: "Index",
                consumers: "RefCount",
                providers: "RefCount",
                data: "AccountData"
            },
            AccountInfoWithProviders: "AccountInfoWithDualRefCount",
            AccountInfoWithTripleRefCount: {
                _fallback: "AccountInfoWithDualRefCount",
                nonce: "Index",
                consumers: "RefCount",
                providers: "RefCount",
                sufficients: "RefCount",
                data: "AccountData"
            },
            ApplyExtrinsicResult: "Result<DispatchOutcome, TransactionValidityError>",
            ApplyExtrinsicResultPre6: "Result<DispatchOutcomePre6, TransactionValidityError>",
            ArithmeticError: {
                _enum: [
                    "Underflow",
                    "Overflow",
                    "DivisionByZero"
                ]
            },
            BlockLength: {
                max: "PerDispatchClassU32"
            },
            BlockWeights: {
                baseBlock: "Weight",
                maxBlock: "Weight",
                perClass: "PerDispatchClassWeightsPerClass"
            },
            ChainProperties: "GenericChainProperties",
            ChainType: {
                _enum: {
                    Development: "Null",
                    Local: "Null",
                    Live: "Null",
                    Custom: "Text"
                }
            },
            ConsumedWeight: "PerDispatchClassWeight",
            DigestOf: "Digest",
            DispatchClass: {
                _enum: [
                    "Normal",
                    "Operational",
                    "Mandatory"
                ]
            },
            DispatchError: {
                _enum: {
                    Other: "Null",
                    CannotLookup: "Null",
                    BadOrigin: "Null",
                    Module: "DispatchErrorModule",
                    ConsumerRemaining: "Null",
                    NoProviders: "Null",
                    TooManyConsumers: "Null",
                    Token: "TokenError",
                    Arithmetic: "ArithmeticError",
                    Transactional: "TransactionalError",
                    Exhausted: "Null",
                    Corruption: "Null",
                    Unavailable: "Null"
                }
            },
            DispatchErrorPre6: {
                _enum: {
                    Other: "Null",
                    CannotLookup: "Null",
                    BadOrigin: "Null",
                    Module: "DispatchErrorModulePre6",
                    ConsumerRemaining: "Null",
                    NoProviders: "Null",
                    TooManyConsumers: "Null",
                    Token: "TokenError",
                    Arithmetic: "ArithmeticError",
                    Transactional: "TransactionalError"
                }
            },
            DispatchErrorPre6First: {
                _enum: {
                    Other: "Null",
                    CannotLookup: "Null",
                    BadOrigin: "Null",
                    Module: "DispatchErrorModulePre6",
                    ConsumerRemaining: "Null",
                    NoProviders: "Null",
                    Token: "TokenError",
                    Arithmetic: "ArithmeticError",
                    Transactional: "TransactionalError"
                }
            },
            DispatchErrorModuleU8: {
                index: "u8",
                error: "u8"
            },
            DispatchErrorModuleU8a: {
                index: "u8",
                error: "[u8; 4]"
            },
            DispatchErrorModule: "DispatchErrorModuleU8a",
            DispatchErrorModulePre6: "DispatchErrorModuleU8",
            DispatchErrorTo198: {
                module: "Option<u8>",
                error: "u8"
            },
            DispatchInfo: {
                weight: "Weight",
                class: "DispatchClass",
                paysFee: "Pays"
            },
            DispatchInfoTo190: {
                weight: "Weight",
                class: "DispatchClass"
            },
            DispatchInfoTo244: {
                weight: "Weight",
                class: "DispatchClass",
                paysFee: "bool"
            },
            DispatchOutcome: "Result<(), DispatchError>",
            DispatchOutcomePre6: "Result<(), DispatchErrorPre6>",
            DispatchResult: "Result<(), DispatchError>",
            DispatchResultOf: "DispatchResult",
            DispatchResultTo198: "Result<(), Text>",
            Event: "GenericEvent",
            EventId: "[u8; 2]",
            EventIndex: "u32",
            EventRecord: {
                phase: "Phase",
                event: "Event",
                topics: "Vec<Hash>"
            },
            Health: {
                peers: "u64",
                isSyncing: "bool",
                shouldHavePeers: "bool"
            },
            InvalidTransaction: {
                _enum: {
                    Call: "Null",
                    Payment: "Null",
                    Future: "Null",
                    Stale: "Null",
                    BadProof: "Null",
                    AncientBirthBlock: "Null",
                    ExhaustsResources: "Null",
                    Custom: "u8",
                    BadMandatory: "Null",
                    MandatoryDispatch: "Null",
                    BadSigner: "Null"
                }
            },
            Key: "Bytes",
            LastRuntimeUpgradeInfo: {
                specVersion: "Compact<u32>",
                specName: "Text"
            },
            NetworkState: {
                peerId: "Text",
                listenedAddresses: "Vec<Text>",
                externalAddresses: "Vec<Text>",
                connectedPeers: "HashMap<Text, Peer>",
                notConnectedPeers: "HashMap<Text, NotConnectedPeer>",
                averageDownloadPerSec: "u64",
                averageUploadPerSec: "u64",
                peerset: "NetworkStatePeerset"
            },
            NetworkStatePeerset: {
                messageQueue: "u64",
                nodes: "HashMap<Text, NetworkStatePeersetInfo>"
            },
            NetworkStatePeersetInfo: {
                connected: "bool",
                reputation: "i32"
            },
            NodeRole: {
                _enum: {
                    Full: "Null",
                    LightClient: "Null",
                    Authority: "Null",
                    UnknownRole: "u8"
                }
            },
            NotConnectedPeer: {
                knownAddresses: "Vec<Text>",
                latestPingTime: "Option<PeerPing>",
                versionString: "Option<Text>"
            },
            Peer: {
                enabled: "bool",
                endpoint: "PeerEndpoint",
                knownAddresses: "Vec<Text>",
                latestPingTime: "PeerPing",
                open: "bool",
                versionString: "Text"
            },
            PeerEndpoint: {
                listening: "PeerEndpointAddr"
            },
            PeerEndpointAddr: {
                _alias: {
                    localAddr: "local_addr",
                    sendBackAddr: "send_back_addr"
                },
                localAddr: "Text",
                sendBackAddr: "Text"
            },
            PeerPing: {
                nanos: "u64",
                secs: "u64"
            },
            PeerInfo: {
                peerId: "Text",
                roles: "Text",
                protocolVersion: "u32",
                bestHash: "Hash",
                bestNumber: "BlockNumber"
            },
            PerDispatchClassU32: {
                normal: "u32",
                operational: "u32",
                mandatory: "u32"
            },
            PerDispatchClassWeight: {
                normal: "Weight",
                operational: "Weight",
                mandatory: "Weight"
            },
            PerDispatchClassWeightsPerClass: {
                normal: "WeightPerClass",
                operational: "WeightPerClass",
                mandatory: "WeightPerClass"
            },
            Phase: {
                _enum: {
                    ApplyExtrinsic: "u32",
                    Finalization: "Null",
                    Initialization: "Null"
                }
            },
            RawOrigin: {
                _enum: {
                    Root: "Null",
                    Signed: "AccountId",
                    None: "Null"
                }
            },
            RefCount: "u32",
            RefCountTo259: "u8",
            SyncState: {
                startingBlock: "BlockNumber",
                currentBlock: "BlockNumber",
                highestBlock: "Option<BlockNumber>"
            },
            SystemOrigin: "RawOrigin",
            TokenError: {
                _enum: [
                    "NoFunds",
                    "WouldDie",
                    "BelowMinimum",
                    "CannotCreate",
                    "UnknownAsset",
                    "Frozen",
                    "Unsupported",
                    "Underflow",
                    "Overflow"
                ]
            },
            TransactionValidityError: {
                _enum: {
                    Invalid: "InvalidTransaction",
                    Unknown: "UnknownTransaction"
                }
            },
            TransactionalError: {
                _enum: [
                    "LimitReached",
                    "NoLayer"
                ]
            },
            UnknownTransaction: {
                _enum: {
                    CannotLookup: "Null",
                    NoUnsignedValidator: "Null",
                    Custom: "u8"
                }
            },
            WeightPerClass: {
                baseExtrinsic: "Weight",
                maxExtrinsic: "Option<Weight>",
                maxTotal: "Option<Weight>",
                reserved: "Option<Weight>"
            }
        }
    }, oqe = {
        rpc: {},
        types: {
            Bounty: {
                proposer: "AccountId",
                value: "Balance",
                fee: "Balance",
                curatorDeposit: "Balance",
                bond: "Balance",
                status: "BountyStatus"
            },
            BountyIndex: "u32",
            BountyStatus: {
                _enum: {
                    Proposed: "Null",
                    Approved: "Null",
                    Funded: "Null",
                    CuratorProposed: "BountyStatusCuratorProposed",
                    Active: "BountyStatusActive",
                    PendingPayout: "BountyStatusPendingPayout"
                }
            },
            BountyStatusActive: {
                curator: "AccountId",
                updateDue: "BlockNumber"
            },
            BountyStatusCuratorProposed: {
                curator: "AccountId"
            },
            BountyStatusPendingPayout: {
                curator: "AccountId",
                beneficiary: "AccountId",
                unlockAt: "BlockNumber"
            },
            OpenTip: {
                reason: "Hash",
                who: "AccountId",
                finder: "AccountId",
                deposit: "Balance",
                closes: "Option<BlockNumber>",
                tips: "Vec<OpenTipTip>",
                findersFee: "bool"
            },
            OpenTipTo225: {
                reason: "Hash",
                who: "AccountId",
                finder: "Option<OpenTipFinderTo225>",
                closes: "Option<BlockNumber>",
                tips: "Vec<OpenTipTip>"
            },
            OpenTipFinderTo225: "(AccountId, Balance)",
            OpenTipTip: "(AccountId, Balance)",
            TreasuryProposal: {
                proposer: "AccountId",
                value: "Balance",
                beneficiary: "AccountId",
                bond: "Balance"
            }
        }
    }, aqe = {
        rpc: {},
        types: {
            Multiplier: "Fixed128"
        }
    }, cqe = {
        TaggedTransactionQueue: [
            {
                methods: {
                    validate_transaction: {
                        description: "Validate the transaction.",
                        params: [
                            {
                                name: "source",
                                type: "TransactionSource"
                            },
                            {
                                name: "tx",
                                type: "Extrinsic"
                            },
                            {
                                name: "blockHash",
                                type: "BlockHash"
                            }
                        ],
                        type: "TransactionValidity"
                    }
                },
                version: 3
            },
            {
                methods: {
                    validate_transaction: {
                        description: "Validate the transaction.",
                        params: [
                            {
                                name: "source",
                                type: "TransactionSource"
                            },
                            {
                                name: "tx",
                                type: "Extrinsic"
                            }
                        ],
                        type: "TransactionValidity"
                    }
                },
                version: 2
            },
            {
                methods: {
                    validate_transaction: {
                        description: "Validate the transaction.",
                        params: [
                            {
                                name: "tx",
                                type: "Extrinsic"
                            }
                        ],
                        type: "TransactionValidity"
                    }
                },
                version: 1
            }
        ]
    }, lqe = {
        rpc: {},
        runtime: cqe,
        types: {
            TransactionSource: {
                _enum: [
                    "InBlock",
                    "Local",
                    "External"
                ]
            },
            TransactionValidity: "Result<ValidTransaction, TransactionValidityError>",
            ValidTransaction: {
                priority: "TransactionPriority",
                requires: "Vec<TransactionTag>",
                provides: "Vec<TransactionTag>",
                longevity: "TransactionLongevity",
                propagate: "bool"
            }
        }
    }, uqe = {
        rpc: {},
        types: {
            ClassId: "u32",
            InstanceId: "u32",
            DepositBalance: "Balance",
            DepositBalanceOf: "Balance",
            ClassDetails: {
                owner: "AccountId",
                issuer: "AccountId",
                admin: "AccountId",
                freezer: "AccountId",
                totalDeposit: "DepositBalance",
                freeHolding: "bool",
                instances: "u32",
                instanceMetadatas: "u32",
                attributes: "u32",
                isFrozen: "bool"
            },
            DestroyWitness: {
                instances: "Compact<u32>",
                instanceMetadatas: "Compact<u32>",
                attributes: "Compact<u32>"
            },
            InstanceDetails: {
                owner: "AccountId",
                approved: "Option<AccountId>",
                isFrozen: "bool",
                deposit: "DepositBalance"
            },
            ClassMetadata: {
                deposit: "DepositBalance",
                data: "Vec<u8>",
                isFrozen: "bool"
            },
            InstanceMetadata: {
                deposit: "DepositBalance",
                data: "Vec<u8>",
                isFrozen: "bool"
            }
        }
    }, dqe = {
        rpc: {},
        types: {
            Multisig: {
                when: "Timepoint",
                deposit: "Balance",
                depositor: "AccountId",
                approvals: "Vec<AccountId>"
            },
            Timepoint: {
                height: "BlockNumber",
                index: "u32"
            }
        }
    }, fqe = {
        rpc: {},
        types: {
            VestingInfo: {
                locked: "Balance",
                perBlock: "Balance",
                startingBlock: "BlockNumber"
            }
        }
    }, pqe = {
        rpc: {},
        types: {
            BlockAttestations: {
                receipt: "CandidateReceipt",
                valid: "Vec<AccountId>",
                invalid: "Vec<AccountId>"
            },
            IncludedBlocks: {
                actualNumber: "BlockNumber",
                session: "SessionIndex",
                randomSeed: "H256",
                activeParachains: "Vec<ParaId>",
                paraBlocks: "Vec<Hash>"
            },
            MoreAttestations: {}
        }
    }, hqe = {
        rpc: {},
        types: {
            BridgedBlockHash: "H256",
            BridgedBlockNumber: "BlockNumber",
            BridgedHeader: "Header",
            BridgeMessageId: "(LaneId, MessageNonce)",
            CallOrigin: {
                _enum: {
                    SourceRoot: "Null",
                    TargetAccount: "(AccountId, MultiSigner, MultiSignature)",
                    SourceAccount: "AccountId"
                }
            },
            ChainId: "[u8; 4]",
            DeliveredMessages: {
                begin: "MessageNonce",
                end: "MessageNonce",
                dispatchResults: "BitVec"
            },
            DispatchFeePayment: {
                _enum: [
                    "AtSourceChain",
                    "AtTargetChain"
                ]
            },
            InboundLaneData: {
                relayers: "Vec<UnrewardedRelayer>",
                lastConfirmedNonce: "MessageNonce"
            },
            InboundRelayer: "AccountId",
            InitializationData: {
                header: "Header",
                authorityList: "AuthorityList",
                setId: "SetId",
                isHalted: "bool"
            },
            LaneId: "[u8; 4]",
            MessageData: {
                payload: "Bytes",
                fee: "Balance"
            },
            MessagesDeliveryProofOf: {
                bridgedHeaderHash: "BlockHash",
                storageProof: "Vec<Bytes>",
                lane: "LaneId"
            },
            MessageKey: {
                laneId: "LaneId",
                nonce: "MessageNonce"
            },
            MessageNonce: "u64",
            MessagesProofOf: {
                bridgedHeaderHash: "BridgedBlockHash",
                storageProof: "Vec<Bytes>",
                lane: "LaneId",
                noncesStart: "MessageNonce",
                noncesEnd: "MessageNonce"
            },
            OperatingMode: {
                _enum: [
                    "Normal",
                    "RejectingOutboundMessages",
                    "Halted"
                ]
            },
            OutboundLaneData: {
                oldestUnprunedNonce: "MessageNonce",
                latestReceivedNonce: "MessageNonce",
                latestGeneratedNonce: "MessageNonce"
            },
            OutboundMessageFee: "Balance",
            OutboundPayload: {
                specVersion: "u32",
                weight: "Weight",
                origin: "CallOrigin",
                dispatchFeePayment: "DispatchFeePayment",
                call: "Bytes"
            },
            Parameter: "Null",
            RelayerId: "AccountId",
            UnrewardedRelayer: {
                relayer: "RelayerId",
                messages: "DeliveredMessages"
            },
            UnrewardedRelayersState: {
                unrewardedRelayer_Entries: "MessageNonce",
                messagesInOldestEntry: "MessageNonce",
                totalMessages: "MessageNonce"
            }
        }
    }, gqe = {
        rpc: {},
        types: {
            StatementKind: {
                _enum: [
                    "Regular",
                    "Saft"
                ]
            }
        }
    }, bqe = {
        rpc: {},
        types: {
            FundIndex: "u32",
            LastContribution: {
                _enum: {
                    Never: "Null",
                    PreEnding: "u32",
                    Ending: "BlockNumber"
                }
            },
            FundInfo: {
                depositor: "AccountId",
                verifier: "Option<MultiSigner>",
                deposit: "Balance",
                raised: "Balance",
                end: "BlockNumber",
                cap: "Balance",
                lastContribution: "LastContribution",
                firstPeriod: "LeasePeriod",
                lastPeriod: "LeasePeriod",
                trieIndex: "TrieIndex"
            },
            TrieIndex: "u32"
        }
    }, mqe = {
        AuraUnincludedSegmentApi: [
            {
                methods: {
                    can_build_upon: {
                        description: "Whether it is legal to extend the chain",
                        params: [
                            {
                                name: "includedHash",
                                type: "BlockHash"
                            },
                            {
                                name: "slot",
                                type: "Slot"
                            }
                        ],
                        type: "bool"
                    }
                },
                version: 1
            }
        ],
        CollectCollationInfo: [
            {
                methods: {
                    collect_collation_info: {
                        description: "Collect information about a collation.",
                        params: [
                            {
                                name: "header",
                                type: "Header"
                            }
                        ],
                        type: "CollationInfo"
                    }
                },
                version: 2
            },
            {
                methods: {
                    collect_collation_info: {
                        description: "Collect information about a collation.",
                        params: [],
                        type: "CollationInfoV1"
                    }
                },
                version: 1
            }
        ]
    }, yqe = {
        CollationInfo: {
            upwardMessages: "Vec<UpwardMessage>",
            horizontalMessages: "Vec<OutboundHrmpMessage>",
            newValidationCode: "Option<ValidationCode>",
            processedDownwardMessages: "u32",
            hrmpWatermark: "RelayBlockNumber",
            headData: "HeadData"
        },
        CollationInfoV1: {
            upwardMessages: "Vec<UpwardMessage>",
            horizontalMessages: "Vec<OutboundHrmpMessage>",
            newValidationCode: "Option<ValidationCode>",
            processedDownwardMessages: "u32",
            hrmpWatermark: "RelayBlockNumber"
        },
        ConfigData: {
            maxIndividual: "Weight"
        },
        MessageId: "[u8; 32]",
        OverweightIndex: "u64",
        PageCounter: "u32",
        PageIndexData: {
            beginUsed: "PageCounter",
            endUsed: "PageCounter",
            overweightCount: "OverweightIndex"
        }
    }, wqe = {
        rpc: {},
        runtime: mqe,
        types: yqe
    }, Xw = {
        methods: {
            best_finalized: {
                description: "Returns number and hash of the best finalized header known to the bridge module.",
                params: [],
                type: "(BlockNumber, Hash)"
            }
        },
        version: 1
    }, _qe = {
        KusamaFinalityApi: [
            Xw
        ],
        PolkadotFinalityApi: [
            Xw
        ],
        RococoFinalityApi: [
            Xw
        ],
        WestendFinalityApi: [
            Xw
        ]
    }, xqe = {
        rpc: {},
        runtime: _qe,
        types: {}
    }, vqe = {
        HrmpChannel: {
            maxCapacity: "u32",
            maxTotalSize: "u32",
            maxMessageSize: "u32",
            msgCount: "u32",
            totalSize: "u32",
            mqcHead: "Option<Hash>",
            senderDeposit: "Balance",
            recipientDeposit: "Balance"
        },
        HrmpChannelId: {
            sender: "u32",
            receiver: "u32"
        },
        HrmpOpenChannelRequest: {
            confirmed: "bool",
            age: "SessionIndex",
            senderDeposit: "Balance",
            maxMessageSize: "u32",
            maxCapacity: "u32",
            maxTotalSize: "u32"
        }
    }, Sa = {
        assumed_validation_data: {
            description: "Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                },
                {
                    name: "hash",
                    type: "Hash"
                }
            ],
            type: "Option<(PersistedValidationData, ValidationCodeHash)>"
        },
        availability_cores: {
            description: "Yields information on all availability cores as relevant to the child block.",
            params: [],
            type: "Vec<CoreState>"
        },
        candidate_events: {
            description: "Get a vector of events concerning candidates that occurred within a block.",
            params: [],
            type: "Vec<CandidateEvent>"
        },
        candidate_pending_availability: {
            description: "Get the receipt of a candidate pending availability.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                }
            ],
            type: "Option<CommittedCandidateReceipt>"
        },
        check_validation_outputs: {
            description: "Checks if the given validation outputs pass the acceptance criteria.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                },
                {
                    name: "outputs",
                    type: "CandidateCommitments"
                }
            ],
            type: "bool"
        },
        dmq_contents: {
            description: "Get all the pending inbound messages in the downward message queue for a para.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                }
            ],
            type: "Vec<InboundDownwardMessage>"
        },
        inbound_hrmp_channels_contents: {
            description: "Get the contents of all channels addressed to the given recipient.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                }
            ],
            type: "Vec<InboundHrmpMessage>"
        },
        on_chain_votes: {
            description: "Scrape dispute relevant from on-chain, backing votes and resolved disputes.",
            params: [],
            type: "Option<ScrapedOnChainVotes>"
        },
        persisted_validation_data: {
            description: "Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                },
                {
                    name: "assumption",
                    type: "OccupiedCoreAssumption"
                }
            ],
            type: "Option<PersistedValidationData>"
        },
        session_index_for_child: {
            description: "Returns the session index expected at a child of the block.",
            params: [],
            type: "SessionIndex"
        },
        validation_code: {
            description: "Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                },
                {
                    name: "assumption",
                    type: "OccupiedCoreAssumption"
                }
            ],
            type: "Option<ValidationCode>"
        },
        validation_code_by_hash: {
            description: "Get the validation code from its hash.",
            params: [
                {
                    name: "hash",
                    type: "ValidationCodeHash"
                }
            ],
            type: "Option<ValidationCode>"
        },
        validator_groups: {
            description: "Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state  this is invoked on",
            params: [],
            type: "(Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo)"
        },
        validators: {
            description: "Get the current validators.",
            params: [],
            type: "Vec<ValidatorId>"
        }
    }, cc = {
        pvfs_require_precheck: {
            description: "Returns code hashes of PVFs that require pre-checking by validators in the active set.",
            params: [],
            type: "Vec<ValidationCodeHash>"
        },
        session_info: {
            description: "Get the session info for the given session, if stored.",
            params: [
                {
                    name: "index",
                    type: "SessionIndex"
                }
            ],
            type: "Option<SessionInfo>"
        },
        submit_pvf_check_statement: {
            description: "Submits a PVF pre-checking statement into the transaction pool.",
            params: [
                {
                    name: "stmt",
                    type: "PvfCheckStatement"
                },
                {
                    name: "signature",
                    type: "ValidatorSignature"
                }
            ],
            type: "Null"
        },
        validation_code_hash: {
            description: "Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                },
                {
                    name: "assumption",
                    type: "OccupiedCoreAssumption"
                }
            ],
            type: "Option<ValidationCodeHash>"
        }
    }, dl = {
        disputes: {
            description: "Returns all onchain disputes.",
            params: [],
            type: "Vec<(SessionIndex, CandidateHash, DisputeState)>"
        }
    }, ju = {
        session_executor_params: {
            description: "Returns execution parameters for the session.",
            params: [
                {
                    name: "sessionIndex",
                    type: "SessionIndex"
                }
            ],
            type: "Option<ExecutorParams>"
        }
    }, af = {
        key_ownership_proof: {
            description: "Returns a merkle proof of a validator session key",
            params: [
                {
                    name: "validatorId",
                    type: "ValidatorId"
                }
            ],
            type: "Option<OpaqueKeyOwnershipProof>"
        },
        submit_report_dispute_lost: {
            description: "Submit an unsigned extrinsic to slash validators who lost a dispute about a candidate of a past session",
            params: [
                {
                    name: "disputeProof",
                    type: "DisputeProof"
                },
                {
                    name: "keyOwnershipProof",
                    type: "OpaqueKeyOwnershipProof"
                }
            ],
            type: "Option<Null>"
        },
        unapplied_slashes: {
            description: "Returns a list of validators that lost a past session dispute and need to be slashed",
            params: [],
            type: "Vec<(SessionIndex, CandidateHash, PendingSlashes)>"
        }
    }, xh = {
        minimum_backing_votes: {
            description: "Get the minimum number of backing votes for a parachain candidate. This is a staging method! Do not use on production runtimes!",
            params: [],
            type: "u32"
        }
    }, Vb = {
        async_backing_params: {
            description: "Returns candidate's acceptance limitations for asynchronous backing for a relay parent",
            params: [],
            type: "AsyncBackingParams"
        },
        para_backing_state: {
            description: "Returns the state of parachain backing for a given para",
            params: [
                {
                    name: "paraId",
                    type: "ParaId"
                }
            ],
            type: "Option<BackingState>"
        }
    }, Gw = {
        disabled_validators: {
            description: "Returns a list of all disabled validators at the given block",
            params: [],
            type: "ValidatorIndex"
        }
    }, SS = {
        node_features: {
            description: "Get node features. This is a staging method! Do not use on production runtimes!",
            params: [],
            type: "NodeFeatures"
        }
    }, bD = {
        approval_voting_params: {
            description: "Approval voting configuration parameters",
            params: [],
            type: "ApprovalVotingParams"
        }
    }, Sqe = {
        claim_queue: {
            description: "Claim queue",
            params: [],
            type: "BTreeMap<CoreIndex, Vec<u32>>"
        }
    }, kqe = {
        ParachainHost: [
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh,
                    ...Vb,
                    ...Gw,
                    ...SS,
                    ...bD,
                    ...Sqe
                },
                version: 11
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh,
                    ...Vb,
                    ...Gw,
                    ...SS,
                    ...bD
                },
                version: 10
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh,
                    ...Vb,
                    ...Gw,
                    ...SS
                },
                version: 9
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh,
                    ...Vb,
                    ...Gw
                },
                version: 8
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh,
                    ...Vb
                },
                version: 7
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af,
                    ...xh
                },
                version: 6
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju,
                    ...af
                },
                version: 5
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl,
                    ...ju
                },
                version: 4
            },
            {
                methods: {
                    ...Sa,
                    ...cc,
                    ...dl
                },
                version: 3
            },
            {
                methods: {
                    ...Sa,
                    ...cc
                },
                version: 2
            },
            {
                methods: {
                    session_info: {
                        description: "Get the session info for the given session, if stored.",
                        params: [
                            {
                                name: "index",
                                type: "SessionIndex"
                            }
                        ],
                        type: "Option<OldV1SessionInfo>"
                    },
                    ...Sa
                },
                version: 1
            }
        ]
    }, mD = {
        _enum: [
            "ZeroZero",
            "ZeroOne",
            "ZeroTwo",
            "ZeroThree",
            "OneOne",
            "OneTwo",
            "OneThree",
            "TwoTwo",
            "TwoThree",
            "ThreeThree"
        ]
    }, yD = {
        _enum: [
            "ZeroZero",
            "ZeroOne",
            "ZeroTwo",
            "ZeroThree",
            "ZeroFour",
            "ZeroFive",
            "ZeroSix",
            "ZeroSeven",
            "OneOne",
            "OneTwo",
            "OneThree",
            "OneFour",
            "OneFive",
            "OneSix",
            "OneSeven",
            "TwoTwo",
            "TwoThree",
            "TwoFour",
            "TwoFive",
            "TwoSix",
            "TwoSeven",
            "ThreeThree",
            "ThreeFour",
            "ThreeFive",
            "ThreeSix",
            "ThreeSeven",
            "FourFour",
            "FourFive",
            "FourSix",
            "FourSeven",
            "FiveFive",
            "FiveSix",
            "FiveSeven",
            "SixSix",
            "SixSeven",
            "SevenSeven"
        ]
    }, Tqe = {
        Bidder: {
            _enum: {
                New: "NewBidder",
                Existing: "ParaId"
            }
        },
        IncomingParachain: {
            _enum: {
                Unset: "NewBidder",
                Fixed: "IncomingParachainFixed",
                Deploy: "IncomingParachainDeploy"
            }
        },
        IncomingParachainDeploy: {
            code: "ValidationCode",
            initialHeadData: "HeadData"
        },
        IncomingParachainFixed: {
            codeHash: "Hash",
            codeSize: "u32",
            initialHeadData: "HeadData"
        },
        NewBidder: {
            who: "AccountId",
            sub: "SubId"
        },
        SubId: "u32"
    }, Cqe = {
        ...Tqe,
        AuctionIndex: "u32",
        LeasePeriod: "BlockNumber",
        LeasePeriodOf: "BlockNumber",
        SlotRange10: mD,
        SlotRange: yD,
        WinningData10: `[WinningDataEntry; ${mD._enum.length}]`,
        WinningData: `[WinningDataEntry; ${yD._enum.length}]`,
        WinningDataEntry: "Option<(AccountId, ParaId, BalanceOf)>",
        WinnersData10: "Vec<WinnersDataTuple10>",
        WinnersData: "Vec<WinnersDataTuple>",
        WinnersDataTuple10: "(AccountId, ParaId, BalanceOf, SlotRange10)",
        WinnersDataTuple: "(AccountId, ParaId, BalanceOf, SlotRange)"
    }, Eqe = {
        ParachainProposal: {
            proposer: "AccountId",
            genesisHead: "HeadData",
            validators: "Vec<ValidatorId>",
            name: "Bytes",
            balance: "Balance"
        },
        RegisteredParachainInfo: {
            validators: "Vec<ValidatorId>",
            proposer: "AccountId"
        }
    }, Iqe = {
        ServiceQuality: {
            _enum: [
                "Ordered",
                "Fast"
            ]
        }
    }, Aqe = {
        DisputeLocation: {
            _enum: [
                "Local",
                "Remote"
            ]
        },
        DisputeResult: {
            _enum: [
                "Valid",
                "Invalid"
            ]
        },
        DisputeState: {
            validatorsFor: "BitVec",
            validatorsAgainst: "BitVec",
            start: "BlockNumber",
            concludedAt: "Option<BlockNumber>"
        },
        DisputeStatement: {
            _enum: {
                Valid: "ValidDisputeStatementKind",
                Invalid: "InvalidDisputeStatementKind"
            }
        },
        DisputeStatementSet: {
            candidateHash: "CandidateHash",
            session: "SessionIndex",
            statements: "Vec<(DisputeStatement, ParaValidatorIndex, ValidatorSignature)>"
        },
        ExecutorParam: {
            _enum: {
                Phantom: "Null",
                MaxMemoryPages: "u32",
                StackLogicalMax: "u32",
                StackNativeMax: "u32",
                PrecheckingMaxMemory: "u64",
                PvfPrepTimeout: "(PvfPrepTimeoutKind, u64)",
                PvfExecTimeout: "(PvfExecTimeoutKind, u64)"
            }
        },
        ExecutorParamsHash: "Hash",
        ExecutorParams: "Vec<ExecutorParam>",
        ExplicitDisputeStatement: {
            valid: "bool",
            candidateHash: "CandidateHash",
            session: "SessionIndex"
        },
        InvalidDisputeStatementKind: {
            _enum: [
                "Explicit"
            ]
        },
        MultiDisputeStatementSet: "Vec<DisputeStatementSet>",
        PvfExecTimeoutKind: {
            _enum: [
                "Backing",
                "Approval"
            ]
        },
        PvfPrepTimeoutKind: {
            _enum: [
                "Precheck",
                "Lenient"
            ]
        },
        ValidDisputeStatementKind: {
            _enum: {
                Explicit: "Null",
                BackingSeconded: "Hash",
                BackingValid: "Hash",
                ApprovalChecking: "Null"
            }
        }
    }, Pqe = {
        rpc: {},
        runtime: kqe,
        types: {
            ...Iqe,
            ...Aqe,
            ...vqe,
            ...Eqe,
            ...Cqe,
            AbridgedCandidateReceipt: {
                parachainIndex: "ParaId",
                relayParent: "Hash",
                headData: "HeadData",
                collator: "CollatorId",
                signature: "CollatorSignature",
                povBlockHash: "Hash",
                commitments: "CandidateCommitments"
            },
            AbridgedHostConfiguration: {
                maxCodeSize: "u32",
                maxHeadDataSize: "u32",
                maxUpwardQueueCount: "u32",
                maxUpwardQueueSize: "u32",
                maxUpwardMessageSize: "u32",
                maxUpwardMessageNumPerCandidate: "u32",
                hrmpMaxMessageNumPerCandidate: "u32",
                validationUpgradeFrequency: "BlockNumber",
                validationUpgradeDelay: "BlockNumber"
            },
            AbridgedHrmpChannel: {
                maxCapacity: "u32",
                maxTotalSize: "u32",
                maxMessageSize: "u32",
                msgCount: "u32",
                totalSize: "u32",
                mqcHead: "Option<Hash>"
            },
            ApprovalVotingParams: {
                maxApprovalCoalesceCount: "u32"
            },
            AssignmentId: "AccountId",
            AssignmentKind: {
                _enum: {
                    Parachain: "Null",
                    Parathread: "(CollatorId, u32)"
                }
            },
            AsyncBackingParams: {
                maxCandidateDepth: "u32",
                allowedAncestryLen: "u32"
            },
            AttestedCandidate: {
                candidate: "AbridgedCandidateReceipt",
                validityVotes: "Vec<ValidityAttestation>",
                validatorIndices: "BitVec"
            },
            AuthorityDiscoveryId: "AccountId",
            AvailabilityBitfield: "BitVec",
            AvailabilityBitfieldRecord: {
                bitfield: "AvailabilityBitfield",
                submittedTt: "BlockNumber"
            },
            BackedCandidate: {
                candidate: "CommittedCandidateReceipt",
                validityVotes: "Vec<ValidityAttestation>",
                validatorIndices: "BitVec"
            },
            BackingState: {
                constraints: "Constraints",
                pendingAvailability: "Vec<CandidatePendingAvailability>"
            },
            BufferedSessionChange: {
                applyAt: "BlockNumber",
                validators: "Vec<ValidatorId>",
                queued: "Vec<ValidatorId>",
                sessionIndex: "SessionIndex"
            },
            CandidateCommitments: {
                upwardMessages: "Vec<UpwardMessage>",
                horizontalMessages: "Vec<OutboundHrmpMessage>",
                newValidationCode: "Option<ValidationCode>",
                headData: "HeadData",
                processedDownwardMessages: "u32",
                hrmpWatermark: "BlockNumber"
            },
            CandidateDescriptor: {
                paraId: "ParaId",
                relayParent: "RelayChainHash",
                collatorId: "CollatorId",
                persistedValidationDataHash: "Hash",
                povHash: "Hash",
                erasureRoot: "Hash",
                signature: "CollatorSignature",
                paraHead: "Hash",
                validationCodeHash: "ValidationCodeHash"
            },
            CandidateEvent: {
                _enum: {
                    CandidateBacked: "(CandidateReceipt, HeadData, CoreIndex, GroupIndex)",
                    CandidateIncluded: "(CandidateReceipt, HeadData, CoreIndex, GroupIndex)",
                    CandidateTimedOut: "(CandidateReceipt, HeadData, CoreIndex)"
                }
            },
            CandidateHash: "Hash",
            CandidateInfo: {
                who: "AccountId",
                deposit: "Balance"
            },
            CandidatePendingAvailability: {
                core: "CoreIndex",
                hash: "CandidateHash",
                descriptor: "CandidateDescriptor",
                availabilityVotes: "BitVec",
                backers: "BitVec",
                relayParentNumber: "BlockNumber",
                backedInNumber: "BlockNumber",
                backingGroup: "GroupIndex"
            },
            CandidateReceipt: {
                descriptor: "CandidateDescriptor",
                commitmentsHash: "Hash"
            },
            GlobalValidationData: {
                maxCodeSize: "u32",
                maxHeadDataSize: "u32",
                blockNumber: "BlockNumber"
            },
            CollatorId: "H256",
            CollatorSignature: "Signature",
            CommittedCandidateReceipt: {
                descriptor: "CandidateDescriptor",
                commitments: "CandidateCommitments"
            },
            Constraints: {
                minRelayParentNumber: "BlockNumber",
                maxPovSize: "u32",
                maxCodeSize: "u32",
                umpRemaining: "u32",
                umpRemainingBytes: "u32",
                maxUmpNumPerCandidate: "u32",
                dmpRemainingMessages: "Vec<BlockNumber>",
                hrmpInbound: "InboundHrmpLimitations",
                hrmpChannelsOut: "HashMap<ParaId, OutboundHrmpChannelLimitations>",
                maxHrmpNumPerCandidate: "u32",
                requiredParent: "HeadData",
                validationCodeHash: "ValidationCodeHash",
                upgradeRestriction: "Option<UpgradeRestriction>",
                futureValidationCode: "Option<(BlockNumber, ValidationCodeHash)>"
            },
            CoreAssignment: {
                core: "CoreIndex",
                paraId: "ParaId",
                kind: "AssignmentKind",
                groupIdx: "GroupIndex"
            },
            CoreIndex: "u32",
            CoreOccupied: {
                _enum: {
                    Parathread: "ParathreadEntry",
                    Parachain: "Null"
                }
            },
            CoreState: {
                _enum: {
                    Occupied: "OccupiedCore",
                    Scheduled: "ScheduledCore",
                    Free: "Null"
                }
            },
            DisputeProof: {
                timeSlot: "DisputesTimeSlot",
                kind: "SlashingOffenceKind",
                validatorIndex: "ValidatorIndex",
                validatorId: "ValidatorId"
            },
            DisputesTimeSlot: {
                sessionIndex: "SessionIndex",
                candidateHash: "CandidateHash"
            },
            DoubleVoteReport: {
                identity: "ValidatorId",
                first: "(Statement, ValidatorSignature)",
                second: "(Statement, ValidatorSignature)",
                proof: "MembershipProof",
                signingContext: "SigningContext"
            },
            DownwardMessage: "Bytes",
            GroupIndex: "u32",
            GroupRotationInfo: {
                sessionStartBlock: "BlockNumber",
                groupRotationFrequency: "BlockNumber",
                now: "BlockNumber"
            },
            GlobalValidationSchedule: {
                maxCodeSize: "u32",
                maxHeadDataSize: "u32",
                blockNumber: "BlockNumber"
            },
            HeadData: "Bytes",
            HostConfiguration: {
                maxCodeSize: "u32",
                maxHeadDataSize: "u32",
                maxUpwardQueueCount: "u32",
                maxUpwardQueueSize: "u32",
                maxUpwardMessageSize: "u32",
                maxUpwardMessageNumPerCandidate: "u32",
                hrmpMaxMessageNumPerCandidate: "u32",
                validationUpgradeFrequency: "BlockNumber",
                validationUpgradeDelay: "BlockNumber",
                maxPovSize: "u32",
                maxDownwardMessageSize: "u32",
                preferredDispatchableUpwardMessagesStepWeight: "Weight",
                hrmpMaxParachainOutboundChannels: "u32",
                hrmpMaxParathreadOutboundChannels: "u32",
                hrmpOpenRequestTtl: "u32",
                hrmpSenderDeposit: "Balance",
                hrmpRecipientDeposit: "Balance",
                hrmpChannelMaxCapacity: "u32",
                hrmpChannelMaxTotalSize: "u32",
                hrmpMaxParachainInboundChannels: "u32",
                hrmpMaxParathreadInboundChannels: "u32",
                hrmpChannelMaxMessageSize: "u32",
                codeRetentionPeriod: "BlockNumber",
                parathreadCores: "u32",
                parathreadRetries: "u32",
                groupRotationFrequency: "BlockNumber",
                chainAvailabilityPeriod: "BlockNumber",
                threadAvailabilityPeriod: "BlockNumber",
                schedulingLookahead: "u32",
                maxValidatorsPerCore: "Option<u32>",
                maxValidators: "Option<u32>",
                disputePeriod: "SessionIndex",
                disputePostConclusionAcceptancePeriod: "BlockNumber",
                disputeMaxSpamSlots: "u32",
                disputeConclusionByTimeOutPeriod: "BlockNumber",
                noShowSlots: "u32",
                nDelayTranches: "u32",
                zerothDelayTrancheWidth: "u32",
                neededApprovals: "u32",
                relayVrfModuloSamples: "u32"
            },
            InboundDownwardMessage: {
                pubSentAt: "BlockNumber",
                pubMsg: "DownwardMessage"
            },
            InboundHrmpMessage: {
                sentAt: "BlockNumber",
                data: "Bytes"
            },
            InboundHrmpLimitations: {
                validWatermarks: "Vec<BlockNumber>"
            },
            InboundHrmpMessages: "Vec<InboundHrmpMessage>",
            LocalValidationData: {
                parentHead: "HeadData",
                balance: "Balance",
                codeUpgradeAllowed: "Option<BlockNumber>"
            },
            MessageIngestionType: {
                downwardMessages: "Vec<InboundDownwardMessage>",
                horizontalMessages: "BTreeMap<ParaId, InboundHrmpMessages>"
            },
            MessageQueueChain: "RelayChainHash",
            NodeFeatures: "BitVec",
            OccupiedCore: {
                nextUpOnAvailable: "Option<ScheduledCore>",
                occupiedSince: "BlockNumber",
                timeOutAt: "BlockNumber",
                nextUpOnTimeOut: "Option<ScheduledCore>",
                availability: "BitVec",
                groupResponsible: "GroupIndex",
                candidateHash: "CandidateHash",
                candidateDescriptor: "CandidateDescriptor"
            },
            OccupiedCoreAssumption: {
                _enum: [
                    "Included,",
                    "TimedOut",
                    "Free"
                ]
            },
            OutboundHrmpChannelLimitations: {
                bytesRemaining: "u32",
                messagesRemaining: "u32"
            },
            OutboundHrmpMessage: {
                recipient: "u32",
                data: "Bytes"
            },
            PendingSlashes: {
                _alias: {
                    slashKeys: "keys"
                },
                slashKeys: "BTreeMap<ValidatorIndex, ValidatorId>",
                kind: "SlashingOffenceKind"
            },
            ParachainDispatchOrigin: {
                _enum: [
                    "Signed",
                    "Parachain",
                    "Root"
                ]
            },
            ParachainInherentData: {
                validationData: "PersistedValidationData",
                relayChainState: "StorageProof",
                downwardMessages: "Vec<InboundDownwardMessage>",
                horizontalMessages: "BTreeMap<ParaId, VecInboundHrmpMessage>"
            },
            ParachainsInherentData: {
                bitfields: "SignedAvailabilityBitfields",
                backedCandidates: "Vec<BackedCandidate>",
                disputes: "MultiDisputeStatementSet",
                parentHeader: "Header"
            },
            ParaGenesisArgs: {
                genesisHead: "Bytes",
                validationCode: "Bytes",
                parachain: "bool"
            },
            ParaId: "u32",
            ParaInfo: {
                manager: "AccountId",
                deposit: "Balance",
                locked: "bool"
            },
            ParaLifecycle: {
                _enum: [
                    "Onboarding",
                    "Parathread",
                    "Parachain",
                    "UpgradingToParachain",
                    "DowngradingToParathread",
                    "OutgoingParathread",
                    "OutgoingParachain"
                ]
            },
            ParaPastCodeMeta: {
                upgradeTimes: "Vec<ReplacementTimes>",
                lastPruned: "Option<BlockNumber>"
            },
            ParaScheduling: {
                _enum: [
                    "Always",
                    "Dynamic"
                ]
            },
            ParathreadClaim: "(ParaId, CollatorId)",
            ParathreadClaimQueue: {
                queue: "Vec<QueuedParathread>",
                nextCoreOffset: "u32"
            },
            ParathreadEntry: {
                claim: "ParathreadClaim",
                retries: "u32"
            },
            ParaValidatorIndex: "u32",
            PersistedValidationData: {
                parentHead: "HeadData",
                relayParentNumber: "RelayChainBlockNumber",
                relayParentStorageRoot: "Hash",
                maxPovSize: "u32"
            },
            PvfCheckStatement: {
                accept: "bool",
                subject: "ValidationCodeHash",
                sessionIndex: "SessionIndex",
                validatorIndex: "ParaValidatorIndex"
            },
            QueuedParathread: {
                claim: "ParathreadEntry",
                coreOffset: "u32"
            },
            RelayBlockNumber: "u32",
            RelayChainBlockNumber: "RelayBlockNumber",
            RelayHash: "Hash",
            RelayChainHash: "RelayHash",
            Remark: "[u8; 32]",
            ReplacementTimes: {
                expectedAt: "BlockNumber",
                activatedAt: "BlockNumber"
            },
            Retriable: {
                _enum: {
                    Never: "Null",
                    WithRetries: "u32"
                }
            },
            ScheduledCore: {
                paraId: "ParaId",
                collator: "Option<CollatorId>"
            },
            Scheduling: {
                _enum: [
                    "Always",
                    "Dynamic"
                ]
            },
            ScrapedOnChainVotes: {
                session: "SessionIndex",
                backingValidatorsPerCandidate: "Vec<(CandidateReceipt, Vec<(ParaValidatorIndex, ValidityAttestation)>)>",
                disputes: "MultiDisputeStatementSet"
            },
            SessionInfo: {
                activeValidatorIndices: "Vec<ParaValidatorIndex>",
                randomSeed: "[u8; 32]",
                disputePeriod: "SessionIndex",
                validators: "Vec<ValidatorId>",
                discoveryKeys: "Vec<AuthorityDiscoveryId>",
                assignmentKeys: "Vec<AssignmentId>",
                validatorGroups: "Vec<Vec<ValidatorIndex>>",
                nCores: "u32",
                zerothDelayTrancheWidth: "u32",
                relayVrfModuloSamples: "u32",
                nDelayTranches: "u32",
                noShowSlots: "u32",
                neededApprovals: "u32"
            },
            OldV1SessionInfo: {
                validators: "Vec<ValidatorId>",
                discoveryKeys: "Vec<AuthorityDiscoveryId>",
                assignmentKeys: "Vec<AssignmentId>",
                validatorGroups: "Vec<Vec<ParaValidatorIndex>>",
                nCores: "u32",
                zerothDelayTrancheWidth: "u32",
                relayVrfModuloSamples: "u32",
                nDelayTranches: "u32",
                noShowSlots: "u32",
                neededApprovals: "u32"
            },
            SessionInfoValidatorGroup: "Vec<ParaValidatorIndex>",
            SignedAvailabilityBitfield: {
                payload: "BitVec",
                validatorIndex: "ParaValidatorIndex",
                signature: "ValidatorSignature"
            },
            SignedAvailabilityBitfields: "Vec<SignedAvailabilityBitfield>",
            SigningContext: {
                sessionIndex: "SessionIndex",
                parentHash: "Hash"
            },
            SlashingOffenceKind: {
                _enum: [
                    "ForInvalid",
                    "AgainstValid"
                ]
            },
            Statement: {
                _enum: {
                    Never: "Null",
                    Candidate: "Hash",
                    Valid: "Hash",
                    Invalid: "Hash"
                }
            },
            TransientValidationData: {
                maxCodeSize: "u32",
                maxHeadDataSize: "u32",
                balance: "Balance",
                codeUpgradeAllowed: "Option<BlockNumber>",
                dmqLength: "u32"
            },
            UpgradeGoAhead: {
                _enum: [
                    "Abort",
                    "GoAhead"
                ]
            },
            UpgradeRestriction: {
                _enum: [
                    "Present"
                ]
            },
            UpwardMessage: "Bytes",
            ValidationFunctionParams: {
                maxCodeSize: "u32",
                relayChainHeight: "RelayChainBlockNumber",
                codeUpgradeAllowed: "Option<RelayChainBlockNumber>"
            },
            ValidationCode: "Bytes",
            ValidationCodeHash: "Hash",
            ValidationData: {
                persisted: "PersistedValidationData",
                transient: "TransientValidationData"
            },
            ValidationDataType: {
                validationData: "ValidationData",
                relayChainState: "Vec<Bytes>"
            },
            ValidatorSignature: "Signature",
            ValidityAttestation: {
                _enum: {
                    Never: "Null",
                    Implicit: "ValidatorSignature",
                    Explicit: "ValidatorSignature"
                }
            },
            MessagingStateSnapshot: {
                relayDispatchQueueSize: "(u32, u32)",
                egressChannels: "Vec<MessagingStateSnapshotEgressEntry>"
            },
            MessagingStateSnapshotEgressEntry: "(ParaId, AbridgedHrmpChannel)",
            SystemInherentData: "ParachainInherentData",
            VecInboundHrmpMessage: "Vec<InboundHrmpMessage>"
        }
    }, Oqe = {
        rpc: {},
        types: {
            Approvals: "[bool; 4]"
        }
    }, Mqe = {
        rpc: {},
        types: {
            AccountStatus: {
                validity: "AccountValidity",
                freeBalance: "Balance",
                lockedBalance: "Balance",
                signature: "Vec<u8>",
                vat: "Permill"
            },
            AccountValidity: {
                _enum: [
                    "Invalid",
                    "Initiated",
                    "Pending",
                    "ValidLow",
                    "ValidHigh",
                    "Completed"
                ]
            }
        }
    }, Rqe = {
        DryRunApi: [
            {
                methods: {
                    dry_run_call: {
                        description: "Dry run call",
                        params: [
                            {
                                name: "origin",
                                type: "OriginCaller"
                            },
                            {
                                name: "call",
                                type: "RuntimeCall"
                            }
                        ],
                        type: "Result<CallDryRunEffects, XcmDryRunApiError>"
                    },
                    dry_run_xcm: {
                        description: "Dry run XCM program",
                        params: [
                            {
                                name: "originLocation",
                                type: "VersionedMultiLocation"
                            },
                            {
                                name: "xcm",
                                type: "VersionedXcm"
                            }
                        ],
                        type: "Result<XcmDryRunEffects, XcmDryRunApiError>"
                    }
                },
                version: 1
            },
            {
                methods: {
                    dry_run_call: {
                        description: "Dry run call",
                        params: [
                            {
                                name: "origin",
                                type: "OriginCaller"
                            },
                            {
                                name: "call",
                                type: "RuntimeCall"
                            },
                            {
                                name: "resultXcmsVersion",
                                type: "u32"
                            }
                        ],
                        type: "Result<CallDryRunEffects, XcmDryRunApiError>"
                    },
                    dry_run_xcm: {
                        description: "Dry run XCM program",
                        params: [
                            {
                                name: "originLocation",
                                type: "VersionedMultiLocation"
                            },
                            {
                                name: "xcm",
                                type: "VersionedXcm"
                            }
                        ],
                        type: "Result<XcmDryRunEffects, XcmDryRunApiError>"
                    }
                },
                version: 2
            }
        ]
    }, Nqe = {
        rpc: {},
        runtime: Rqe,
        types: {
            PostDispatchInfo: {
                actualWeight: "Option<Weight>",
                paysFee: "Pays"
            },
            DispatchResultWithPostInfo: "Result<PostDispatchInfo, DispatchError>",
            CallDryRunEffects: {
                executionResult: "DispatchResultWithPostInfo",
                emittedEvents: "Vec<Event>",
                localXcm: "Option<VersionedXcm>",
                forwardedXcms: "Vec<(VersionedMultiLocation, Vec<VersionedXcm>)>"
            },
            XcmDryRunEffects: {
                executionResult: "OutcomeV4",
                emittedEvents: "Vec<Event>",
                forwardedXcms: "Vec<(VersionedMultiLocation, Vec<VersionedXcm>)>"
            },
            XcmDryRunApiError: {
                _enum: [
                    "Unimplemented",
                    "VersionedConversionFailed"
                ]
            }
        }
    };
    var Se;
    (function(t) {
        t[t.BTreeMap = 0] = "BTreeMap", t[t.BTreeSet = 1] = "BTreeSet", t[t.Compact = 2] = "Compact", t[t.DoNotConstruct = 3] = "DoNotConstruct", t[t.Enum = 4] = "Enum", t[t.HashMap = 5] = "HashMap", t[t.Int = 6] = "Int", t[t.Linkage = 7] = "Linkage", t[t.Null = 8] = "Null", t[t.Option = 9] = "Option", t[t.Plain = 10] = "Plain", t[t.Range = 11] = "Range", t[t.RangeInclusive = 12] = "RangeInclusive", t[t.Result = 13] = "Result", t[t.Set = 14] = "Set", t[t.Si = 15] = "Si", t[t.Struct = 16] = "Struct", t[t.Tuple = 17] = "Tuple", t[t.UInt = 18] = "UInt", t[t.Vec = 19] = "Vec", t[t.VecFixed = 20] = "VecFixed", t[t.WrapperKeepOpaque = 21] = "WrapperKeepOpaque", t[t.WrapperOpaque = 22] = "WrapperOpaque";
    })(Se || (Se = {}));
    function BJ(t) {
        return Mt(t.eq);
    }
    function FJ(t, e) {
        return Array.isArray(e) ? t.length === e.length && Rr(t.find((n, r)=>BJ(n) ? !n.eq(e[r]) : n !== e[r])) : !1;
    }
    class $3 extends Array {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        static get [Symbol.species]() {
            return Array;
        }
        constructor(e, n){
            super(n), this.registry = e;
        }
        get encodedLength() {
            const e = this.length;
            let n = es(e).length;
            for(let r = 0; r < e; r++)n += this[r].encodedLength;
            return n;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.length === 0;
        }
        get length() {
            return super.length;
        }
        eq(e) {
            return FJ(this, e);
        }
        inspect() {
            return {
                inner: this.inspectInner(),
                outer: [
                    es(this.length)
                ]
            };
        }
        inspectInner() {
            const e = this.length, n = new Array(e);
            for(let r = 0; r < e; r++)n[r] = this[r].inspect();
            return n;
        }
        toArray() {
            return Array.from(this);
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            const r = this.length, s = new Array(r);
            for(let i = 0; i < r; i++)s[i] = this[i] && this[i].toHuman(e, n);
            return s;
        }
        toJSON() {
            const e = this.length, n = new Array(e);
            for(let r = 0; r < e; r++)n[r] = this[r] && this[r].toJSON();
            return n;
        }
        toPrimitive(e) {
            const n = this.length, r = new Array(n);
            for(let s = 0; s < n; s++)r[s] = this[s] && this[s].toPrimitive(e);
            return r;
        }
        toString() {
            const e = this.length, n = new Array(e);
            for(let r = 0; r < e; r++)n[r] = this[r].toString();
            return `[${n.join(", ")}]`;
        }
        toU8a(e) {
            const n = this.toU8aInner();
            return Po(e ? n : [
                es(this.length),
                ...n
            ]);
        }
        toU8aInner(e) {
            const n = this.length, r = new Array(n);
            for(let s = 0; s < n; s++)r[s] = this[s].toU8a(e);
            return r;
        }
    }
    class X3 {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n, r){
            this.initialU8aLength = r, this.#e = n, this.registry = e;
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get inner() {
            return this.#e;
        }
        get isEmpty() {
            return this.#e.isEmpty;
        }
        eq(e) {
            return this.#e.eq(e);
        }
        inspect() {
            return this.#e.inspect();
        }
        toHex(e) {
            return this.#e.toHex(e);
        }
        toHuman(e, n) {
            return this.#e.toHuman(e, n);
        }
        toJSON() {
            return this.#e.toJSON();
        }
        toPrimitive(e) {
            return this.#e.toPrimitive(e);
        }
        toString() {
            return this.#e.toString();
        }
        toU8a(e) {
            return this.#e.toU8a(e);
        }
        unwrap() {
            return this.#e;
        }
        valueOf() {
            return this.#e;
        }
    }
    const Vqe = 64, wD = 52, Dqe = new ht(1e4), Bqe = [
        [
            "Perquintill",
            TLe
        ],
        [
            "Perbill",
            bx
        ],
        [
            "Permill",
            kLe
        ],
        [
            "Percent",
            SLe
        ]
    ];
    function Fqe(t) {
        return Mt(t.toBn);
    }
    function Lqe(t, e) {
        return `${(t.mul(Dqe).div(e).toNumber() / 100).toFixed(2)}%`;
    }
    function LJ(t, e) {
        if (Xn(t)) {
            if (!Number.isInteger(t) || t > Number.MAX_SAFE_INTEGER || t < Number.MIN_SAFE_INTEGER) throw new Error("Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1");
            return t;
        } else if (br(t)) {
            if (Fn(t, -1, !0)) return yA(t, {
                isLe: !1,
                isNegative: e
            }).toString();
            if (t.includes(".") || t.includes(",") || t.includes("e")) throw new Error("String should not contain decimal points or scientific notation");
            return t;
        } else {
            if (Ya(t) || $p(t)) return t.toString();
            if (eo(t)) {
                if (Fqe(t)) return t.toBn().toString();
                const n = Object.keys(t);
                if (n.length !== 1) throw new Error("Unable to construct number from multi-key object");
                return LJ(t[n[0]], e);
            } else if (!t) return 0;
        }
        throw new Error(`Unable to create BN from unknown type ${typeof t}`);
    }
    class zJ extends ht {
        registry;
        encodedLength;
        isUnsigned;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n = 0, r = Vqe, s = !1){
            super(Bt(n) ? r <= 48 ? wLe(n.subarray(0, r / 8), {
                isNegative: s
            }) : uu(n.subarray(0, r / 8), {
                isLe: !0,
                isNegative: s
            }).toString() : LJ(n, s)), this.registry = e, this.#e = r, this.encodedLength = this.#e / 8, this.initialU8aLength = this.#e / 8, this.isUnsigned = !s;
            const i = this.isNeg(), o = r - (s && !i ? 1 : 0);
            if (i && !s) throw new Error(`${this.toRawType()}: Negative number passed to unsigned type`);
            if (super.bitLength() > o) throw new Error(`${this.toRawType()}: Input too large. Found input with ${super.bitLength()} bits, expected ${o}`);
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.isZero();
        }
        bitLength() {
            return this.#e;
        }
        eq(e) {
            return super.eq(Fn(e) ? yA(e.toString(), {
                isLe: !1,
                isNegative: !this.isUnsigned
            }) : Ms(e));
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        isMax() {
            return this.toU8a().filter((n)=>n === 255).length === this.#e / 8;
        }
        toBigInt() {
            return BigInt(this.toString());
        }
        toBn() {
            return this;
        }
        toHex(e = !1) {
            return ALe(this, {
                bitLength: this.bitLength(),
                isLe: e,
                isNegative: !this.isUnsigned
            });
        }
        toHuman(e) {
            const n = this.toRawType();
            if (n === "Balance") return this.isMax() ? "everything" : Zp(this, {
                decimals: this.registry.chainDecimals[0],
                withSi: !0,
                withUnit: this.registry.chainTokens[0]
            });
            const [, r] = Bqe.find(([s])=>s === n) || [];
            return r ? Lqe(this, r) : Lk(this);
        }
        toJSON(e = !1) {
            return e || this.#e > 128 || super.bitLength() > wD ? this.toHex() : this.toNumber();
        }
        toPrimitive() {
            return super.bitLength() > wD ? this.toString() : this.toNumber();
        }
        toRawType() {
            return this instanceof this.registry.createClassUnsafe("Balance") ? "Balance" : `${this.isUnsigned ? "u" : "i"}${this.bitLength()}`;
        }
        toString(e) {
            return super.toString(e);
        }
        toU8a(e) {
            return $l(this, {
                bitLength: this.bitLength(),
                isLe: !0,
                isNegative: !this.isUnsigned
            });
        }
    }
    function zqe(t, e) {
        return Rr(t) || (BJ(t) ? !t.eq(e) : t !== e);
    }
    function Uqe(t) {
        return !Array.isArray(t) || t.length !== 2;
    }
    function kS(t, e) {
        return t.size === e.length && !e.some((n)=>Uqe(n) || zqe(t.get(n[0]), n[1]));
    }
    function CA(t, e) {
        return Array.isArray(e) ? kS(t, e) : e instanceof Map ? kS(t, [
            ...e.entries()
        ]) : eo(e) ? kS(t, Object.entries(e)) : !1;
    }
    function TS(t, e) {
        return t.size === e.length && !e.some((n)=>!t.has(n));
    }
    function Hqe(t, e) {
        return Array.isArray(e) ? TS(t, e) : e instanceof Set ? TS(t, [
            ...e.values()
        ]) : eo(e) ? TS(t, Object.values(e)) : !1;
    }
    const yx = 1024;
    function UJ(t) {
        const e = t.name?.toLowerCase() || "";
        return [
            "enum",
            "hashmap",
            "linkage",
            "null",
            "option",
            "range",
            "rangeinclusive",
            "result",
            "struct",
            "tuple",
            "vec",
            "vecfixed"
        ].includes(e);
    }
    function EA(t, e, n, { message: r }, s, i, o, a, c) {
        let l = "";
        try {
            l = `: ${new a(t).toRawType()}`;
        } catch  {}
        return `${e}: failed at ${nn(s.subarray(0, 16))}…${c ? ` on ${c}` : ""} (index ${i + 1}/${o})${l}:: ${r}`;
    }
    function IA(t, e, n, [r, s]) {
        const i = e.length;
        let o = 0, a = 0;
        try {
            for(; a < i;){
                const c = new r[a](t, n.subarray(o));
                o += c.initialU8aLength || c.encodedLength, e[a] = c, a++;
            }
        } catch (c) {
            throw new Error(EA(t, "decodeU8a", e, c, n.subarray(o), a, i, r[a], s[a]));
        }
        return [
            e,
            o
        ];
    }
    function jqe(t, e, n, [r, s]) {
        const i = e.length;
        let o = 0, a = 0;
        if (i > yx && UJ(r[a])) throw new Error(`decodeU8aStruct: Maximum depth exceeded, received ${i} elements, limit ${yx}`);
        try {
            for(; a < i;){
                const c = new r[a](t, n.subarray(o));
                o += c.initialU8aLength || c.encodedLength, e[a] = [
                    s[a],
                    c
                ], a++;
            }
        } catch (c) {
            throw new Error(EA(t, "decodeU8aStruct", e, c, n.subarray(o), a, i, r[a], s[a]));
        }
        return [
            e,
            o
        ];
    }
    function G3(t, e, n, r, s) {
        const i = e.length;
        if (i > yx && UJ(s)) throw new Error(`decodeU8aVec: Maximum depth exceeded, received ${i} elements, limit ${yx}`);
        let o = r, a = 0;
        try {
            for(; a < i;){
                const c = new s(t, n.subarray(o));
                o += c.initialU8aLength || c.encodedLength, e[a] = c, a++;
            }
        } catch (c) {
            throw new Error(EA(t, "decodeU8aVec", e, c, n.subarray(o), a, i, s));
        }
        return [
            o,
            o - r
        ];
    }
    const $k = [
        "BTreeMap",
        "BTreeSet",
        "HashMap",
        "Vec"
    ], qqe = $k.concat([
        "Compact",
        "DoNotConstruct",
        "Int",
        "Linkage",
        "Range",
        "RangeInclusive",
        "Result",
        "Opaque",
        "Option",
        "UInt",
        "WrapperKeepOpaque",
        "WrapperOpaque"
    ]), wx = [
        "<",
        "(",
        "[",
        '"',
        ",",
        " "
    ], _D = [
        lc("<T::InherentOfflineReport as InherentOfflineReport>::Inherent", "InherentOfflineReport", !1),
        lc("VecDeque<", "Vec<", !1),
        Kqe(),
        xD("Bounded", !0),
        xD("Weak", !1),
        Jqe(),
        Zqe(),
        Yqe("Box<"),
        Gqe(),
        lc("String", "Text"),
        lc("Vec<u8>", "Bytes"),
        lc("&\\[u8\\]", "Bytes"),
        lc("&'static\\[u8\\]", "Bytes"),
        lc("RawAddress", "Address"),
        lc("Lookup::Source", "LookupSource"),
        lc("Lookup::Target", "LookupTarget"),
        lc("exec::StorageKey", "ContractStorageKey"),
        $qe(),
        Xqe(),
        Wqe()
    ];
    function Wqe() {
        return (t)=>t.trim();
    }
    function AA(t, e) {
        let n = 0;
        for(let r = e, s = t.length; r < s; r++)if (t[r] === ">") {
            if (!n) return r;
            n--;
        } else t[r] === "<" && n++;
        throw new Error(`Unable to find closing matching <> on '${t}' (start ${e})`);
    }
    function lc(t, e, n = !0) {
        const r = new RegExp(`(^${t}|${wx.map((i)=>`\\${i}${t}`).join("|")})`, "g"), s = (i)=>(r.lastIndex = 0, n && wx.includes(i[0]) ? `${i[0]}${e}` : e);
        return (i)=>i.replace(r, s);
    }
    function Kqe() {
        return (t)=>{
            if (t.includes(" as HasCompact")) {
                for(let e = 0, n = t.length; e < n; e++)if (t[e] === "<") {
                    const r = AA(t, e + 1) - 14;
                    t.substring(r, r + 14) === " as HasCompact" && (t = `Compact<${t.substring(e + 1, r)}>`);
                }
            }
            return t;
        };
    }
    function $qe() {
        const t = /,\)/g, e = /\(([^,]+)\)/;
        return (n)=>(t.lastIndex = 0, n.replace(t, ")").replace(e, "$1"));
    }
    function PA(t, e, n) {
        let r = -1;
        for(;;){
            if (r = t.indexOf(e, r + 1), r === -1) return t;
            const s = r + e.length, i = AA(t, s);
            t = `${t.substring(0, r)}${n(t.substring(s, i))}${t.substring(i + 1)}`;
        }
    }
    function xD(t, e) {
        return (n)=>{
            for(let r = 0, s = $k.length; r < s; r++){
                const i = $k[r];
                n = PA(n, `${t}${i}<`, (o)=>{
                    const a = o.split(",").map((c)=>c.trim()).filter((c)=>c);
                    return e && a.pop(), `${i}<${a.join(",")}>`;
                });
            }
            return n;
        };
    }
    function Xqe() {
        return (t)=>{
            let e = 0;
            for(; e !== -1;)if (e = t.indexOf("::"), e === 0) t = t.substring(2);
            else if (e !== -1) {
                let n = e;
                for(; n !== -1 && !wx.includes(t[n]);)n--;
                t = `${t.substring(0, n + 1)}${t.substring(e + 2)}`;
            }
            return t;
        };
    }
    function Gqe() {
        return (t)=>{
            for(let e = 0, n = t.length; e < n; e++)if (t[e] === "<" && !qqe.find((s)=>{
                const i = e - s.length;
                return i >= 0 && t.substring(i, e) === s && (i === 0 || wx.includes(t[i - 1]));
            })) {
                const s = AA(t, e + 1);
                t = `${t.substring(0, e)}${t.substring(s + 1)}`;
            }
            return t;
        };
    }
    function Zqe() {
        const t = (e)=>`(${e},${e})`;
        return (e)=>PA(e, "PairOf<", t);
    }
    function Jqe() {
        const t = /\s/g, e = /(T|Self)::/g, n = /<(T|Self)asTrait>::/g, r = /<Tas[a-z]+::Trait>::/g, s = /<LookupasStaticLookup>/g, i = /::Type/g;
        return (o)=>(t.lastIndex = 0, e.lastIndex = 0, n.lastIndex = 0, r.lastIndex = 0, s.lastIndex = 0, i.lastIndex = 0, o.replace(t, "").replace(e, "").replace(n, "").replace(r, "").replace(s, "Lookup").replace(i, ""));
    }
    function Yqe(t) {
        const e = (n)=>n;
        return (n)=>PA(n, t, e);
    }
    const vD = new Map;
    function _x(t) {
        const e = t.toString(), n = vD.get(e);
        if (n) return n;
        let r = e;
        for(let s = 0, i = _D.length; s < i; s++)r = _D[s](r);
        return vD.set(e, r), r;
    }
    function SD(t) {
        return t instanceof Uint8Array || Array.isArray(t);
    }
    function kD(t) {
        return oa(t) && Xn(t.index) && oa(t.value);
    }
    function TD(t) {
        return oa(t) && Cy(t.isSome) && oa(t.value);
    }
    function CD(t) {
        return Xn(t) || Ya(t) || $p(t);
    }
    function Qqe(t, e) {
        let n = 0;
        const r = Math.min(t.length, e.length);
        for(let s = 0; s < r; ++s)if (n = kl(t[s], e[s]), n !== 0) return n;
        return t.length - e.length;
    }
    function HJ(t, e, n) {
        if (oa(n)) {
            const r = n.toHex();
            if (e.has(r)) throw new Error(`Duplicate value in ${t}: ${vn(n)}`);
            e.add(r);
        }
        return !0;
    }
    function kl(t, e) {
        if (CD(t) && CD(e)) return Ms(t).cmp(Ms(e));
        if (t instanceof Map && e instanceof Map) return kl(Array.from(t.values()), Array.from(e.values()));
        if (kD(t) && kD(e)) return kl(t.index, e.index) || kl(t.value, e.value);
        if (TD(t) && TD(e)) return kl(t.isNone ? 0 : 1, e.isNone ? 0 : 1) || kl(t.value, e.value);
        if (SD(t) && SD(e)) return Qqe(t, e);
        if (oa(t) && oa(e)) return kl(t.toU8a(!0), e.toU8a(!0));
        throw new Error(`Attempting to sort unrecognized values: ${vn(t)} (typeof ${typeof t}) <-> ${vn(e)} (typeof ${typeof e})`);
    }
    function eWe(t) {
        const e = new Set;
        return new Set(Array.from(t).filter((n)=>HJ("BTreeSet", e, n)).sort(kl));
    }
    function tWe(t) {
        const e = new Set;
        return new Map(Array.from(t.entries()).filter(([n])=>HJ("BTreeMap", e, n)).sort(([n], [r])=>kl(n, r)));
    }
    function qa(t, e) {
        return typeof e == "function" ? e : t.createClassUnsafe(e);
    }
    function nWe(t, e) {
        const n = e.length, r = new Array(n);
        for(let s = 0; s < n; s++)r[s] = qa(t, e[s]);
        return r;
    }
    function OA(t, e) {
        const n = Object.entries(e), r = n.length, s = [
            new Array(r),
            new Array(r)
        ];
        for(let i = 0; i < r; i++)s[1][i] = n[i][0], s[0][i] = qa(t, n[i][1]);
        return s;
    }
    function jJ(t, [e, n]) {
        const r = {};
        for(let s = 0, i = n.length; s < i; s++)r[n[s]] = t.getClassName(e[s]) || new e[s](t).toRawType();
        return r;
    }
    function rWe(t, e, n) {
        if (Bt(n)) {
            const [r, s] = (n[0] & 3) < 3 ? Gp(n) : W3(n);
            return [
                new e(t, s),
                r
            ];
        } else if (n instanceof Ey) {
            const r = n.unwrap();
            return r instanceof e ? [
                r,
                0
            ] : [
                new e(t, r),
                0
            ];
        } else if (n instanceof e) return [
            n,
            0
        ];
        return [
            new e(t, n),
            0
        ];
    }
    class Ey {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r = 0, { definition: s, setDefinition: i = Jp } = {}){
            this.registry = e, this.#e = s || i(qa(e, n));
            const [o, a] = rWe(e, this.#e, r);
            this.initialU8aLength = a, this.#t = o;
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends Ey {
                constructor(s, i){
                    super(s, e, i, {
                        definition: n,
                        setDefinition: r
                    });
                }
            };
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.#t.isEmpty;
        }
        bitLength() {
            return this.#t.bitLength();
        }
        eq(e) {
            return this.#t.eq(e instanceof Ey ? e.#t : e);
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toBigInt() {
            return this.#t.toBigInt();
        }
        toBn() {
            return this.#t.toBn();
        }
        toHex(e) {
            return this.#t.toHex(e);
        }
        toHuman(e, n) {
            return this.#t.toHuman(e, n);
        }
        toJSON() {
            return this.#t.toJSON();
        }
        toNumber() {
            return this.#t.toNumber();
        }
        toPrimitive(e) {
            return this.#t.toPrimitive(e);
        }
        toRawType() {
            return `Compact<${this.registry.getClassName(this.#e) || this.#t.toRawType()}>`;
        }
        toString() {
            return this.#t.toString();
        }
        toU8a(e) {
            return es(this.#t.toBn());
        }
        unwrap() {
            return this.#t;
        }
    }
    class Z3 {
        registry;
        createdAtHash;
        isStorageFallback;
        #e;
        constructor(e, n = "DoNotConstruct"){
            throw this.registry = e, this.#e = new Error(`DoNotConstruct: Cannot construct unknown type ${n}`), this.#e;
        }
        static with(e) {
            return class extends Z3 {
                constructor(n){
                    super(n, e);
                }
            };
        }
        get encodedLength() {
            throw this.#e;
        }
        get hash() {
            throw this.#e;
        }
        get isEmpty() {
            throw this.#e;
        }
        eq() {
            throw this.#e;
        }
        inspect() {
            throw this.#e;
        }
        toHex() {
            throw this.#e;
        }
        toHuman() {
            throw this.#e;
        }
        toJSON() {
            throw this.#e;
        }
        toPrimitive() {
            throw this.#e;
        }
        toRawType() {
            throw this.#e;
        }
        toString() {
            throw this.#e;
        }
        toU8a() {
            throw this.#e;
        }
    }
    class Nc {
        encodedLength = 0;
        isEmpty = !0;
        registry;
        createdAtHash;
        initialU8aLength = 0;
        isStorageFallback;
        constructor(e){
            this.registry = e;
        }
        get hash() {
            throw new Error(".hash is not implemented on Null");
        }
        eq(e) {
            return e instanceof Nc || Gf(e);
        }
        inspect() {
            return {};
        }
        toHex() {
            return "0x";
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return null;
        }
        toPrimitive() {
            return null;
        }
        toRawType() {
            return "Null";
        }
        toString() {
            return "";
        }
        toU8a(e) {
            return new Uint8Array;
        }
    }
    function sWe(t) {
        const e = Object.values(t);
        if (e.some((n)=>Xn(n))) {
            if (!e.every((n)=>Xn(n) && n >= 0 && n <= 255)) throw new Error("Invalid number-indexed enum definition");
            return !1;
        }
        return !0;
    }
    function iWe(t, e) {
        const n = {};
        let r, s;
        if (Array.isArray(e)) {
            for(let i = 0, o = e.length; i < o; i++)n[e[i]] = {
                Type: Nc,
                index: i
            };
            r = !0, s = !1;
        } else if (sWe(e)) {
            const [i, o] = OA(t, e);
            for(let a = 0, c = o.length; a < c; a++)n[o[a]] = {
                Type: i[a],
                index: a
            };
            r = !Object.values(n).some(({ Type: a })=>a !== Nc), s = !1;
        } else {
            const i = Object.entries(e);
            for(let o = 0, a = i.length; o < a; o++){
                const [c, l] = i[o];
                n[c] = {
                    Type: Nc,
                    index: l
                };
            }
            r = !0, s = !0;
        }
        return {
            def: n,
            isBasic: r,
            isIndexed: s
        };
    }
    function qJ(t, e) {
        const n = Object.values(t);
        for(let r = 0, s = n.length; r < s; r++){
            const { Type: i, index: o } = n[r];
            if (o === e) return i;
        }
        throw new Error(`Unable to create Enum via index ${e}, in ${Object.keys(t).join(", ")}`);
    }
    function WJ(t, e, n, r) {
        const s = qJ(e, n);
        return {
            index: n,
            value: new s(t, r)
        };
    }
    function um(t, e, n = 0, r) {
        const s = qJ(e, n);
        return {
            index: n,
            value: r instanceof s ? r : new s(t, r)
        };
    }
    function ED(t, e, n, r) {
        const s = Object.keys(e).map((a)=>a.toLowerCase()), i = n.toLowerCase(), o = s.indexOf(i);
        if (o === -1) throw new Error(`Cannot map Enum JSON, unable to find '${n}' in ${s.join(", ")}`);
        try {
            return um(t, e, Object.values(e)[o].index, r);
        } catch (a) {
            throw new Error(`Enum(${n}):: ${a.message}`);
        }
    }
    function oWe(t, e, n, r) {
        if (Xn(r)) return um(t, e, r, n);
        if (Bt(n) || Fn(n)) {
            const s = Dt(n);
            if (s.length) return WJ(t, e, s[0], s.subarray(1));
        } else {
            if (n instanceof fa) return um(t, e, n.index, n.value);
            if (Xn(n)) return um(t, e, n);
            if (br(n)) return ED(t, e, n.toString());
            if (eo(n)) {
                const s = Object.keys(n)[0];
                return ED(t, e, s, n[s]);
            }
        }
        return um(t, e, Object.values(e)[0].index);
    }
    class fa {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        #n;
        #r;
        #s;
        #i;
        constructor(e, n, r, s, { definition: i, setDefinition: o = Jp } = {}){
            const { def: a, isBasic: c, isIndexed: l } = i || o(iWe(e, n)), u = Bt(r) && r.length && !Xn(s) ? WJ(e, a, r[0], r.subarray(1)) : oWe(e, a, r, s);
            this.registry = e, this.#e = a, this.#r = c, this.#s = l, this.#n = Object.values(a).map(({ index: d })=>d), this.#t = this.#n.indexOf(u.index), this.#i = u.value, this.#i.initialU8aLength && (this.initialU8aLength = 1 + this.#i.initialU8aLength);
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends fa {
                static{
                    const s = Array.isArray(e) ? e : Object.keys(e), i = s.length, o = new Array(i), a = new Array(i);
                    for(let c = 0; c < i; c++){
                        const l = xA(s[c]);
                        o[c] = `as${l}`, a[c] = `is${l}`;
                    }
                    Vd(this.prototype, a, (c, l, u)=>u.type === s[l]), Vd(this.prototype, o, (c, l, u)=>{
                        if (u.type !== s[l]) throw new Error(`Cannot convert '${u.type}' via ${c}`);
                        return u.value;
                    });
                }
                constructor(s, i, o){
                    super(s, e, i, o, {
                        definition: n,
                        setDefinition: r
                    });
                }
            };
        }
        get encodedLength() {
            return 1 + this.#i.encodedLength;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get index() {
            return this.#n[this.#t];
        }
        get inner() {
            return this.#i;
        }
        get isBasic() {
            return this.#r;
        }
        get isEmpty() {
            return this.#i.isEmpty;
        }
        get isNone() {
            return this.#i instanceof Nc;
        }
        get defIndexes() {
            return this.#n;
        }
        get defKeys() {
            return Object.keys(this.#e);
        }
        get type() {
            return this.defKeys[this.#t];
        }
        get value() {
            return this.#i;
        }
        eq(e) {
            return Bt(e) ? !this.toU8a().some((n, r)=>n !== e[r]) : Xn(e) ? this.toNumber() === e : this.#r && br(e) ? this.type === e : Fn(e) ? this.toHex() === e : e instanceof fa ? this.index === e.index && this.value.eq(e.value) : eo(e) ? this.value.eq(e[this.type]) : this.value.eq(e);
        }
        inspect() {
            if (this.#r) return {
                outer: [
                    new Uint8Array([
                        this.index
                    ])
                ]
            };
            const { inner: e, outer: n = [] } = this.#i.inspect();
            return {
                inner: e,
                outer: [
                    new Uint8Array([
                        this.index
                    ]),
                    ...n
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            return this.#r || this.isNone ? this.type : {
                [this.type]: this.#i.toHuman(e, n)
            };
        }
        toJSON() {
            return this.#r ? this.type : {
                [tr(this.type)]: this.#i.toJSON()
            };
        }
        toNumber() {
            return this.index;
        }
        toPrimitive(e) {
            return this.#r ? this.type : {
                [tr(this.type)]: this.#i.toPrimitive(e)
            };
        }
        _toRawStruct() {
            if (this.#r) return this.#s ? this.defKeys.reduce((n, r, s)=>(n[r] = this.#n[s], n), {}) : this.defKeys;
            const e = Object.entries(this.#e);
            return jJ(this.registry, e.reduce((n, [r, { Type: s }], i)=>(n[0][i] = s, n[1][i] = r, n), [
                new Array(e.length),
                new Array(e.length)
            ]));
        }
        toRawType() {
            return vn({
                _enum: this._toRawStruct()
            });
        }
        toString() {
            return this.isNone ? this.type : vn(this.toJSON());
        }
        toU8a(e) {
            return e ? this.#i.toU8a(e) : Po([
                new Uint8Array([
                    this.index
                ]),
                this.#i.toU8a(e)
            ]);
        }
    }
    class Su extends zJ {
        constructor(e, n = 0, r){
            super(e, n, r, !0);
        }
        static with(e, n) {
            return class extends Su {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
    }
    class Lh extends Nc {
        toRawType() {
            return "None";
        }
    }
    function aWe(t, e, n) {
        return n instanceof e ? n : n instanceof Dd ? n.value instanceof e ? n.value : n.isNone ? new Lh(t) : new e(t, n.value) : Gf(n) || Rr(n) || n === "0x" || n instanceof Lh ? new Lh(t) : Bt(n) ? !n.length || n[0] === 0 ? new Lh(t) : new e(t, n.subarray(1)) : new e(t, n);
    }
    class Dd {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, { definition: s, setDefinition: i = Jp } = {}){
            const o = s || i(qa(e, n)), a = Bt(r) && r.length && !oa(r) ? r[0] === 0 ? new Lh(e) : new o(e, r.subarray(1)) : aWe(e, o, r);
            this.registry = e, this.#e = o, this.#t = a, a?.initialU8aLength && (this.initialU8aLength = 1 + a.initialU8aLength);
        }
        static with(e) {
            let n;
            const r = (s)=>(n = s, s);
            return class extends Dd {
                constructor(s, i){
                    super(s, e, i, {
                        definition: n,
                        setDefinition: r
                    });
                }
            };
        }
        get encodedLength() {
            return 1 + this.#t.encodedLength;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.isNone;
        }
        get isNone() {
            return this.#t instanceof Lh;
        }
        get isSome() {
            return !this.isNone;
        }
        get value() {
            return this.#t;
        }
        eq(e) {
            return e instanceof Dd ? this.isSome === e.isSome && this.value.eq(e.value) : this.value.eq(e);
        }
        inspect() {
            if (this.isNone) return {
                outer: [
                    new Uint8Array([
                        0
                    ])
                ]
            };
            const { inner: e, outer: n = [] } = this.#t.inspect();
            return {
                inner: e,
                outer: [
                    new Uint8Array([
                        1
                    ]),
                    ...n
                ]
            };
        }
        toHex() {
            return this.isNone ? "0x" : nn(this.toU8a().subarray(1));
        }
        toHuman(e, n) {
            return this.#t.toHuman(e, n);
        }
        toJSON() {
            return this.isNone ? null : this.#t.toJSON();
        }
        toPrimitive(e) {
            return this.isNone ? null : this.#t.toPrimitive(e);
        }
        toRawType(e) {
            const n = this.registry.getClassName(this.#e) || new this.#e(this.registry).toRawType();
            return e ? n : `Option<${n}>`;
        }
        toString() {
            return this.#t.toString();
        }
        toU8a(e) {
            if (e) return this.#t.toU8a(!0);
            const n = new Uint8Array(this.encodedLength);
            return this.isSome && (n.set([
                1
            ]), n.set(this.#t.toU8a(), 1)), n;
        }
        unwrap() {
            if (this.isNone) throw new Error("Option: unwrapping a None value");
            return this.#t;
        }
        unwrapOr(e) {
            return this.isSome ? this.unwrap() : e;
        }
        unwrapOrDefault() {
            return this.isSome ? this.unwrap() : new this.#e(this.registry);
        }
    }
    class MA extends fa {
        constructor(e, n, r, s){
            super(e, {
                Ok: n,
                Err: r
            }, s);
        }
        static with(e) {
            return class extends MA {
                constructor(n, r){
                    super(n, e.Ok, e.Err, r);
                }
            };
        }
        get asErr() {
            if (!this.isErr) throw new Error("Cannot extract Err value from Ok result, check isErr first");
            return this.value;
        }
        get asOk() {
            if (!this.isOk) throw new Error("Cannot extract Ok value from Err result, check isOk first");
            return this.value;
        }
        get isEmpty() {
            return this.isOk && this.value.isEmpty;
        }
        get isErr() {
            return !this.isOk;
        }
        get isOk() {
            return this.index === 0;
        }
        toRawType() {
            const e = this._toRawStruct();
            return `Result<${e.Ok},${e.Err}>`;
        }
    }
    function cWe(t, e, n, r) {
        if (Array.isArray(n)) {
            const s = r[0];
            for(let i = 0, o = s.length; i < o; i++)try {
                const a = n?.[i];
                e[i] = a instanceof s[i] ? a : new s[i](t, a);
            } catch (a) {
                throw new Error(`Tuple: failed on ${i}:: ${a.message}`);
            }
            return [
                e,
                0
            ];
        } else {
            if (Fn(n)) return IA(t, e, Dt(n), r);
            if (!n || !e.length) {
                const s = r[0];
                for(let i = 0, o = s.length; i < o; i++)e[i] = new s[i](t);
                return [
                    e,
                    0
                ];
            }
        }
        throw new Error(`Expected array input to Tuple decoding, found ${typeof n}: ${vn(n)}`);
    }
    class eb extends $3 {
        #e;
        constructor(e, n, r, { definition: s, setDefinition: i = Jp } = {}){
            const o = s || i(Array.isArray(n) ? [
                nWe(e, n),
                []
            ] : Mt(n) || br(n) ? [
                [
                    qa(e, n)
                ],
                []
            ] : OA(e, n));
            super(e, o[0].length), this.initialU8aLength = (Bt(r) ? IA(e, this, r, o) : cWe(e, this, r, o))[1], this.#e = o;
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends eb {
                constructor(s, i){
                    super(s, e, i, {
                        definition: n,
                        setDefinition: r
                    });
                }
            };
        }
        get encodedLength() {
            let e = 0;
            for(let n = 0, r = this.length; n < r; n++)e += this[n].encodedLength;
            return e;
        }
        get Types() {
            return this.#e[1].length ? this.#e[1] : this.#e[0].map((e)=>new e(this.registry).toRawType());
        }
        inspect() {
            return {
                inner: this.inspectInner()
            };
        }
        toRawType() {
            return `(${this.#e[0].map((n)=>this.registry.getClassName(n) || new n(this.registry).toRawType()).join(",")})`;
        }
        toString() {
            return vn(this.toJSON());
        }
        toU8a(e) {
            return Po(this.toU8aInner(e));
        }
    }
    class ku extends zJ {
        static with(e, n) {
            return class extends ku {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
    }
    const ID = 512 * 1024, lWe = ma("Vec");
    function uWe(t) {
        if (Array.isArray(t)) return [
            t,
            t.length,
            0
        ];
        if (Bt(t) || Fn(t)) {
            const e = Dt(t), [n, r] = Gp(e);
            if (r > ID) throw new Error(`Vec length ${r.toString()} exceeds ${ID}`);
            return [
                e,
                r,
                n
            ];
        } else if (!t) return [
            null,
            0,
            0
        ];
        throw new Error(`Expected array/hex input to Vec<*> decoding, found ${typeof t}: ${vn(t)}`);
    }
    function KJ(t, e, n, r, s) {
        if (Array.isArray(n)) {
            const i = e.length;
            for(let o = 0; o < i; o++){
                const a = n[o];
                try {
                    e[o] = a instanceof s ? a : new s(t, a);
                } catch (c) {
                    throw lWe.error(`Unable to decode on index ${o}`, c.message), c;
                }
            }
            return [
                0,
                0
            ];
        } else if (!n) return [
            0,
            0
        ];
        return G3(t, e, Dt(n), r, s);
    }
    class RA extends $3 {
        #e;
        constructor(e, n, r = [], { definition: s, setDefinition: i = Jp } = {}){
            const [o, a, c] = uWe(r);
            super(e, a), this.#e = s || i(qa(e, n)), this.initialU8aLength = (Bt(o) ? G3(e, this, o, c, this.#e) : KJ(e, this, o, c, this.#e))[0];
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends RA {
                constructor(s, i){
                    super(s, e, i, {
                        definition: n,
                        setDefinition: r
                    });
                }
            };
        }
        get Type() {
            return this.#e.name;
        }
        indexOf(e) {
            const n = e instanceof this.#e ? e : new this.#e(this.registry, e);
            for(let r = 0, s = this.length; r < s; r++)if (n.eq(this[r])) return r;
            return -1;
        }
        toRawType() {
            return `Vec<${this.registry.getClassName(this.#e) || new this.#e(this.registry).toRawType()}>`;
        }
    }
    class NA extends $3 {
        #e;
        constructor(e, n, r, s = [], { definition: i, setDefinition: o = Jp } = {}){
            super(e, r), this.#e = i || o(qa(e, n)), this.initialU8aLength = (Bt(s) ? G3(e, this, s, 0, this.#e) : KJ(e, this, s, 0, this.#e))[1];
        }
        static with(e, n) {
            let r;
            const s = (i)=>r = i;
            return class extends NA {
                constructor(i, o){
                    super(i, e, n, o, {
                        definition: r,
                        setDefinition: s
                    });
                }
            };
        }
        get Type() {
            return new this.#e(this.registry).toRawType();
        }
        get encodedLength() {
            let e = 0;
            for(let n = 0, r = this.length; n < r; n++)e += this[n].encodedLength;
            return e;
        }
        inspect() {
            return {
                inner: this.inspectInner()
            };
        }
        toU8a() {
            const e = this.toU8aInner();
            return e.length ? Po(e) : new Uint8Array([]);
        }
        toRawType() {
            return `[${this.Type};${this.length}]`;
        }
    }
    class pa extends Uint8Array {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        static get [Symbol.species]() {
            return Uint8Array;
        }
        constructor(e, n, r){
            super(Dt(n)), this.registry = e, this.initialU8aLength = r;
        }
        get encodedLength() {
            return this.length;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isAscii() {
            return jV(this);
        }
        get isEmpty() {
            return !this.length || Rr(this.find((e)=>!!e));
        }
        get isUtf8() {
            return WLe(this);
        }
        bitLength() {
            return this.length * 8;
        }
        eq(e) {
            return e instanceof Uint8Array ? this.length === e.length && !this.some((n, r)=>n !== e[r]) : this.eq(Dt(e));
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toHex() {
            return nn(this);
        }
        toHuman(e, n) {
            return this.toPrimitive(n);
        }
        toJSON() {
            return this.toHex();
        }
        toPrimitive(e) {
            if (!e && this.isAscii) {
                const n = this.toUtf8();
                if (jV(n)) return n;
            }
            return this.toJSON();
        }
        toRawType() {
            return "Raw";
        }
        toString() {
            return this.toHex();
        }
        toU8a(e) {
            return Uint8Array.from(this);
        }
        toUtf8() {
            if (!this.isUtf8) throw new Error("The character sequence is not a valid Utf8 string");
            return Kl(this);
        }
    }
    function dWe(t) {
        if (!t?.length) return [
            0,
            new Uint8Array
        ];
        const [e, n] = Gp(t), r = e + Math.ceil(n / 8);
        if (r > t.length) throw new Error(`BitVec: required length less than remainder, expected at least ${r}, found ${t.length}`);
        return [
            n,
            t.subarray(e, r)
        ];
    }
    function fWe(t) {
        if (Array.isArray(t) || br(t)) {
            const e = Dt(t);
            return [
                e.length * 8,
                e
            ];
        }
        return dWe(t);
    }
    class pWe extends pa {
        #e;
        #t;
        constructor(e, n, r = !1){
            const [s, i] = fWe(n);
            super(e, i), this.#e = s, this.#t = r;
        }
        get encodedLength() {
            return this.length + es(this.#e).length;
        }
        inspect() {
            return {
                outer: [
                    es(this.#e),
                    super.toU8a()
                ]
            };
        }
        toBoolArray() {
            const e = [
                ...this.toU8a(!0)
            ].map((s)=>[
                    !!(s & 128),
                    !!(s & 64),
                    !!(s & 32),
                    !!(s & 16),
                    !!(s & 8),
                    !!(s & 4),
                    !!(s & 2),
                    !!(s & 1)
                ]), n = e.length, r = new Array(8 * n);
            for(let s = 0; s < n; s++){
                const i = s * 8, o = e[s];
                for(let a = 0; a < 8; a++)r[i + a] = this.#t ? o[a] : o[7 - a];
            }
            return r;
        }
        toHuman() {
            return `0b${[
                ...this.toU8a(!0)
            ].map((e)=>`00000000${e.toString(2)}`.slice(-8)).map((e)=>this.#t ? e : e.split("").reverse().join("")).join("_")}`;
        }
        toRawType() {
            return "BitVec";
        }
        toU8a(e) {
            const n = super.toU8a(e);
            return e ? n : Po([
                es(this.#e),
                n
            ]);
        }
    }
    function hWe(t) {
        return t;
    }
    function gWe(t, [e, n], r, s) {
        let i;
        const o = Array.isArray(r), a = r instanceof Map, c = n.length;
        if (!o && !a && !eo(r)) throw new Error(`Struct: Cannot decode value ${vn(r)} (typeof ${typeof r}), expected an input object, map or array`);
        if (o && r.length !== c) throw new Error(`Struct: Unable to map ${vn(r)} array to object with known keys ${n.join(", ")}`);
        const l = new Array(c);
        for(let u = 0; u < c; u++){
            const d = n[u], f = s.get(d) || d, p = e[u];
            let h;
            try {
                if (o) h = r[u];
                else if (a) h = f && r.get(f);
                else if (h = f && Object.prototype.hasOwnProperty.call(r, f) ? r[f] : void 0, Rr(h)) {
                    if (Rr(i)) {
                        const m = Object.entries(r);
                        i = {};
                        for(let w = 0, v = m.length; w < v; w++)Object.prototype.hasOwnProperty.call(r, m[w][0]) && (i[tr(m[w][0])] = m[w][1]);
                    }
                    h = f && Object.prototype.hasOwnProperty.call(i, f) ? i[f] : void 0;
                }
                l[u] = [
                    d,
                    h instanceof p ? h : new p(t, h)
                ];
            } catch (m) {
                let w = p.name;
                try {
                    w = new p(t).toRawType();
                } catch  {}
                throw new Error(`Struct: failed on ${f}: ${w}:: ${m.message}`);
            }
        }
        return [
            l,
            0
        ];
    }
    class Gr extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, s = new Map, { definition: i, setDefinition: o = hWe } = {}){
            const a = i || o(OA(e, n)), [c, l] = Bt(r) || Fn(r) ? jqe(e, new Array(a[0].length), Dt(r), a) : r instanceof Gr ? [
                r,
                0
            ] : gWe(e, a, r || {}, s);
            super(c), this.initialU8aLength = l, this.registry = e, this.#e = s, this.#t = a;
        }
        static with(e, n) {
            let r;
            const s = (i)=>r = i;
            return class extends Gr {
                static{
                    const i = Object.keys(e);
                    Vd(this.prototype, i, (o, a, c)=>c.get(o));
                }
                constructor(i, o){
                    super(i, e, o, n, {
                        definition: r,
                        setDefinition: s
                    });
                }
            };
        }
        get defKeys() {
            return this.#t[1];
        }
        get isEmpty() {
            return [
                ...this.keys()
            ].length === 0;
        }
        get encodedLength() {
            let e = 0;
            for (const n of this.values())e += n.encodedLength;
            return e;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get Type() {
            const e = {}, [n, r] = this.#t;
            for(let s = 0, i = r.length; s < i; s++)e[r[s]] = new n[s](this.registry).toRawType();
            return e;
        }
        eq(e) {
            return CA(this, e);
        }
        get(e) {
            return super.get(e);
        }
        getAtIndex(e) {
            return this.toArray()[e];
        }
        getT(e) {
            return super.get(e);
        }
        inspect(e) {
            const n = [];
            for (const [r, s] of this.entries())n.push({
                ...s.inspect(!e || Cy(e) ? e : e[r]),
                name: tr(r)
            });
            return {
                inner: n
            };
        }
        toArray() {
            return [
                ...this.values()
            ];
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            const r = {};
            for (const [s, i] of this.entries())r[s] = i.toHuman(e, n);
            return r;
        }
        toJSON() {
            const e = {};
            for (const [n, r] of this.entries())e[this.#e.get(n) || n] = r.toJSON();
            return e;
        }
        toPrimitive(e) {
            const n = {};
            for (const [r, s] of this.entries())n[r] = s.toPrimitive(e);
            return n;
        }
        toRawType() {
            return vn(jJ(this.registry, this.#t));
        }
        toString() {
            return vn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            for (const [r, s] of this.entries())n.push(s.toU8a(!e || Cy(e) ? e : e[r]));
            return Po(n);
        }
    }
    const bWe = ma("Map");
    function mWe(t, e, n, r) {
        const s = new Map, [i, o] = Gp(r), a = [];
        for(let u = 0; u < o; u++)a.push(e, n);
        const [c, l] = IA(t, new Array(a.length), r.subarray(i), [
            a,
            []
        ]);
        for(let u = 0, d = c.length; u < d; u += 2)s.set(c[u], c[u + 1]);
        return [
            e,
            n,
            s,
            i + l
        ];
    }
    function AD(t, e, n, r) {
        const s = new Map;
        for (const [i, o] of r.entries()){
            const a = e.prototype instanceof $3 || e.prototype instanceof Gr || e.prototype instanceof fa;
            try {
                s.set(i instanceof e ? i : new e(t, a && typeof i == "string" ? JSON.parse(i) : i), o instanceof n ? o : new n(t, o));
            } catch (c) {
                throw bWe.error("Failed to decode key or value:", c.message), c;
            }
        }
        return [
            e,
            n,
            s,
            0
        ];
    }
    function yWe(t, e, n, r) {
        const s = qa(t, e), i = qa(t, n);
        if (r) {
            if (Bt(r) || Fn(r)) return mWe(t, s, i, Dt(r));
            if (r instanceof Map) return AD(t, s, i, r);
            if (eo(r)) return AD(t, s, i, new Map(Object.entries(r)));
        } else return [
            s,
            i,
            new Map,
            0
        ];
        throw new Error("Map: cannot decode type");
    }
    class $J extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        #n;
        constructor(e, n, r, s, i = "HashMap"){
            const [o, a, c, l] = yWe(e, n, r, s);
            super(i === "BTreeMap" ? tWe(c) : c), this.registry = e, this.initialU8aLength = l, this.#e = o, this.#t = a, this.#n = i;
        }
        get encodedLength() {
            let e = es(this.size).length;
            for (const [n, r] of this.entries())e += n.encodedLength + r.encodedLength;
            return e;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.size === 0;
        }
        eq(e) {
            return CA(this, e);
        }
        inspect() {
            const e = [];
            for (const [n, r] of this.entries())e.push(n.inspect()), e.push(r.inspect());
            return {
                inner: e,
                outer: [
                    es(this.size)
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            const r = {};
            for (const [s, i] of this.entries())r[s instanceof pa && !n && s.isAscii ? s.toUtf8() : s.toString()] = i.toHuman(e, n);
            return r;
        }
        toJSON() {
            const e = {};
            for (const [n, r] of this.entries())e[n.toString()] = r.toJSON();
            return e;
        }
        toPrimitive(e) {
            const n = {};
            for (const [r, s] of this.entries())n[r instanceof pa && !e && r.isAscii ? r.toUtf8() : r.toString()] = s.toPrimitive(e);
            return n;
        }
        toRawType() {
            return `${this.#n}<${this.registry.getClassName(this.#e) || new this.#e(this.registry).toRawType()},${this.registry.getClassName(this.#t) || new this.#t(this.registry).toRawType()}>`;
        }
        toString() {
            return vn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            e || n.push(es(this.size));
            for (const [r, s] of this.entries())n.push(r.toU8a(e), s.toU8a(e));
            return Po(n);
        }
    }
    class VA extends $J {
        static with(e, n) {
            return class extends VA {
                constructor(r, s){
                    super(r, e, n, s, "BTreeMap");
                }
            };
        }
    }
    const wWe = ma("BTreeSet");
    function _We(t, e, n) {
        const r = new Set, [s, i] = Gp(n), o = new Array(i), [a] = G3(t, o, n, s, e);
        for(let c = 0; c < i; c++)r.add(o[c]);
        return [
            e,
            r,
            a
        ];
    }
    function xWe(t, e, n) {
        const r = new Set;
        return n.forEach((s)=>{
            try {
                r.add(s instanceof e ? s : new e(t, s));
            } catch (i) {
                throw wWe.error("Failed to decode key or value:", i.message), i;
            }
        }), [
            e,
            r,
            0
        ];
    }
    function vWe(t, e, n) {
        const r = qa(t, e);
        if (n) {
            if (Bt(n) || Fn(n)) return _We(t, r, Dt(n));
            if (Array.isArray(n) || n instanceof Set) return xWe(t, r, n);
        } else return [
            r,
            new Set,
            0
        ];
        throw new Error("BTreeSet: cannot decode type");
    }
    class DA extends Set {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n, r){
            const [s, i, o] = vWe(e, n, r);
            super(eWe(i)), this.registry = e, this.initialU8aLength = o, this.#e = s;
        }
        static with(e) {
            return class extends DA {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get encodedLength() {
            let e = es(this.size).length;
            for (const n of this.values())e += n.encodedLength;
            return e;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.size === 0;
        }
        get strings() {
            return [
                ...super.values()
            ].map((e)=>e.toString());
        }
        eq(e) {
            return Hqe(this, e);
        }
        inspect() {
            const e = [];
            for (const n of this.values())e.push(n.inspect());
            return {
                inner: e,
                outer: [
                    es(this.size)
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            const r = [];
            for (const s of this.values())r.push(s.toHuman(e, n));
            return r;
        }
        toJSON() {
            const e = [];
            for (const n of this.values())e.push(n.toJSON());
            return e;
        }
        toRawType() {
            return `BTreeSet<${this.registry.getClassName(this.#e) || new this.#e(this.registry).toRawType()}>`;
        }
        toPrimitive(e) {
            const n = [];
            for (const r of this.values())n.push(r.toPrimitive(e));
            return n;
        }
        toString() {
            return vn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            e || n.push(es(this.size));
            for (const r of this.values())n.push(r.toU8a(e));
            return Po(n);
        }
    }
    const PD = 10 * 1024 * 1024;
    function SWe(t) {
        if (!t.length) return [
            new Uint8Array,
            0
        ];
        const [e, n] = Gp(t), r = e + n;
        if (n > PD) throw new Error(`Bytes length ${n.toString()} exceeds ${PD}`);
        if (r > t.length) throw new Error(`Bytes: required length less than remainder, expected at least ${r}, found ${t.length}`);
        return [
            t.subarray(e, r),
            r
        ];
    }
    class J3 extends pa {
        constructor(e, n){
            const [r, s] = Bt(n) && !(n instanceof pa) ? SWe(n) : Array.isArray(n) || br(n) ? [
                Dt(n),
                0
            ] : [
                n,
                0
            ];
            super(e, r, s);
        }
        get encodedLength() {
            return this.length + es(this.length).length;
        }
        inspect(e) {
            const n = es(this.length);
            return {
                outer: e ? [
                    super.toU8a()
                ] : this.length ? [
                    n,
                    super.toU8a()
                ] : [
                    n
                ]
            };
        }
        toRawType() {
            return "Bytes";
        }
        toU8a(e) {
            return e ? super.toU8a(e) : Xp(this);
        }
    }
    class BA extends $J {
        static with(e, n) {
            return class extends BA {
                constructor(r, s){
                    super(r, e, n, s);
                }
            };
        }
    }
    class sg extends Boolean {
        registry;
        createdAtHash;
        initialU8aLength = 1;
        isStorageFallback;
        constructor(e, n = !1){
            super(Bt(n) ? n[0] === 1 : n instanceof Boolean ? n.valueOf() : !!n), this.registry = e;
        }
        get encodedLength() {
            return 1;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.isFalse;
        }
        get isFalse() {
            return !this.isTrue;
        }
        get isTrue() {
            return this.valueOf();
        }
        eq(e) {
            return this.valueOf() === (e instanceof Boolean ? e.valueOf() : e);
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.valueOf();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toRawType() {
            return "bool";
        }
        toString() {
            return this.toJSON().toString();
        }
        toU8a(e) {
            return new Uint8Array([
                this.valueOf() ? 1 : 0
            ]);
        }
    }
    function kWe(t, e) {
        return e[0] === 0 ? null : new sg(t, e[0] === 1);
    }
    class TWe extends Dd {
        constructor(e, n){
            super(e, sg, Bt(n) || Fn(n) ? kWe(e, Dt(n)) : n), this.initialU8aLength = 1;
        }
        get encodedLength() {
            return 1;
        }
        get isFalse() {
            return this.isSome ? !this.value.valueOf() : !1;
        }
        get isTrue() {
            return this.isSome ? this.value.valueOf() : !1;
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toRawType(e) {
            return e ? "bool" : "Option<bool>";
        }
        toU8a(e) {
            return e ? super.toU8a(!0) : this.isSome ? new Uint8Array([
                this.isTrue ? 1 : 2
            ]) : new Uint8Array([
                0
            ]);
        }
    }
    class Y3 extends eb {
        #e;
        constructor(e, n, r, { rangeName: s = "Range" } = {}){
            super(e, [
                n,
                n
            ], r), this.#e = s;
        }
        static with(e) {
            return class extends Y3 {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get start() {
            return this[0];
        }
        get end() {
            return this[1];
        }
        toRawType() {
            return `${this.#e}<${this.start.toRawType()}>`;
        }
    }
    class FA extends Y3 {
        constructor(e, n, r){
            super(e, n, r, {
                rangeName: "RangeInclusive"
            });
        }
        static with(e) {
            return class extends FA {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
    }
    const OD = 128 * 1024;
    function CWe(t) {
        if (Bt(t)) {
            if (!t.length) return [
                "",
                0
            ];
            if (t instanceof pa) return [
                Kl(t),
                0
            ];
            const [e, n] = Gp(t), r = e + n;
            if (n > OD) throw new Error(`Text: length ${n.toString()} exceeds ${OD}`);
            if (r > t.length) throw new Error(`Text: required length less than remainder, expected at least ${r}, found ${t.length}`);
            return [
                Kl(t.subarray(e, r)),
                r
            ];
        } else if (Fn(t)) return [
            Kl(Hc(t)),
            0
        ];
        return [
            t ? t.toString() : "",
            0
        ];
    }
    class XJ extends String {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e = null;
        constructor(e, n){
            const [r, s] = CWe(n);
            super(r), this.registry = e, this.initialU8aLength = s;
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.length === 0;
        }
        get length() {
            return super.length;
        }
        eq(e) {
            return br(e) ? this.toString() === e.toString() : !1;
        }
        inspect() {
            const e = ja(super.toString());
            return {
                outer: e.length ? [
                    es(e.length),
                    e
                ] : [
                    es(e.length)
                ]
            };
        }
        setOverride(e) {
            this.#e = e;
        }
        toHex() {
            return nn(this.toU8a(!0));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toRawType() {
            return "Text";
        }
        toString() {
            return this.#e || super.toString();
        }
        toU8a(e) {
            const n = ja(super.toString());
            return e ? n : Xp(n);
        }
    }
    class EWe extends XJ {
        constructor(e, n = ""){
            super(e, n), this.setOverride(_x(this.toString()));
        }
        toRawType() {
            return "Type";
        }
    }
    function IWe(t, e) {
        const n = Dt(t), r = e / 8;
        if (!n.length) return [
            new Uint8Array(r),
            0
        ];
        if (Bt(t) ? n.length < r : n.length !== r) throw new Error(`Expected input with ${r} bytes (${e} bits), found ${n.length} bytes`);
        return [
            n.subarray(0, r),
            r
        ];
    }
    class Gd extends pa {
        constructor(e, n = new Uint8Array, r = 256){
            const [s, i] = IWe(n, r);
            super(e, s, i);
        }
        static with(e, n) {
            return class extends Gd {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
        toRawType() {
            return `[u8;${this.length}]`;
        }
    }
    function AWe(t, e, n) {
        const r = qa(t, e);
        if (Bt(n) || Fn(n)) try {
            const [, i] = Fn(n) ? [
                0,
                Dt(n)
            ] : n instanceof pa ? [
                0,
                n.subarray()
            ] : mx(n);
            return [
                r,
                new r(t, i),
                n
            ];
        } catch  {
            return [
                r,
                null,
                n
            ];
        }
        const s = new r(t, n);
        return [
            r,
            s,
            Xp(s.toU8a())
        ];
    }
    class Q3 extends J3 {
        #e;
        #t;
        #n;
        constructor(e, n, r, { opaqueName: s = "WrapperKeepOpaque" } = {}){
            const [i, o, a] = AWe(e, n, r);
            super(e, a), this.#e = i, this.#t = o, this.#n = s;
        }
        static with(e) {
            return class extends Q3 {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get isDecoded() {
            return !!this.#t;
        }
        inspect() {
            return this.#t ? {
                inner: [
                    this.#t.inspect()
                ],
                outer: [
                    es(this.length)
                ]
            } : {
                outer: [
                    es(this.length),
                    this.toU8a(!0)
                ]
            };
        }
        toHuman(e, n) {
            return this.#t ? this.#t.toHuman(e, n) : super.toHuman(e, n);
        }
        toPrimitive(e) {
            return this.#t ? this.#t.toPrimitive(e) : super.toPrimitive(e);
        }
        toRawType() {
            return `${this.#n}<${this.registry.getClassName(this.#e) || (this.#t ? this.#t.toRawType() : new this.#e(this.registry).toRawType())}>`;
        }
        toString() {
            return this.#t ? this.#t.toString() : super.toString();
        }
        unwrap() {
            if (!this.#t) throw new Error(`${this.#n}: unwrapping an undecodable value`);
            return this.#t;
        }
    }
    class LA extends Q3 {
        constructor(e, n, r){
            super(e, n, r, {
                opaqueName: "WrapperOpaque"
            });
        }
        static with(e) {
            return class extends LA {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get inner() {
            return this.unwrap();
        }
    }
    class e9 extends Number {
        encodedLength;
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n, { bitLength: r = 32 } = {}){
            super(Bt(n) || Fn(n) ? n.length === 0 ? 0 : yLe(Dt(n), {
                bitLength: r
            }) : n || 0), this.#e = r, this.encodedLength = r / 8, this.initialU8aLength = this.encodedLength, this.registry = e;
        }
        static with(e) {
            return class extends e9 {
                constructor(n, r){
                    super(n, r, {
                        bitLength: e
                    });
                }
            };
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.valueOf() === 0;
        }
        eq(e) {
            return this.valueOf() === Number(e);
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman() {
            return this.toString();
        }
        toJSON() {
            return this.toHex();
        }
        toNumber() {
            return this.valueOf();
        }
        toPrimitive() {
            return this.toNumber();
        }
        toRawType() {
            return `f${this.#e}`;
        }
        toU8a(e) {
            return VLe(this, {
                bitLength: this.#e
            });
        }
    }
    function PWe(t) {
        return Object.entries(t || {});
    }
    class GJ extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        constructor(e, n){
            const r = PWe(n);
            super(r), this.registry = e, Vd(this, r.map(([s])=>s), (s)=>this.get(s));
        }
        get encodedLength() {
            return 0;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return [
                ...this.keys()
            ].length === 0;
        }
        eq(e) {
            return CA(this, e);
        }
        getT(e) {
            return this.get(e);
        }
        inspect() {
            throw new Error("Unimplemented");
        }
        toHex() {
            throw new Error("Unimplemented");
        }
        toHuman() {
            return [
                ...this.entries()
            ].reduce((e, [n, r])=>(e[n] = Mt(r?.toHuman) ? r.toHuman() : r, e), {});
        }
        toJSON() {
            return [
                ...this.entries()
            ].reduce((e, [n, r])=>(e[n] = r, e), {});
        }
        toPrimitive(e) {
            return [
                ...this.entries()
            ].reduce((n, [r, s])=>(n[r] = Mt(s.toPrimitive) ? s.toPrimitive(e) : s, n), {});
        }
        toRawType() {
            return "Json";
        }
        toString() {
            return vn(this.toJSON());
        }
        toU8a(e) {
            throw new Error("Unimplemented");
        }
    }
    function ZJ(t, e) {
        const n = new ht(0);
        for(let r = 0, s = e.length; r < s; r++)n.ior(Ms(t[e[r]] || 0));
        return n;
    }
    function OWe(t, e) {
        const n = e.length, r = new Array(n);
        for(let s = 0; s < n; s++){
            const i = e[s];
            if (Rr(t[i])) throw new Error(`Set: Invalid key '${i}' passed to Set, allowed ${Object.keys(t).join(", ")}`);
            r[s] = i;
        }
        return r;
    }
    function MD(t, e) {
        const n = Ms(e), r = Object.keys(t), s = [];
        for(let o = 0, a = r.length; o < a; o++){
            const c = r[o];
            n.and(Ms(t[c])).eq(Ms(t[c])) && s.push(c);
        }
        const i = ZJ(t, s);
        if (!n.eq(i)) throw new Error(`Set: Mismatch decoding '${n.toString()}', computed as '${i.toString()}' with ${s.join(", ")}`);
        return s;
    }
    function JJ(t, e = 0, n) {
        if (n % 8 !== 0) throw new Error(`Expected valid bitLength, power of 8, found ${n}`);
        const r = n / 8;
        if (Bt(e)) return e.length === 0 ? [] : MD(t, uu(e.subarray(0, r), {
            isLe: !0
        }));
        if (br(e)) return JJ(t, Dt(e), r);
        if (e instanceof Set || Array.isArray(e)) {
            const s = Array.isArray(e) ? e : [
                ...e.values()
            ];
            return OWe(t, s);
        }
        return MD(t, e);
    }
    class zA extends Set {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, s = 8){
            super(JJ(n, r, s)), this.registry = e, this.#e = n, this.#t = s / 8;
        }
        static with(e, n) {
            return class extends zA {
                static{
                    const r = Object.keys(e), s = r.length, i = new Array(s);
                    for(let o = 0; o < s; o++)i[o] = `is${xA(r[o])}`;
                    Vd(this.prototype, i, (o, a, c)=>c.strings.includes(r[a]));
                }
                constructor(r, s){
                    super(r, e, s, n);
                }
            };
        }
        get encodedLength() {
            return this.#t;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isEmpty() {
            return this.size === 0;
        }
        get strings() {
            return [
                ...super.values()
            ];
        }
        get valueEncoded() {
            return ZJ(this.#e, this.strings);
        }
        add = (e)=>{
            if (this.#e && Rr(this.#e[e])) throw new Error(`Set: Invalid key '${e}' on add`);
            return super.add(e), this;
        };
        eq(e) {
            return Array.isArray(e) ? FJ(this.strings.sort(), e.sort()) : e instanceof Set ? this.eq([
                ...e.values()
            ]) : Xn(e) || Ya(e) ? this.valueEncoded.eq(Ms(e)) : !1;
        }
        inspect() {
            return {
                outer: [
                    this.toU8a()
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.strings;
        }
        toNumber() {
            return this.valueEncoded.toNumber();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toRawType() {
            return vn({
                _set: this.#e
            });
        }
        toString() {
            return `[${this.strings.join(", ")}]`;
        }
        toU8a(e) {
            return $l(this.valueEncoded, {
                bitLength: this.#t * 8,
                isLe: !0
            });
        }
    }
    class RD extends e9.with(32) {
        __FloatType = "f32";
    }
    class ND extends e9.with(64) {
        __FloatType = "f64";
    }
    class VD extends Su.with(8) {
        __IntType = "i8";
    }
    class DD extends Su.with(16) {
        __IntType = "i16";
    }
    class Xk extends Su.with(32) {
        __IntType = "i32";
    }
    class BD extends Su.with(64) {
        __IntType = "i64";
    }
    class FD extends Su.with(128) {
        __IntType = "i128";
    }
    class LD extends Su.with(256) {
        __IntType = "i256";
    }
    class zD extends Xk {
        constructor(e, n){
            throw super(e, n), new Error("The `isize` type should not be used. Since it is platform-specific, it creates incompatibilities between native (generally i64) and WASM (always i32) code. Use one of the `i32` or `i64` types explicitly.");
        }
    }
    class UD extends ku.with(8) {
        __UIntType = "u8";
    }
    class HD extends ku.with(16) {
        __UIntType = "u16";
    }
    class Iy extends ku.with(32) {
        __UIntType = "u32";
    }
    class sa extends ku.with(64) {
        __UIntType = "u64";
    }
    class jD extends ku.with(128) {
        __UIntType = "u128";
    }
    class qD extends ku.with(256) {
        __UIntType = "u256";
    }
    class WD extends Iy {
        constructor(e, n){
            throw super(e, n), new Error("The `usize` type should not be used. Since it is platform-specific, it creates incompatibilities between native (generally u64) and WASM (always u32) code. Use one of the `u32` or `u64` types explicitly.");
        }
    }
    function MWe(t) {
        const e = [];
        let n = 0, r = 0, s = 0, i = 0, o = 0;
        for(let a = 0, c = t.length; a < c; a++)switch(t[a]){
            case ",":
                {
                    n || r || s || i || (e.push(t.substring(o, a).trim()), o = a + 1);
                    break;
                }
            case "<":
                n++;
                break;
            case ">":
                n--;
                break;
            case "[":
                r++;
                break;
            case "]":
                r--;
                break;
            case "{":
                s++;
                break;
            case "}":
                s--;
                break;
            case "(":
                i++;
                break;
            case ")":
                i--;
                break;
        }
        if (n || r || s || i) throw new Error(`Invalid definition (missing terminators) found in ${t}`);
        return e.push(t.substring(o, t.length).trim()), e;
    }
    const RWe = [
        "_alias",
        "_fallback"
    ];
    function YJ(t) {
        return br(t) ? t.toString() : vn(t);
    }
    function NWe(t) {
        const e = Object.values(t);
        if (e.some((n)=>Xn(n))) {
            if (!e.every((n)=>Xn(n) && n >= 0 && n <= 255)) throw new Error("Invalid number-indexed enum definition");
            return !1;
        }
        return !0;
    }
    function VWe(t, e, n, r) {
        return t.info = Se.Enum, t.fallbackType = r, Array.isArray(e) ? t.sub = e.map((s, i)=>({
                index: i,
                info: Se.Plain,
                name: s,
                type: "Null"
            })) : NWe(e) ? t.sub = Object.entries(e).map(([s, i], o)=>Ye({}, Tu(YJ(i || "Null"), {
                name: s
            }, n), {
                index: o
            })) : t.sub = Object.entries(e).map(([s, i])=>({
                index: i,
                info: Se.Plain,
                name: s,
                type: "Null"
            })), t;
    }
    function DWe(t, e, n) {
        return t.info = Se.Set, t.fallbackType = n, t.length = e._bitLength, t.sub = Object.entries(e).filter(([r])=>!r.startsWith("_")).map(([r, s])=>({
                index: s,
                info: Se.Plain,
                name: r,
                type: "Null"
            })), t;
    }
    function BWe(t, e, n, r) {
        const s = JSON.parse(e), i = Object.keys(s);
        return s._enum ? VWe(t, s._enum, r, s._fallback) : s._set ? DWe(t, s._set, s._fallback) : (t.alias = s._alias ? new Map(Object.entries(s._alias)) : void 0, t.fallbackType = s._fallback, t.sub = i.filter((o)=>!RWe.includes(o)).map((o)=>Tu(YJ(s[o]), {
                name: o
            }, r)), t);
    }
    function FWe(t, e, n, r) {
        const s = e.length - 1;
        let i = -1, o = 0;
        for(let d = 1; d < s && i === -1; d++)switch(e[d]){
            case ";":
                {
                    o === 0 && (i = d);
                    break;
                }
            case "[":
            case "(":
            case "<":
                o++;
                break;
            case "]":
            case ")":
            case ">":
                o--;
                break;
        }
        if (i === -1) throw new Error(`${e}: Unable to extract location of ';'`);
        const a = e.substring(1, i), [c, l] = e.substring(i + 1, s).split(";"), u = parseInt(c.trim(), 10);
        if (u > 2048) throw new Error(`${e}: Only support for [Type; <length>], where length <= 2048`);
        return t.displayName = l, t.length = u, t.sub = Tu(a, {}, r), t;
    }
    function Zw(t, e, n, r) {
        return t.sub = n.length === 0 ? [] : MWe(n).map((s)=>Tu(s, {}, r)), t;
    }
    function QJ(t, e, n, r) {
        const [s, i] = e.substring(r.length + 1, e.length - 1).split(","), o = parseInt(s.trim(), 10);
        if (o > 8192 || o % 8) throw new Error(`${e}: Only support for ${r}<bitLength>, where length <= 8192 and a power of 8, found ${o}`);
        return t.displayName = i, t.length = o, t;
    }
    function LWe(t, e, n) {
        return QJ(t, e, n, "Int");
    }
    function zWe(t, e, n) {
        return QJ(t, e, n, "UInt");
    }
    function UWe(t, e, n) {
        return t.displayName = e.substring(15, e.length - 1), t;
    }
    function KD(t, [e, n]) {
        return t.startsWith(e) && t.slice(-1 * n.length) === n;
    }
    const HWe = [
        [
            "[",
            "]",
            Se.VecFixed,
            FWe
        ],
        [
            "{",
            "}",
            Se.Struct,
            BWe
        ],
        [
            "(",
            ")",
            Se.Tuple,
            Zw
        ],
        [
            "BTreeMap<",
            ">",
            Se.BTreeMap,
            Zw
        ],
        [
            "HashMap<",
            ">",
            Se.HashMap,
            Zw
        ],
        [
            "Int<",
            ">",
            Se.Int,
            LWe
        ],
        [
            "Result<",
            ">",
            Se.Result,
            Zw
        ],
        [
            "UInt<",
            ">",
            Se.UInt,
            zWe
        ],
        [
            "DoNotConstruct<",
            ">",
            Se.DoNotConstruct,
            UWe
        ]
    ], jWe = [
        [
            "BTreeSet<",
            ">",
            Se.BTreeSet
        ],
        [
            "Compact<",
            ">",
            Se.Compact
        ],
        [
            "Linkage<",
            ">",
            Se.Linkage
        ],
        [
            "Opaque<",
            ">",
            Se.WrapperOpaque
        ],
        [
            "Option<",
            ">",
            Se.Option
        ],
        [
            "Range<",
            ">",
            Se.Range
        ],
        [
            "RangeInclusive<",
            ">",
            Se.RangeInclusive
        ],
        [
            "Vec<",
            ">",
            Se.Vec
        ],
        [
            "WrapperKeepOpaque<",
            ">",
            Se.WrapperKeepOpaque
        ],
        [
            "WrapperOpaque<",
            ">",
            Se.WrapperOpaque
        ]
    ];
    function $D(t, [e, n]) {
        return t.substring(e.length, t.length - n.length);
    }
    function Tu(t, { displayName: e, name: n } = {}, r = 0) {
        const s = _x(t), i = {
            displayName: e,
            info: Se.Plain,
            name: n,
            type: s
        };
        if (++r > 64) throw new Error("getTypeDef: Maximum nested limit reached");
        const o = HWe.find((c)=>KD(s, c));
        if (o) return i.info = o[2], o[3](i, s, $D(s, o), r);
        const a = jWe.find((c)=>KD(s, c));
        return a && (i.info = a[2], i.sub = Tu($D(s, a), {}, r)), i;
    }
    function Ay({ lookupName: t, type: e }) {
        return t || e;
    }
    function xx(t) {
        if (!Array.isArray(t.sub)) throw new Error(`Expected subtype as TypeDef[] in ${vn(t)}`);
        return t.sub;
    }
    function qWe(t) {
        if (!t.sub || Array.isArray(t.sub)) throw new Error(`Expected subtype as TypeDef in ${vn(t)}`);
        return t.sub;
    }
    function eY(t) {
        return Ay(qWe(t));
    }
    function XD(t) {
        const e = xx(t), n = {};
        for(let r = 0, s = e.length; r < s; r++){
            const i = e[r];
            if (!i.name) throw new Error(`No name found in definition ${vn(i)}`);
            n[i.name] = Ay(i);
        }
        return n;
    }
    function Gk(t) {
        return xx(t).map(Ay);
    }
    function GD(t, { displayName: e, length: n }) {
        if (!Xn(n)) throw new Error(`Expected bitLength information for ${e || t.constructor.name}<bitLength>`);
        return t.with(n, e);
    }
    function ZD(t, e) {
        const [n, r] = Gk(e);
        return t.with(n, r);
    }
    function cf(t, e) {
        return t.with(eY(e));
    }
    const WWe = {
        [Se.BTreeMap]: (t, e)=>ZD(VA, e),
        [Se.BTreeSet]: (t, e)=>cf(DA, e),
        [Se.Compact]: (t, e)=>cf(Ey, e),
        [Se.DoNotConstruct]: (t, e)=>Z3.with(e.displayName || e.type),
        [Se.Enum]: (t, e)=>{
            const n = xx(e);
            return fa.with(n.every(({ type: r })=>r === "Null") ? n.reduce((r, { index: s, name: i }, o)=>{
                if (!i) throw new Error("No name found in sub definition");
                return r[i] = s || o, r;
            }, {}) : XD(e));
        },
        [Se.HashMap]: (t, e)=>ZD(BA, e),
        [Se.Int]: (t, e)=>GD(Su, e),
        [Se.Linkage]: (t, e)=>{
            const n = `Option<${eY(e)}>`, r = Gr.with({
                previous: n,
                next: n
            });
            return r.prototype.toRawType = function() {
                return `Linkage<${this.next.toRawType(!0)}>`;
            }, r;
        },
        [Se.Null]: (t, e)=>Nc,
        [Se.Option]: (t, e)=>{
            if (!e.sub || Array.isArray(e.sub)) throw new Error("Expected type information for Option");
            return cf(Dd, e);
        },
        [Se.Plain]: (t, e)=>t.getOrUnknown(e.type),
        [Se.Range]: (t, e)=>cf(Y3, e),
        [Se.RangeInclusive]: (t, e)=>cf(FA, e),
        [Se.Result]: (t, e)=>{
            const [n, r] = Gk(e);
            return MA.with({
                Err: r,
                Ok: n
            });
        },
        [Se.Set]: (t, e)=>zA.with(xx(e).reduce((n, { index: r, name: s })=>{
                if (!s || !Xn(r)) throw new Error("No name found in sub definition");
                return n[s] = r, n;
            }, {}), e.length),
        [Se.Si]: (t, e)=>tY(t, t.lookup.getTypeDef(e.type)),
        [Se.Struct]: (t, e)=>Gr.with(XD(e), e.alias),
        [Se.Tuple]: (t, e)=>eb.with(Gk(e)),
        [Se.UInt]: (t, e)=>GD(ku, e),
        [Se.Vec]: (t, { sub: e })=>{
            if (!e || Array.isArray(e)) throw new Error("Expected type information for vector");
            return e.type === "u8" ? J3 : RA.with(Ay(e));
        },
        [Se.VecFixed]: (t, { displayName: e, length: n, sub: r })=>{
            if (!Xn(n) || !r || Array.isArray(r)) throw new Error("Expected length & type information for fixed vector");
            return r.type === "u8" ? Gd.with(n * 8, e) : NA.with(Ay(r), n);
        },
        [Se.WrapperKeepOpaque]: (t, e)=>cf(Q3, e),
        [Se.WrapperOpaque]: (t, e)=>cf(LA, e)
    };
    function KWe(t, e) {
        try {
            const n = WWe[e.info](t, e);
            if (!n) throw new Error("No class created");
            return !n.__fallbackType && e.fallbackType && (n.__fallbackType = e.fallbackType), n;
        } catch (n) {
            throw new Error(`Unable to construct class from ${vn(e)}: ${n.message}`);
        }
    }
    function tY(t, e) {
        return t.getUnsafe(e.type, !1, e);
    }
    function Im(t, e) {
        return t.getUnsafe(e) || tY(t, t.isLookupType(e) ? t.lookup.getTypeDef(e) : Tu(e));
    }
    function JD(t, e) {
        const n = t.toU8a(), r = t.toRawType();
        if (!(tJ(n, e) || [
            "Bytes",
            "Text",
            "Type"
        ].includes(r) && e.length === t.length || t.isEmpty && e.every((i)=>!i))) throw new Error(`${r}:: Decoded input doesn't match input, received ${nn(e, 512)} (${e.length} bytes), created ${nn(n, 512)} (${n.length} bytes)`);
    }
    function $We(t, [e]) {
        Bt(e) ? JD(t, e) : Fn(e) && JD(t, Dt(e));
    }
    function YD(t, e, n = [], { blockHash: r, isFallback: s, isOptional: i, isPedantic: o } = {}) {
        const a = new (i ? Dd.with(e) : e)(t, ...n);
        return o && $We(a, n), r && (a.createdAtHash = Zk(t, "BlockHash", [
            r
        ])), s && (a.isStorageFallback = !0), a;
    }
    function Zk(t, e, n = [], r = {}) {
        let s = null, i = null;
        try {
            return s = Im(t, e), YD(t, s, n, r);
        } catch (o) {
            i = new Error(`createType(${e}):: ${o.message}`);
        }
        if (s?.__fallbackType) try {
            return s = Im(t, s.__fallbackType), YD(t, s, n, r);
        } catch  {}
        throw i;
    }
    const XWe = (t)=>t.toString(), GWe = [
        "BTreeMap",
        "BTreeSet",
        "Compact",
        "HashMap",
        "Option",
        "Result",
        "Vec"
    ];
    function ZWe(t, e, n = XWe) {
        return `${t}${e ? `<${(Array.isArray(e) ? e : [
            e
        ]).map(n).join(", ")}>` : ""}`;
    }
    function Bo(t, e, n) {
        const { info: r, sub: s } = e;
        switch(r){
            case Se.BTreeMap:
            case Se.BTreeSet:
            case Se.Compact:
            case Se.HashMap:
            case Se.Linkage:
            case Se.Option:
            case Se.Range:
            case Se.RangeInclusive:
            case Se.Result:
            case Se.Vec:
            case Se.WrapperKeepOpaque:
            case Se.WrapperOpaque:
                return ZWe(n, s, (i)=>UA(t, i));
        }
        throw new Error(`Unable to encode ${vn(e)} with params`);
    }
    function QD(t, e, n, r) {
        const s = e.map(({ name: o })=>o);
        if (!s.every((o)=>!!o)) throw new Error(`Subtypes does not have consistent names, ${s.join(", ")}`);
        const i = Ye({}, r);
        for(let o = 0, a = e.length; o < a; o++){
            const c = e[o];
            if (!c.name) throw new Error(`No name found in ${vn(c)}`);
            i[c.name] = UA(t, c);
        }
        return vn(n ? {
            _enum: i
        } : i);
    }
    const JWe = {
        [Se.BTreeMap]: (t, e)=>Bo(t, e, "BTreeMap"),
        [Se.BTreeSet]: (t, e)=>Bo(t, e, "BTreeSet"),
        [Se.Compact]: (t, e)=>Bo(t, e, "Compact"),
        [Se.DoNotConstruct]: (t, { displayName: e, lookupIndex: n, lookupName: r })=>`DoNotConstruct<${r || e || (Rr(n) ? "Unknown" : t.createLookupType(n))}>`,
        [Se.Enum]: (t, { sub: e })=>{
            if (!Array.isArray(e)) throw new Error("Unable to encode Enum type");
            return e.every(({ type: n })=>n === "Null") ? vn({
                _enum: e.map(({ name: n }, r)=>`${n || `Empty${r}`}`)
            }) : QD(t, e, !0);
        },
        [Se.HashMap]: (t, e)=>Bo(t, e, "HashMap"),
        [Se.Int]: (t, { length: e = 32 })=>`Int<${e}>`,
        [Se.Linkage]: (t, e)=>Bo(t, e, "Linkage"),
        [Se.Null]: (t, e)=>"Null",
        [Se.Option]: (t, e)=>Bo(t, e, "Option"),
        [Se.Plain]: (t, { displayName: e, type: n })=>e || n,
        [Se.Range]: (t, e)=>Bo(t, e, "Range"),
        [Se.RangeInclusive]: (t, e)=>Bo(t, e, "RangeInclusive"),
        [Se.Result]: (t, e)=>Bo(t, e, "Result"),
        [Se.Set]: (t, { length: e = 8, sub: n })=>{
            if (!Array.isArray(n)) throw new Error("Unable to encode Set type");
            return vn({
                _set: n.reduce((r, { index: s, name: i }, o)=>Ye(r, {
                        [`${i || `Unknown${s || o}`}`]: s || o
                    }), {
                    _bitLength: e || 8
                })
            });
        },
        [Se.Si]: (t, { lookupName: e, type: n })=>e || n,
        [Se.Struct]: (t, { alias: e, sub: n })=>{
            if (!Array.isArray(n)) throw new Error("Unable to encode Struct type");
            return QD(t, n, !1, e ? {
                _alias: [
                    ...e.entries()
                ].reduce((r, [s, i])=>Ye(r, {
                        [s]: i
                    }), {})
            } : {});
        },
        [Se.Tuple]: (t, { sub: e })=>{
            if (!Array.isArray(e)) throw new Error("Unable to encode Tuple type");
            return `(${e.map((n)=>UA(t, n)).join(",")})`;
        },
        [Se.UInt]: (t, { length: e = 32 })=>`UInt<${e}>`,
        [Se.Vec]: (t, e)=>Bo(t, e, "Vec"),
        [Se.VecFixed]: (t, { length: e, sub: n })=>{
            if (!Xn(e) || !n || Array.isArray(n)) throw new Error("Unable to encode VecFixed type");
            return `[${n.type};${e}]`;
        },
        [Se.WrapperKeepOpaque]: (t, e)=>Bo(t, e, "WrapperKeepOpaque"),
        [Se.WrapperOpaque]: (t, e)=>Bo(t, e, "WrapperOpaque")
    };
    function nY(t, e, n = !0) {
        return n && e.lookupName ? e.lookupName : JWe[e.info](t, e);
    }
    function UA(t, e) {
        return e.displayName && !GWe.some((n)=>e.displayName === n) ? e.displayName : nY(t, e);
    }
    function so(t, e) {
        return Ye({}, e, {
            type: nY(t, e, !1)
        });
    }
    const YWe = [
        "AssetInstance",
        "Fungibility",
        "Junction",
        "Junctions",
        "MultiAsset",
        "MultiAssetFilter",
        "MultiLocation",
        "Response",
        "WildFungibility",
        "WildMultiAsset",
        "Xcm",
        "XcmError"
    ];
    function Zi(t) {
        return YWe.reduce((e, n)=>Ye(e, {
                [n]: `${n}${t}`
            }), {});
    }
    const QWe = {
        FungibilityV0: "FungibilityV1",
        WildFungibilityV0: "WildFungibilityV1",
        AssetInstanceV0: {
            _enum: {
                Undefined: "Null",
                Index8: "u8",
                Index16: "Compact<u16>",
                Index32: "Compact<u32>",
                Index64: "Compact<u64>",
                Index128: "Compact<u128>",
                Array4: "[u8; 4]",
                Array8: "[u8; 8]",
                Array16: "[u8; 16]",
                Array32: "[u8; 32]",
                Blob: "Vec<u8>"
            }
        },
        JunctionV0: {
            _enum: {
                Parent: "Null",
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "NetworkId",
                    id: "AccountId"
                },
                AccountIndex64: {
                    network: "NetworkId",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "NetworkId",
                    key: "[u8; 20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: "Vec<u8>",
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyId",
                    part: "BodyPart"
                }
            }
        },
        MultiAssetV0: {
            _enum: {
                None: "Null",
                All: "Null",
                AllFungible: "Null",
                AllNonFungible: "Null",
                AllAbstractFungible: "Vec<u8>",
                AllAbstractNonFungible: "Vec<u8>",
                AllConcreteFungible: "MultiLocationV0",
                AllConcreteNonFungible: "MultiLocationV0",
                AbstractFungible: {
                    id: "Vec<u8>",
                    instance: "Compact<u128>"
                },
                AbstractNonFungible: {
                    class: "Vec<u8>",
                    instance: "AssetInstanceV0"
                },
                ConcreteFungible: {
                    id: "MultiLocationV0",
                    amount: "Compact<u128>"
                },
                ConcreteNonFungible: {
                    class: "MultiLocationV0",
                    instance: "AssetInstanceV0"
                }
            }
        },
        MultiLocationV0: {
            _enum: {
                Here: "Null",
                X1: "JunctionV0",
                X2: "(JunctionV0, JunctionV0)",
                X3: "(JunctionV0, JunctionV0, JunctionV0)",
                X4: "(JunctionV0, JunctionV0, JunctionV0, JunctionV0)",
                X5: "(JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0)",
                X6: "(JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0)",
                X7: "(JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0)",
                X8: "(JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0, JunctionV0)"
            }
        },
        OriginKindV0: {
            _enum: [
                "Native",
                "SovereignAccount",
                "Superuser",
                "Xcm"
            ]
        },
        ResponseV0: {
            _enum: {
                Assets: "Vec<MultiAssetV0>"
            }
        },
        XcmV0: {
            _enum: {
                WithdrawAsset: {
                    assets: "Vec<MultiAssetV0>",
                    effects: "Vec<XcmOrderV0>"
                },
                ReserveAssetDeposit: {
                    assets: "Vec<MultiAssetV0>",
                    effects: "Vec<XcmOrderV0>"
                },
                ReceiveTeleportedAsset: {
                    assets: "Vec<MultiAssetV0>",
                    effects: "Vec<XcmOrderV0>"
                },
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV0"
                },
                TransferAsset: {
                    assets: "Vec<MultiAssetV0>",
                    dest: "MultiLocationV0"
                },
                TransferReserveAsset: {
                    assets: "Vec<MultiAssetV0>",
                    dest: "MultiLocationV0",
                    effects: "Vec<XcmOrderV0>"
                },
                Transact: {
                    originType: "XcmOriginKind",
                    requireWeightAtMost: "u64",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                RelayedFrom: {
                    who: "MultiLocationV0",
                    message: "XcmV0"
                }
            }
        },
        XcmErrorV0: {
            _enum: {
                Undefined: "Null",
                Overflow: "Null",
                Unimplemented: "Null",
                UnhandledXcmVersion: "Null",
                UnhandledXcmMessage: "Null",
                UnhandledEffect: "Null",
                EscalationOfPrivilege: "Null",
                UntrustedReserveLocation: "Null",
                UntrustedTeleportLocation: "Null",
                DestinationBufferOverflow: "Null",
                SendFailed: "Null",
                CannotReachDestination: "(MultiLocation, Xcm)",
                MultiLocationFull: "Null",
                FailedToDecode: "Null",
                BadOrigin: "Null",
                ExceedsMaxMessageSize: "Null",
                FailedToTransactAsset: "Null",
                WeightLimitReached: "Weight",
                Wildcard: "Null",
                TooMuchWeightRequired: "Null",
                NotHoldingFees: "Null",
                WeightNotComputable: "Null",
                Barrier: "Null",
                NotWithdrawable: "Null",
                LocationCannotHold: "Null",
                TooExpensive: "Null",
                AssetNotFound: "Null",
                RecursionLimitReached: "Null"
            }
        },
        XcmOrderV0: {
            _enum: {
                Null: "Null",
                DepositAsset: {
                    assets: "Vec<MultiAssetV0>",
                    dest: "MultiLocationV0"
                },
                DepositReserveAsset: {
                    assets: "Vec<MultiAssetV0>",
                    dest: "MultiLocationV0",
                    effects: "Vec<XcmOrderV0>"
                },
                ExchangeAsset: {
                    give: "Vec<MultiAssetV0>",
                    receive: "Vec<MultiAssetV0>"
                },
                InitiateReserveWithdraw: {
                    assets: "Vec<MultiAssetV0>",
                    reserve: "MultiLocationV0",
                    effects: "Vec<XcmOrderV0>"
                },
                InitiateTeleport: {
                    assets: "Vec<MultiAssetV0>",
                    dest: "MultiLocationV0",
                    effects: "Vec<XcmOrderV0>"
                },
                QueryHolding: {
                    queryId: "Compact<u64>",
                    dest: "MultiLocationV0",
                    assets: "Vec<MultiAssetV0>"
                },
                BuyExecution: {
                    fees: "MultiAssetV0",
                    weight: "u64",
                    debt: "u64",
                    haltOnError: "bool",
                    xcm: "Vec<XcmV0>"
                }
            }
        }
    }, eKe = {
        AssetInstanceV1: {
            _enum: {
                Undefined: "Null",
                Index: "Compact<u128>",
                Array4: "[u8; 4]",
                Array8: "[u8; 8]",
                Array16: "[u8; 16]",
                Array32: "[u8; 32]",
                Blob: "Bytes"
            }
        },
        FungibilityV1: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV1"
            }
        },
        JunctionV1: {
            _enum: {
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "NetworkId",
                    id: "AccountId"
                },
                AccountIndex64: {
                    network: "NetworkId",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "NetworkId",
                    key: "[u8; 20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: "Vec<u8>",
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyId",
                    part: "BodyPart"
                }
            }
        },
        JunctionsV1: {
            _enum: {
                Here: "Null",
                X1: "JunctionV1",
                X2: "(JunctionV1, JunctionV1)",
                X3: "(JunctionV1, JunctionV1, JunctionV1)",
                X4: "(JunctionV1, JunctionV1, JunctionV1, JunctionV1)",
                X5: "(JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1)",
                X6: "(JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1)",
                X7: "(JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1)",
                X8: "(JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1, JunctionV1)"
            }
        },
        MultiAssetsV1: "Vec<MultiAssetV1>",
        MultiAssetV1: {
            id: "XcmAssetId",
            fungibility: "FungibilityV1"
        },
        MultiAssetFilterV1: {
            _enum: {
                Definite: "MultiAssetsV1",
                Wild: "WildMultiAssetV1"
            }
        },
        MultiLocationV1: {
            parents: "u8",
            interior: "JunctionsV1"
        },
        OriginKindV1: "OriginKindV0",
        ResponseV1: {
            _enum: {
                Assets: "MultiAssetsV1"
            }
        },
        WildFungibilityV1: {
            _enum: [
                "Fungible",
                "NonFungible"
            ]
        },
        WildMultiAssetV1: {
            _enum: {
                All: "Null",
                AllOf: {
                    id: "XcmAssetId",
                    fungibility: "WildFungibilityV1"
                }
            }
        },
        XcmV1: {
            _enum: {
                WithdrawAsset: {
                    assets: "MultiAssetsV1",
                    effects: "Vec<XcmOrderV1>"
                },
                ReserveAssetDeposit: {
                    assets: "MultiAssetsV1",
                    effects: "Vec<XcmOrderV1>"
                },
                ReceiveTeleportedAsset: {
                    assets: "MultiAssetsV1",
                    effects: "Vec<XcmOrderV1>"
                },
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV1"
                },
                TransferAsset: {
                    assets: "MultiAssetsV1",
                    dest: "MultiLocationV1"
                },
                TransferReserveAsset: {
                    assets: "MultiAssetsV1",
                    dest: "MultiLocationV1",
                    effects: "Vec<XcmOrderV1>"
                },
                Transact: {
                    originType: "XcmOriginKind",
                    requireWeightAtMost: "u64",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                RelayedFrom: {
                    who: "MultiLocationV1",
                    message: "XcmV1"
                }
            }
        },
        XcmErrorV1: {
            _enum: {
                Undefined: "Null",
                Overflow: "Null",
                Unimplemented: "Null",
                UnhandledXcmVersion: "Null",
                UnhandledXcmMessage: "Null",
                UnhandledEffect: "Null",
                EscalationOfPrivilege: "Null",
                UntrustedReserveLocation: "Null",
                UntrustedTeleportLocation: "Null",
                DestinationBufferOverflow: "Null",
                SendFailed: "Null",
                CannotReachDestination: "(MultiLocationV1, XcmV1)",
                MultiLocationFull: "Null",
                FailedToDecode: "Null",
                BadOrigin: "Null",
                ExceedsMaxMessageSize: "Null",
                FailedToTransactAsset: "Null",
                WeightLimitReached: "Weight",
                Wildcard: "Null",
                TooMuchWeightRequired: "Null",
                NotHoldingFees: "Null",
                WeightNotComputable: "Null",
                Barrier: "Null",
                NotWithdrawable: "Null",
                LocationCannotHold: "Null",
                TooExpensive: "Null",
                AssetNotFound: "Null",
                DestinationUnsupported: "Null",
                RecursionLimitReached: "Null"
            }
        },
        XcmOrderV1: {
            _enum: {
                Noop: "Null",
                DepositAsset: {
                    assets: "MultiAssetFilterV1",
                    maxAssets: "u32",
                    beneficiary: "MultiLocationV1"
                },
                DepositReserveAsset: {
                    assets: "MultiAssetFilterV1",
                    maxAssets: "u32",
                    dest: "MultiLocationV1",
                    effects: "Vec<XcmOrderV1>"
                },
                ExchangeAsset: {
                    give: "MultiAssetFilterV1",
                    receive: "MultiAssetsV1"
                },
                InitiateReserveWithdraw: {
                    assets: "MultiAssetFilterV1",
                    reserve: "MultiLocationV1",
                    effects: "Vec<XcmOrderV1>"
                },
                InitiateTeleport: {
                    assets: "MultiAssetFilterV1",
                    dest: "MultiLocationV1",
                    effects: "Vec<XcmOrderV1>"
                },
                QueryHolding: {
                    queryId: "Compact<u64>",
                    dest: "MultiLocationV1",
                    assets: "MultiAssetFilterV1"
                },
                BuyExecution: {
                    fees: "MultiAssetV1",
                    weight: "u64",
                    debt: "u64",
                    haltOnError: "bool",
                    instructions: "Vec<XcmV1>"
                }
            }
        }
    }, tKe = {
        AssetIdV2: {
            _enum: {
                Concrete: "MultiLocationV2",
                Abstract: "Bytes"
            }
        },
        AssetInstanceV2: {
            _enum: {
                Undefined: "Null",
                Index: "Compact<u128>",
                Array4: "[u8;4]",
                Array8: "[u8;8]",
                Array16: "[u8;16]",
                Array32: "[u8;32]",
                Blob: "Bytes"
            }
        },
        BodyIdV2: {
            _enum: {
                Unit: "Null",
                Named: "Bytes",
                Index: "Compact<u32>",
                Executive: "Null",
                Technical: "Null",
                Legislative: "Null",
                Judicial: "Null",
                Defense: "Null",
                Administration: "Null",
                Treasury: "Null"
            }
        },
        BodyPartV2: {
            _enum: {
                Voice: "Null",
                Members: {
                    count: "Compact<u32>"
                },
                Fraction: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                AtLeastProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                MoreThanProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                }
            }
        },
        NetworkIdV2: {
            _enum: {
                Any: "Null",
                Named: "Bytes",
                Polkadot: "Null",
                Kusama: "Null"
            }
        },
        JunctionV2: {
            _enum: {
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "NetworkIdV2",
                    id: "[u8; 32]"
                },
                AccountIndex64: {
                    network: "NetworkIdV2",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "NetworkIdV2",
                    key: "[u8; 20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: "Bytes",
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyIdV2",
                    part: "BodyPartV2"
                }
            }
        },
        JunctionsV2: {
            _enum: {
                Here: "Null",
                X1: "JunctionV2",
                X2: "(JunctionV2, JunctionV2)",
                X3: "(JunctionV2, JunctionV2, JunctionV2)",
                X4: "(JunctionV2, JunctionV2, JunctionV2, JunctionV2)",
                X5: "(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)",
                X6: "(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)",
                X7: "(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)",
                X8: "(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)"
            }
        },
        FungibilityV2: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV2"
            }
        },
        InteriorMultiLocationV2: "JunctionsV2",
        MultiAssetV2: {
            id: "AssetIdV2",
            fun: "FungibilityV2"
        },
        MultiAssetsV2: "Vec<MultiAssetV2>",
        MultiAssetFilterV2: {
            _enum: {
                Definite: "MultiAssetsV2",
                Wild: "WildMultiAssetV2"
            }
        },
        MultiLocationV2: {
            parents: "u8",
            interior: "JunctionsV2"
        },
        OriginKindV2: {
            _enum: {
                Native: "Null",
                SovereignAccount: "Null",
                Superuser: "Null",
                Xcm: "Null"
            }
        },
        WildFungibilityV2: {
            _enum: {
                Fungible: "Null",
                NonFungible: "Null"
            }
        },
        ResponseV2: {
            _enum: {
                Null: "Null",
                Assets: "MultiAssetsV2",
                ExecutionResult: "Option<(u32, XcmErrorV2)>",
                Version: "u32"
            }
        },
        ResponseV2Error: "(u32, XcmErrorV2)",
        WeightLimitV2: {
            _enum: {
                Unlimited: "Null",
                Limited: "Compact<u64>"
            }
        },
        InstructionV2: {
            _enum: {
                WithdrawAsset: "MultiAssetsV2",
                ReserveAssetDeposited: "MultiAssetsV2",
                ReceiveTeleportedAsset: "MultiAssetsV2",
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV2",
                    maxWeight: "Compact<u64>"
                },
                TransferAsset: {
                    assets: "MultiAssetsV2",
                    beneficiary: "MultiLocationV2"
                },
                TransferReserveAsset: {
                    assets: "MultiAssetsV2",
                    dest: "MultiLocationV2",
                    xcm: "XcmV2"
                },
                Transact: {
                    originType: "XcmOriginKind",
                    requireWeightAtMost: "Compact<u64>",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                ClearOrigin: "Null",
                DescendOrigin: "InteriorMultiLocationV2",
                ReportError: {
                    queryId: "Compact<u64>",
                    dest: "MultiLocationV2",
                    maxResponseWeight: "Compact<u64>"
                },
                DepositAsset: {
                    assets: "MultiAssetFilterV2",
                    maxAssets: "Compact<u32>",
                    beneficiary: "MultiLocationV2"
                },
                DepositReserveAsset: {
                    assets: "MultiAssetFilterV2",
                    maxAssets: "Compact<u32>",
                    dest: "MultiLocationV2",
                    xcm: "XcmV2"
                },
                ExchangeAsset: {
                    give: "MultiAssetFilterV2",
                    receive: "MultiAssetsV2"
                },
                InitiateReserveWithdraw: {
                    assets: "MultiAssetFilterV2",
                    reserve: "MultiLocationV2",
                    xcm: "XcmV2"
                },
                InitiateTeleport: {
                    assets: "MultiAssetFilterV2",
                    dest: "MultiLocationV2",
                    xcm: "XcmV2"
                },
                QueryHolding: {
                    queryId: "Compact<u64>",
                    dest: "MultiLocationV2",
                    assets: "MultiAssetFilterV2",
                    maxResponseWeight: "Compact<u64>"
                },
                BuyExecution: {
                    fees: "MultiAssetV2",
                    weightLimit: "WeightLimitV2"
                },
                RefundSurplus: "Null",
                SetErrorHandler: "XcmV2<RuntimeCall>",
                SetAppendix: "XcmV2<RuntimeCall>",
                ClearError: "Null",
                ClaimAsset: {
                    assets: "MultiAssetsV2",
                    ticket: "MultiLocationV2"
                },
                Trap: "Compact<u64>",
                SubscribeVersion: {
                    queryId: "Compact<u64>",
                    maxResponseWeight: "Compact<u64>"
                },
                UnsubscribeVersion: "Null"
            }
        },
        WildMultiAssetV2: {
            _enum: {
                All: "Null",
                AllOf: {
                    id: "AssetIdV2",
                    fun: "WildFungibilityV2"
                }
            }
        },
        XcmV2: "Vec<InstructionV2>",
        XcmErrorV2: {
            _enum: {
                Overflow: "Null",
                Unimplemented: "Null",
                UntrustedReserveLocation: "Null",
                UntrustedTeleportLocation: "Null",
                MultiLocationFull: "Null",
                MultiLocationNotInvertible: "Null",
                BadOrigin: "Null",
                InvalidLocation: "Null",
                AssetNotFound: "Null",
                FailedToTransactAsset: "Null",
                NotWithdrawable: "Null",
                LocationCannotHold: "Null",
                ExceedsMaxMessageSize: "Null",
                DestinationUnsupported: "Null",
                Transport: "Null",
                Unroutable: "Null",
                UnknownClaim: "Null",
                FailedToDecode: "Null",
                MaxWeightInvalid: "Null",
                NotHoldingFees: "Null",
                TooExpensive: "Null",
                Trap: "u64",
                UnhandledXcmVersion: "Null",
                WeightLimitReached: "Weight",
                Barrier: "Null",
                WeightNotComputable: "Null"
            }
        }
    }, nKe = {
        AssetIdV3: {
            _enum: {
                Concrete: "MultiLocationV3",
                Abstract: "Bytes"
            }
        },
        BodyIdV3: {
            _enum: {
                Unit: "Null",
                Moniker: "[u8;4]",
                Index: "Compact<u32>",
                Executive: "Null",
                Technical: "Null",
                Legislative: "Null",
                Judicial: "Null",
                Defense: "Null",
                Administration: "Null",
                Treasury: "Null"
            }
        },
        BodyPartV3: {
            _enum: {
                Voice: "Null",
                Members: {
                    count: "Compact<u32>"
                },
                Fraction: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                AtLeastProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                MoreThanProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                }
            }
        },
        AssetInstanceV3: {
            _enum: {
                Undefined: "Null",
                Index: "Compact<u128>",
                Array4: "[u8;4]",
                Array8: "[u8;8]",
                Array16: "[u8;16]",
                Array32: "[u8;32]"
            }
        },
        FungibilityV3: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV3"
            }
        },
        InteriorMultiLocationV3: "JunctionsV3",
        JunctionV3: {
            _enum: {
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "Option<NetworkIdV3>",
                    id: "[u8;32]"
                },
                AccountIndex64: {
                    network: "Option<NetworkIdV3>",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "Option<NetworkIdV3>",
                    key: "[u8;20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: {
                    length: "u8",
                    data: "[u8;32]"
                },
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyIdV3",
                    part: "BodyPartV3"
                },
                GlobalConsensus: "NetworkIdV3"
            }
        },
        JunctionsV3: {
            _enum: {
                Here: "Null",
                X1: "JunctionV3",
                X2: "(JunctionV3, JunctionV3)",
                X3: "(JunctionV3, JunctionV3, JunctionV3)",
                X4: "(JunctionV3, JunctionV3, JunctionV3, JunctionV3)",
                X5: "(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)",
                X6: "(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)",
                X7: "(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)",
                X8: "(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)"
            }
        },
        MaybeErrorCodeV3: {
            _enum: {
                Success: "Null",
                Error: "Bytes",
                TruncatedError: "Bytes"
            }
        },
        MaxPalletsInfo: "u32",
        MultiAssetV3: {
            id: "AssetIdV3",
            fun: "FungibilityV3"
        },
        MultiAssetsV3: "Vec<MultiAssetV3>",
        MultiAssetFilterV3: {
            _enum: {
                Definite: "MultiAssetsV3",
                Wild: "WildMultiAssetV3"
            }
        },
        MultiLocationV3: {
            parents: "u8",
            interior: "JunctionsV3"
        },
        MaxPalletNameLen: "u32",
        NetworkIdV3: {
            _enum: {
                ByGenesis: "[u8;32]",
                ByFork: {
                    blockNumber: "u64",
                    blockHash: "[u8;32]"
                },
                Polkadot: "Null",
                Kusama: "Null",
                Westend: "Null",
                Rococo: "Null",
                Wococo: "Null",
                Ethereum: {
                    chainId: "Compact<u64>"
                },
                BitcoinCore: "Null",
                BitcoinCash: "Null",
                PolkadotBulletin: "Null"
            }
        },
        OriginKindV3: "OriginKindV2",
        PalletInfoV3: {
            index: "Compact<u32>",
            name: "Bytes",
            moduleName: "Bytes",
            major: "Compact<u32>",
            minor: "Compact<u32>",
            patch: "Compact<u32>"
        },
        WildFungibilityV3: "WildFungibilityV2",
        QueryResponseInfoV3: {
            destination: "MultiLocationV3",
            queryId: "Compact<u64>",
            maxWeight: "WeightV2"
        },
        ResponseV3: {
            _enum: {
                Null: "Null",
                Assets: "MultiAssetsV3",
                ExecutionResult: "Option<(u32,XcmErrorV3)>",
                Version: "u32",
                PalletsInfo: "Vec<PalletInfoV3>",
                DispatchResult: "MaybeErrorCodeV3"
            }
        },
        XcmErrorV3: {
            _enum: {
                Overflow: "Null",
                Unimplemented: "Null",
                UntrustedReserveLocation: "Null",
                UntrustedTeleportLocation: "Null",
                LocationFull: "Null",
                LocationNotInvertible: "Null",
                BadOrigin: "Null",
                InvalidLocation: "Null",
                AssetNotFound: "Null",
                FailedToTransactAsset: "Null",
                NotWithdrawable: "Null",
                LocationCannotHold: "Null",
                ExceedsMaxMessageSize: "Null",
                DestinationUnsupported: "Null",
                Transport: "Null",
                Unroutable: "Null",
                UnknownClaim: "Null",
                FailedToDecode: "Null",
                MaxWeightInvalid: "Null",
                NotHoldingFees: "Null",
                TooExpensive: "Null",
                Trap: "u64",
                ExpectationFalse: "Null",
                PalletNotFound: "Null",
                NameMismatch: "Null",
                VersionIncompatible: "Null",
                HoldingWouldOverflow: "Null",
                ExportError: "Null",
                ReanchorFailed: "Null",
                NoDeal: "Null",
                FeesNotMet: "Null",
                LockError: "Null",
                NoPermission: "Null",
                Unanchored: "Null",
                NotDepositable: "Null",
                UnhandledXcmVersion: "Null",
                WeightLimitReached: "WeightV2",
                Barrier: "Null",
                ExceedsStackLimit: "Null"
            }
        },
        ResponseV3Error: "(u32, XcmErrorV3)",
        ResponseV3Result: "Option<(u32, ResponseV3Error)>",
        WeightLimitV3: {
            _enum: {
                Unlimited: "Null",
                Limited: "WeightV2"
            }
        },
        InstructionV3: {
            _enum: {
                WithdrawAsset: "MultiAssetsV3",
                ReserveAssetDeposited: "MultiAssetsV3",
                ReceiveTeleportedAsset: "MultiAssetsV3",
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV3",
                    maxWeight: "WeightV2",
                    querier: "Option<MultiLocationV3>"
                },
                TransferAsset: {
                    assets: "MultiAssetsV3",
                    beneficiary: "MultiLocationV3"
                },
                TransferReserveAsset: {
                    assets: "MultiAssetsV3",
                    dest: "MultiLocationV3",
                    xcm: "XcmV3"
                },
                Transact: {
                    originKind: "XcmOriginKind",
                    requireWeightAtMost: "WeightV2",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                ClearOrigin: "Null",
                DescendOrigin: "JunctionsV3",
                ReportError: "QueryResponseInfoV3",
                DepositAsset: {
                    assets: "MultiAssetFilterV3",
                    beneficiary: "MultiLocationV3"
                },
                DepositReserveAsset: {
                    assets: "MultiAssetFilterV3",
                    dest: "MultiLocationV3",
                    xcm: "XcmV3"
                },
                ExchangeAsset: {
                    give: "MultiAssetFilterV3",
                    want: "MultiAssetsV3",
                    maximal: "bool"
                },
                InitiateReserveWithdraw: {
                    assets: "MultiAssetFilterV3",
                    reserve: "MultiLocationV3",
                    xcm: "XcmV3"
                },
                InitiateTeleport: {
                    assets: "MultiAssetFilterV3",
                    dest: "MultiLocationV3",
                    xcm: "XcmV3"
                },
                ReportHolding: {
                    responseInfo: "QueryResponseInfoV3",
                    assets: "MultiAssetFilterV3"
                },
                BuyExecution: {
                    fees: "MultiAssetV3",
                    weightLimit: "WeightLimitV3"
                },
                RefundSurplus: "Null",
                SetErrorHandler: "XcmV3<RuntimeCall>",
                SetAppendix: "XcmV3<RuntimeCall>",
                ClearError: "Null",
                ClaimAsset: {
                    assets: "MultiAssetsV3",
                    ticket: "MultiLocationV3"
                },
                Trap: "Compact<u64>",
                SubscribeVersion: {
                    queryId: "Compact<u64>",
                    maxResponseWeight: "WeightV2"
                },
                UnsubscribeVersion: "Null",
                BurnAsset: "MultiAssetsV3",
                ExpectAsset: "MultiAssetsV3",
                ExpectOrigin: "Option<MultiLocationV3>",
                ExpectError: "Option<(u32, XcmErrorV3)>",
                ExpectTransactStatus: "MaybeErrorCodeV3",
                QueryPallet: {
                    moduleName: "Vec<u8>",
                    responseInfo: "QueryResponseInfoV3"
                },
                ExpectPallet: {
                    index: "Compact<u32>",
                    name: "Vec<u8>",
                    moduleName: "Vec<u8>",
                    crateMajor: "Compact<u32>",
                    minCrateMinor: "Compact<u32>"
                },
                ReportTransactStatus: "QueryResponseInfoV3",
                ClearTransactStatus: "Null",
                UniversalOrigin: "JunctionV3",
                ExportMessage: {
                    network: "NetworkIdV3",
                    destination: "JunctionsV3",
                    xcm: "XcmV3"
                },
                LockAsset: {
                    asset: "MultiAssetV3",
                    unlocker: "MultiLocationV3"
                },
                UnlockAsset: {
                    asset: "MultiAssetV3",
                    target: "MultiLocationV3"
                },
                NoteUnlockable: {
                    asset: "MultiAssetV3",
                    owner: "MultiLocationV3"
                },
                RequestUnlock: {
                    asset: "MultiAssetV3",
                    locker: "MultiLocationV3"
                },
                SetFeesMode: {
                    jitWithdraw: "bool"
                },
                SetTopic: "[u8; 32]",
                ClearTopic: "Null",
                AliasOrigin: "MultiLocationV3",
                UnpaidExecution: {
                    weightLimit: "WeightLimitV3",
                    checkOrigin: "Option<MultiLocationV3>"
                }
            }
        },
        WildMultiAssetV3: {
            _enum: {
                All: "Null",
                AllOf: {
                    id: "AssetIdV3",
                    fun: "WildFungibilityV2"
                },
                AllCounted: "Compact<u32>",
                AllOfCounted: {
                    id: "AssetIdV3",
                    fun: "WildFungibilityV2",
                    count: "Compact<u32>"
                }
            }
        },
        VersionV3: "u32",
        XcmV3: "Vec<InstructionV3>"
    }, rKe = {
        AssetIdV4: "MultiLocationV4",
        AssetInstanceV4: {
            _enum: {
                Undefined: "Null",
                Index: "Compact<u128>",
                Array4: "[u8;4]",
                Array8: "[u8;8]",
                Array16: "[u8;16]",
                Array32: "[u8;32]"
            }
        },
        FungibilityV4: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV4"
            }
        },
        UncheckedFungibilityV4: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV4"
            }
        },
        JunctionV4: {
            _enum: {
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "Option<NetworkIdV4>",
                    id: "[u8;32]"
                },
                AccountIndex64: {
                    network: "Option<NetworkIdV4>",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "Option<NetworkIdV4>",
                    key: "[u8;20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: {
                    length: "u8",
                    data: "[u8;32]"
                },
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyIdV3",
                    part: "BodyPartV3"
                },
                GlobalConsensus: "NetworkIdV4"
            }
        },
        JunctionsV4: {
            _enum: {
                Here: "Null",
                X1: "[JunctionV4;1]",
                X2: "[JunctionV4;2]",
                X3: "[JunctionV4;3]",
                X4: "[JunctionV4;4]",
                X5: "[JunctionV4;5]",
                X6: "[JunctionV4;6]",
                X7: "[JunctionV4;7]",
                X8: "[JunctionV4;8]"
            }
        },
        MaxPalletsInfo: "u32",
        NetworkIdV4: "NetworkIdV3",
        MultiAssetV4: {
            id: "AssetIdV4",
            fun: "FungibilityV4"
        },
        MultiAssetsV4: "Vec<MultiAssetV4>",
        MultiAssetFilterV4: {
            _enum: {
                Definite: "MultiAssetsV4",
                Wild: "WildMultiAssetV4"
            }
        },
        MultiLocationV4: {
            parents: "u8",
            interior: "JunctionsV4"
        },
        OriginKindV4: "XcmOriginKind",
        PalletInfoV4: "PalletInfoV3",
        WildFungibilityV4: "WildFungibilityV2",
        QueryResponseInfoV4: {
            destination: "MultiLocationV4",
            queryId: "Compact<u64>",
            maxWeight: "WeightV2"
        },
        ResponseV4: {
            _enum: {
                Null: "Null",
                Assets: "MultiAssetsV4",
                ExecutionResult: "Option<(u32, XcmErrorV3)>",
                Version: "u32",
                PalletsInfo: "Vec<PalletInfoV4>",
                DispatchResult: "MaybeErrorCodeV3"
            }
        },
        InstructionV4: {
            _enum: {
                WithdrawAsset: "MultiAssetsV4",
                ReserveAssetDeposited: "MultiAssetsV4",
                ReceiveTeleportedAsset: "MultiAssetsV4",
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV4",
                    maxWeight: "WeightV2",
                    querier: "Option<MultiLocationV4>"
                },
                TransferAsset: {
                    assets: "MultiAssetsV4",
                    beneficiary: "MultiLocationV4"
                },
                TransferReserveAsset: {
                    assets: "MultiAssetsV4",
                    dest: "MultiLocationV4",
                    xcm: "XcmV4"
                },
                Transact: {
                    originKind: "OriginKindV4",
                    requireWeightAtMost: "WeightV2",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                ClearOrigin: "Null",
                DescendOrigin: "JunctionsV4",
                ReportError: "QueryResponseInfoV4",
                DepositAsset: {
                    assets: "MultiAssetFilterV4",
                    beneficiary: "MultiLocationV4"
                },
                DepositReserveAsset: {
                    assets: "MultiAssetFilterV4",
                    dest: "MultiLocationV4",
                    xcm: "XcmV4"
                },
                ExchangeAsset: {
                    give: "MultiAssetFilterV4",
                    want: "MultiAssetsV4",
                    maximal: "bool"
                },
                InitiateReserveWithdraw: {
                    assets: "MultiAssetFilterV4",
                    reserve: "MultiLocationV4",
                    xcm: "XcmV4"
                },
                InitiateTeleport: {
                    assets: "MultiAssetFilterV4",
                    dest: "MultiLocationV4",
                    xcm: "XcmV4"
                },
                ReportHolding: {
                    responseInfo: "QueryResponseInfoV4",
                    assets: "MultiAssetFilterV4"
                },
                BuyExecution: {
                    fees: "MultiAssetV4",
                    weightLimit: "WeightLimitV3"
                },
                RefundSurplus: "Null",
                SetErrorHandler: "XcmV4",
                SetAppendix: "XcmV4",
                ClearError: "Null",
                ClaimAsset: {
                    assets: "MultiAssetsV4",
                    ticket: "MultiLocationV4"
                },
                Trap: "Compact<u64>",
                SubscribeVersion: {
                    queryId: "Compact<u64>",
                    maxResponseWeight: "WeightV2"
                },
                UnsubscribeVersion: "Null",
                BurnAsset: "MultiAssetsV4",
                ExpectAsset: "MultiAssetsV4",
                ExpectOrigin: "Option<MultiLocationV4>",
                ExpectError: "Option<(u32, XcmErrorV3)>",
                ExpectTransactStatus: "MaybeErrorCodeV3",
                QueryPallet: {
                    moduleName: "Vec<u8>",
                    responseInfo: "QueryResponseInfoV4"
                },
                ExpectPallet: {
                    index: "Compact<u32>",
                    name: "Vec<u8>",
                    moduleName: "Vec<u8>",
                    crateMajor: "Compact<u32>",
                    minCrateMinor: "Compact<u32>"
                },
                ReportTransactStatus: "QueryResponseInfoV4",
                ClearTransactStatus: "Null",
                UniversalOrigin: "JunctionV4",
                ExportMessage: {
                    network: "NetworkIdV4",
                    destination: "JunctionsV4",
                    xcm: "XcmV4"
                },
                LockAsset: {
                    asset: "MultiAssetV4",
                    unlocker: "MultiLocationV4"
                },
                UnlockAsset: {
                    asset: "MultiAssetV4",
                    target: "MultiLocationV4"
                },
                NoteUnlockable: {
                    asset: "MultiAssetV4",
                    owner: "MultiLocationV4"
                },
                RequestUnlock: {
                    asset: "MultiAssetV4",
                    locker: "MultiLocationV4"
                },
                SetFeesMode: {
                    jitWithdraw: "bool"
                },
                SetTopic: "[u8;32]",
                ClearTopic: "Null",
                AliasOrigin: "MultiLocationV4",
                UnpaidExecution: {
                    weightLimit: "WeightLimitV3",
                    checkOrigin: "Option<MultiLocationV4>"
                }
            }
        },
        OutcomeV4: {
            _enum: {
                Complete: {
                    used: "WeightV2"
                },
                Incomplete: {
                    used: "WeightV2",
                    error: "XcmErrorV3"
                },
                Error: {
                    error: "XcmErrorV3"
                }
            }
        },
        WildMultiAssetV4: {
            _enum: {
                All: "Null",
                AllOf: {
                    id: "AssetIdV4",
                    fun: "WildFungibilityV4"
                },
                AllCounted: "Compact<u32>",
                AllOfCounted: {
                    id: "AssetIdV4",
                    fun: "WildFungibilityV4",
                    count: "Compact<u32>"
                }
            }
        },
        VersionV4: "u32",
        XcmV4: "Vec<InstructionV4>",
        XcmErrorV4: "XcmErrorV3"
    }, sKe = {
        AssetIdV5: "MultiLocationV5",
        AssetInstanceV5: {
            _enum: {
                Undefined: "Null",
                Index: "Compact<u128>",
                Array4: "[u8;4]",
                Array8: "[u8;8]",
                Array16: "[u8;16]",
                Array32: "[u8;32]"
            }
        },
        MultiAssetV5: {
            id: "AssetIdV5",
            fun: "FungibilityV5"
        },
        MultiAssetsV5: "Vec<MultiAssetV5>",
        WildMultiAssetV5: {
            _enum: {
                All: "Null",
                AllOf: {
                    id: "AssetIdV5",
                    fun: "WildFungibilityV5"
                },
                AllCounted: "Compact<u32>",
                AllOfCounted: {
                    id: "AssetIdV5",
                    fun: "WildFungibilityV5",
                    count: "Compact<u32>"
                }
            }
        },
        MultiAssetFilterV5: {
            _enum: {
                Definite: "MultiAssetsV5",
                Wild: "WildMultiAssetV5"
            }
        },
        MultiAssetTransferFilterV5: {
            _enum: {
                Teleport: "MultiAssetFilterV5",
                ReserveDeposit: "MultiAssetFilterV5",
                ReserveWithdraw: "MultiAssetFilterV5"
            }
        },
        FungibilityV5: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV5"
            }
        },
        UncheckedFungibilityV5: {
            _enum: {
                Fungible: "Compact<u128>",
                NonFungible: "AssetInstanceV5"
            }
        },
        WildFungibilityV5: "WildFungibilityV2",
        JunctionV5: {
            _enum: {
                Parachain: "Compact<u32>",
                AccountId32: {
                    network: "Option<NetworkIdV5>",
                    id: "[u8;32]"
                },
                AccountIndex64: {
                    network: "Option<NetworkIdV5>",
                    index: "Compact<u64>"
                },
                AccountKey20: {
                    network: "Option<NetworkIdV5>",
                    key: "[u8;20]"
                },
                PalletInstance: "u8",
                GeneralIndex: "Compact<u128>",
                GeneralKey: {
                    length: "u8",
                    data: "[u8;32]"
                },
                OnlyChild: "Null",
                Plurality: {
                    id: "BodyIdV3",
                    part: "BodyPartV3"
                },
                GlobalConsensus: "NetworkIdV5"
            }
        },
        NetworkIdV5: {
            _enum: {
                ByGenesis: "[u8;32]",
                ByFork: {
                    blockNumber: "u64",
                    blockHash: "[u8;32]"
                },
                Polkadot: "Null",
                Kusama: "Null",
                Ethereum: {
                    chainId: "Compact<u64>"
                },
                BitcoinCore: "Null",
                BitcoinCash: "Null",
                PolkadotBulletin: "Null"
            }
        },
        JunctionsV5: {
            _enum: {
                Here: "Null",
                X1: "[JunctionV5;1]",
                X2: "[JunctionV5;2]",
                X3: "[JunctionV5;3]",
                X4: "[JunctionV5;4]",
                X5: "[JunctionV5;5]",
                X6: "[JunctionV5;6]",
                X7: "[JunctionV5;7]",
                X8: "[JunctionV5;8]"
            }
        },
        MultiLocationV5: {
            parents: "u8",
            interior: "JunctionsV5"
        },
        InteriorMultiLocationV5: "JunctionsV5",
        XcmV5: "Vec<InstructionV5>",
        PalletInfoV5: "PalletInfoV3",
        ResponseV5: {
            _enum: {
                Null: "Null",
                Assets: "MultiAssetsV5",
                ExecutionResult: "Option<(u32, XcmErrorV3)>",
                Version: "u32",
                PalletsInfo: "Vec<PalletInfoV5>",
                DispatchResult: "MaybeErrorCodeV3"
            }
        },
        QueryResponseInfoV5: {
            destination: "MultiLocationV5",
            queryId: "Compact<u64>",
            maxWeight: "WeightV2"
        },
        InstructionV5: {
            _enum: {
                WithdrawAsset: "MultiAssetsV5",
                ReserveAssetDeposited: "MultiAssetsV5",
                ReceiveTeleportedAsset: "MultiAssetsV5",
                QueryResponse: {
                    queryId: "Compact<u64>",
                    response: "ResponseV5",
                    maxWeight: "WeightV2",
                    querier: "Option<MultiLocationV5>"
                },
                TransferAsset: {
                    assets: "MultiAssetsV5",
                    beneficiary: "MultiLocationV5"
                },
                TransferReserveAsset: {
                    assets: "MultiAssetsV5",
                    dest: "MultiLocationV5",
                    xcm: "XcmV5"
                },
                Transact: {
                    originKind: "OriginKindV4",
                    requireWeightAtMost: "WeightV2",
                    call: "DoubleEncodedCall"
                },
                HrmpNewChannelOpenRequest: {
                    sender: "Compact<u32>",
                    maxMessageSize: "Compact<u32>",
                    maxCapacity: "Compact<u32>"
                },
                HrmpChannelAccepted: {
                    recipient: "Compact<u32>"
                },
                HrmpChannelClosing: {
                    initiator: "Compact<u32>",
                    sender: "Compact<u32>",
                    recipient: "Compact<u32>"
                },
                ClearOrigin: "Null",
                DescendOrigin: "InteriorMultiLocationV5",
                ReportError: "QueryResponseInfoV4",
                DepositAsset: {
                    assets: "MultiAssetFilterV5",
                    beneficiary: "MultiLocationV5"
                },
                DepositReserveAsset: {
                    assets: "MultiAssetFilterV5",
                    dest: "MultiLocationV5",
                    xcm: "XcmV5"
                },
                ExchangeAsset: {
                    give: "MultiAssetFilterV5",
                    want: "MultiAssetsV5",
                    maximal: "bool"
                },
                InitiateReserveWithdraw: {
                    assets: "MultiAssetFilterV5",
                    reserve: "MultiLocationV5",
                    xcm: "XcmV5"
                },
                InitiateTeleport: {
                    assets: "MultiAssetFilterV5",
                    dest: "MultiLocationV5",
                    xcm: "XcmV5"
                },
                ReportHolding: {
                    responseInfo: "QueryResponseInfoV4",
                    assets: "MultiAssetFilterV5"
                },
                BuyExecution: {
                    fees: "MultiAssetV4",
                    weightLimit: "WeightLimitV3"
                },
                RefundSurplus: "Null",
                SetErrorHandler: "XcmV5",
                SetAppendix: "XcmV5",
                ClearError: "Null",
                ClaimAsset: {
                    assets: "MultiAssetsV5",
                    ticket: "MultiLocationV5"
                },
                Trap: "Compact<u64>",
                SubscribeVersion: {
                    queryId: "Compact<u64>",
                    maxResponseWeight: "WeightV2"
                },
                UnsubscribeVersion: "Null",
                BurnAsset: "MultiAssetsV5",
                ExpectAsset: "MultiAssetsV5",
                ExpectOrigin: "Option<MultiLocationV5>",
                ExpectError: "Option<(u32, XcmErrorV3)>",
                ExpectTransactStatus: "MaybeErrorCodeV3",
                QueryPallet: {
                    moduleName: "Vec<u8>",
                    responseInfo: "QueryResponseInfoV4"
                },
                ExpectPallet: {
                    index: "Compact<u32>",
                    name: "Vec<u8>",
                    moduleName: "Vec<u8>",
                    crateMajor: "Compact<u32>",
                    minCrateMinor: "Compact<u32>"
                },
                ReportTransactStatus: "QueryResponseInfoV4",
                ClearTransactStatus: "Null",
                UniversalOrigin: "JunctionV5",
                ExportMessage: {
                    network: "NetworkIdV5",
                    destination: "InteriorMultiLocationV5",
                    xcm: "XcmV5"
                },
                LockAsset: {
                    asset: "MultiAssetV5",
                    unlocker: "MultiLocationV5"
                },
                UnlockAsset: {
                    asset: "MultiAssetV5",
                    target: "MultiLocationV5"
                },
                NoteUnlockable: {
                    asset: "MultiAssetV5",
                    owner: "MultiLocationV5"
                },
                RequestUnlock: {
                    asset: "MultiAssetV5",
                    locker: "MultiLocationV5"
                },
                SetFeesMode: {
                    jitWithdraw: "bool"
                },
                SetTopic: "[u8;32]",
                ClearTopic: "Null",
                AliasOrigin: "MultiLocationV5",
                UnpaidExecution: {
                    weightLimit: "WeightLimitV3",
                    checkOrigin: "Option<MultiLocationV5>"
                },
                PayFees: {
                    asset: "MultiAssetV5"
                },
                InitiateTransfer: {
                    destination: "MultiLocationV5",
                    remoteFees: "Option<MultiAssetTransferFilterV5>",
                    preserveOrigin: "bool",
                    assets: "Vec<MultiAssetTransferFilterV5>",
                    remoteXcm: "XcmV5"
                },
                ExecuteWithOrigin: {
                    descendant_origin: "Option<InteriorMultiLocationV5>",
                    xcm: "XcmV5"
                },
                SetHints: {
                    hints: "Vec<HintV5>"
                }
            }
        },
        HintV5: {
            _enum: {
                AssetClaimer: {
                    location: "MultiLocationV5"
                }
            }
        },
        XcmErrorV5: "XcmErrorV3"
    }, iKe = "V5", oKe = {
        XcmOrigin: {
            _enum: {
                Xcm: "MultiLocation"
            }
        },
        XcmpMessageFormat: {
            _enum: [
                "ConcatenatedVersionedXcm",
                "ConcatenatedEncodedBlob",
                "Signals"
            ]
        },
        XcmAssetId: {
            _enum: {
                Concrete: "MultiLocation",
                Abstract: "Bytes"
            }
        },
        InboundStatus: {
            _enum: [
                "Ok",
                "Suspended"
            ]
        },
        OutboundStatus: {
            _enum: [
                "Ok",
                "Suspended"
            ]
        },
        MultiAssets: "Vec<MultiAsset>"
    }, aKe = {
        BodyId: {
            _enum: {
                Unit: "Null",
                Named: "Vec<u8>",
                Index: "Compact<u32>",
                Executive: "Null",
                Technical: "Null",
                Legislative: "Null",
                Judicial: "Null"
            }
        },
        BodyPart: {
            _enum: {
                Voice: "Null",
                Members: "Compact<u32>",
                Fraction: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                AtLeastProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                },
                MoreThanProportion: {
                    nom: "Compact<u32>",
                    denom: "Compact<u32>"
                }
            }
        },
        InteriorMultiLocation: "Junctions",
        NetworkId: {
            _enum: {
                Any: "Null",
                Named: "Vec<u8>",
                Polkadot: "Null",
                Kusama: "Null"
            }
        }
    }, cKe = {
        rpc: {},
        types: {
            ...aKe,
            ...oKe,
            ...QWe,
            ...eKe,
            ...tKe,
            ...nKe,
            ...rKe,
            ...sKe,
            ...Zi(iKe),
            DoubleEncodedCall: {
                encoded: "Bytes"
            },
            XcmOriginKind: {
                _enum: [
                    "Native",
                    "SovereignAccount",
                    "Superuser",
                    "Xcm"
                ]
            },
            Outcome: {
                _enum: {
                    Complete: "Weight",
                    Incomplete: "(Weight, XcmErrorV0)",
                    Error: "XcmErrorV0"
                }
            },
            QueryId: "u64",
            QueryStatus: {
                _enum: {
                    Pending: {
                        responder: "VersionedMultiLocation",
                        maybeNotify: "Option<(u8, u8)>",
                        timeout: "BlockNumber"
                    },
                    Ready: {
                        response: "VersionedResponse",
                        at: "BlockNumber"
                    }
                }
            },
            QueueConfigData: {
                suspendThreshold: "u32",
                dropThreshold: "u32",
                resumeThreshold: "u32",
                thresholdWeight: "Weight",
                weightRestrictDecay: "Weight"
            },
            VersionMigrationStage: {
                _enum: {
                    MigrateSupportedVersion: "Null",
                    MigrateVersionNotifiers: "Null",
                    NotifyCurrentTargets: "Option<Bytes>",
                    MigrateAndNotifyOldTargets: "Null"
                }
            },
            VersionedMultiAsset: {
                _enum: {
                    V0: "MultiAssetV0",
                    V1: "MultiAssetV1",
                    V2: "MultiAssetV2",
                    V3: "MultiAssetV3",
                    V4: "MultiAssetV4",
                    V5: "MultiAssetV5"
                }
            },
            VersionedMultiAssets: {
                _enum: {
                    V0: "Vec<MultiAssetV0>",
                    V1: "MultiAssetsV1",
                    V2: "MultiAssetsV2",
                    V3: "MultiAssetsV3",
                    V4: "MultiAssetsV4",
                    V5: "MultiAssetsV5"
                }
            },
            VersionedMultiLocation: {
                _enum: {
                    V0: "MultiLocationV0",
                    V1: "MultiLocationV1",
                    V2: "MultiLocationV2",
                    V3: "MultiLocationV3",
                    V4: "MultiLocationV4",
                    v5: "MultiLocationV5"
                }
            },
            VersionedResponse: {
                V0: "ResponseV0",
                V1: "ResponseV1",
                V2: "ResponseV2",
                V3: "ResponseV3",
                V4: "ResponseV4",
                V5: "ResponseV5"
            },
            VersionedXcm: {
                _enum: {
                    V0: "XcmV0",
                    V1: "XcmV1",
                    V2: "XcmV2",
                    V3: "XcmV3",
                    V4: "XcmV4",
                    V5: "XcmV5"
                }
            },
            XcmVersion: "u32"
        }
    }, lKe = {
        XcmPaymentApi: [
            {
                methods: {
                    query_acceptable_payment_assets: {
                        description: "The API to query acceptable payment assets",
                        params: [
                            {
                                name: "version",
                                type: "u32"
                            }
                        ],
                        type: "Result<Vec<XcmVersionedAssetId>, XcmPaymentApiError>"
                    },
                    query_weight_to_asset_fee: {
                        description: "",
                        params: [
                            {
                                name: "weight",
                                type: "WeightV2"
                            },
                            {
                                name: "asset",
                                type: "XcmVersionedAssetId"
                            }
                        ],
                        type: "Result<u128, XcmPaymentApiError>"
                    },
                    query_xcm_weight: {
                        description: "",
                        params: [
                            {
                                name: "message",
                                type: "XcmVersionedXcm"
                            }
                        ],
                        type: "Result<WeightV2, XcmPaymentApiError>"
                    }
                },
                version: 1
            }
        ]
    }, uKe = {
        rpc: {},
        runtime: lKe,
        types: {
            XcmPaymentApiError: {
                _enum: [
                    "Unimplemented",
                    "VersionedConversionFailed",
                    "WeightNotComputable",
                    "UnhandledXcmVersion",
                    "AssetNotFound"
                ]
            }
        }
    }, dKe = {
        LocationToAccountApi: [
            {
                methods: {
                    convert_location: {
                        description: "Converts `Location` to `AccountId`",
                        params: [
                            {
                                name: "location",
                                type: "XcmVersionedLocation"
                            }
                        ],
                        type: "Result<AccountId, Error>"
                    }
                },
                version: 1
            }
        ]
    }, fKe = {
        rpc: {},
        runtime: dKe,
        types: {
            Error: {
                _enum: [
                    "Unsupported",
                    "VersionedConversionFailed"
                ]
            }
        }
    }, pKe = {
        ContractCryptoHasher: {
            _enum: [
                "Blake2x256",
                "Sha2x256",
                "Keccak256"
            ]
        },
        ContractDiscriminant: "u32",
        ContractLayoutArray: {
            offset: "ContractLayoutKey",
            len: "u32",
            cellsPerElem: "u64",
            layout: "ContractStorageLayout"
        },
        ContractLayoutCell: {
            key: "ContractLayoutKey",
            ty: "SiLookupTypeId"
        },
        ContractLayoutEnum: {
            dispatchKey: "ContractLayoutKey",
            variants: "BTreeMap<ContractDiscriminant, ContractLayoutStruct>"
        },
        ContractLayoutHash: {
            offset: "ContractLayoutKey",
            strategy: "ContractLayoutHashingStrategy",
            layout: "ContractStorageLayout"
        },
        ContractLayoutHashingStrategy: {
            hasher: "ContractCryptoHasher",
            postfix: "Vec<u8>",
            prefix: "Vec<u8>"
        },
        ContractLayoutKey: "[u8; 32]",
        ContractLayoutStruct: {
            fields: "Vec<ContractLayoutStructField>"
        },
        ContractLayoutStructField: {
            layout: "ContractStorageLayout",
            name: "Text"
        },
        ContractStorageLayout: {
            _enum: {
                Cell: "ContractLayoutCell",
                Hash: "ContractLayoutHash",
                Array: "ContractLayoutArray",
                Struct: "ContractLayoutStruct",
                Enum: "ContractLayoutEnum"
            }
        }
    }, hKe = {
        ContractConstructorSpecV0: {
            name: "Text",
            selector: "ContractSelector",
            args: "Vec<ContractMessageParamSpecV0>",
            docs: "Vec<Text>"
        },
        ContractConstructorSpecV1: {
            name: "Vec<Text>",
            selector: "ContractSelector",
            args: "Vec<ContractMessageParamSpecV0>",
            docs: "Vec<Text>"
        },
        ContractConstructorSpecV2: {
            label: "Text",
            selector: "ContractSelector",
            args: "Vec<ContractMessageParamSpecV2>",
            docs: "Vec<Text>"
        },
        ContractConstructorSpecV3: {
            label: "Text",
            selector: "ContractSelector",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV2>",
            docs: "Vec<Text>"
        },
        ContractConstructorSpecV4: {
            label: "Text",
            selector: "ContractSelector",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV2>",
            docs: "Vec<Text>",
            default: "bool",
            returnType: "Option<ContractTypeSpec>"
        },
        ContractContractSpecV0: {
            constructors: "Vec<ContractConstructorSpecV0>",
            messages: "Vec<ContractMessageSpecV0>",
            events: "Vec<ContractEventSpecV0>",
            docs: "Vec<Text>"
        },
        ContractContractSpecV1: {
            constructors: "Vec<ContractConstructorSpecV1>",
            messages: "Vec<ContractMessageSpecV1>",
            events: "Vec<ContractEventSpecV1>",
            docs: "Vec<Text>"
        },
        ContractContractSpecV2: {
            constructors: "Vec<ContractConstructorSpecV2>",
            messages: "Vec<ContractMessageSpecV2>",
            events: "Vec<ContractEventSpecV2>",
            docs: "Vec<Text>"
        },
        ContractContractSpecV3: {
            constructors: "Vec<ContractConstructorSpecV3>",
            messages: "Vec<ContractMessageSpecV2>",
            events: "Vec<ContractEventSpecV2>",
            docs: "Vec<Text>"
        },
        ContractContractSpecV4: {
            constructors: "Vec<ContractConstructorSpecV4>",
            messages: "Vec<ContractMessageSpecV3>",
            events: "Vec<ContractEventSpecV2>",
            docs: "Vec<Text>",
            environment: "ContractEnvironmentV4"
        },
        ContractContractSpecV5: {
            constructors: "Vec<ContractConstructorSpecV4>",
            messages: "Vec<ContractMessageSpecV3>",
            events: "Vec<ContractEventSpecV3>",
            docs: "Vec<Text>",
            environment: "ContractEnvironmentV4"
        },
        ContractContractSpecV6: {
            constructors: "Vec<ContractConstructorSpecV4>",
            messages: "Vec<ContractMessageSpecV3>",
            events: "Vec<ContractEventSpecV3>",
            docs: "Vec<Text>",
            environment: "ContractEnvironmentV4"
        },
        ContractDisplayName: "SiPath",
        ContractEventParamSpecV0: {
            name: "Text",
            indexed: "bool",
            type: "ContractTypeSpec",
            docs: "Vec<Text>"
        },
        ContractEventParamSpecV2: {
            label: "Text",
            indexed: "bool",
            type: "ContractTypeSpec",
            docs: "Vec<Text>"
        },
        ContractEventSpecV0: {
            name: "Text",
            args: "Vec<ContractEventParamSpecV0>",
            docs: "Vec<Text>"
        },
        ContractEventSpecV1: {
            name: "Text",
            args: "Vec<ContractEventParamSpecV0>",
            docs: "Vec<Text>"
        },
        ContractEventSpecV2: {
            label: "Text",
            args: "Vec<ContractEventParamSpecV2>",
            docs: "Vec<Text>"
        },
        ContractEventSpecV3: {
            label: "Text",
            args: "Vec<ContractEventParamSpecV2>",
            docs: "Vec<Text>",
            module_path: "Text",
            signature_topic: "Option<[u8; 32]>"
        },
        ContractMessageParamSpecV0: {
            name: "Text",
            type: "ContractTypeSpec"
        },
        ContractMessageParamSpecV2: {
            label: "Text",
            type: "ContractTypeSpec"
        },
        ContractMessageSpecV0: {
            name: "Text",
            selector: "ContractSelector",
            mutates: "bool",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV0>",
            returnType: "Option<ContractTypeSpec>",
            docs: "Vec<Text>"
        },
        ContractMessageSpecV1: {
            name: "Vec<Text>",
            selector: "ContractSelector",
            mutates: "bool",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV0>",
            returnType: "Option<ContractTypeSpec>",
            docs: "Vec<Text>"
        },
        ContractMessageSpecV2: {
            label: "Text",
            selector: "ContractSelector",
            mutates: "bool",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV2>",
            returnType: "Option<ContractTypeSpec>",
            docs: "Vec<Text>"
        },
        ContractMessageSpecV3: {
            label: "Text",
            selector: "ContractSelector",
            mutates: "bool",
            payable: "bool",
            args: "Vec<ContractMessageParamSpecV2>",
            returnType: "Option<ContractTypeSpec>",
            docs: "Vec<Text>",
            default: "bool"
        },
        ContractSelector: "[u8; 4]",
        ContractTypeSpec: {
            type: "SiLookupTypeId",
            displayName: "ContractDisplayName"
        }
    }, gKe = {
        ContractConstructorSpecLatest: "ContractConstructorSpecV4",
        ContractEventSpecLatest: "ContractEventSpecV3",
        ContractEventParamSpecLatest: "ContractEventParamSpecV2",
        ContractMessageParamSpecLatest: "ContractMessageParamSpecV2",
        ContractMessageSpecLatest: "ContractMessageSpecV3",
        ContractMetadataLatest: "ContractMetadataV6"
    }, bKe = {
        rpc: {},
        types: {
            ...pKe,
            ...hKe,
            ...gKe,
            ContractProjectInfo: {
                source: "ContractProjectSource",
                contract: "ContractProjectContract"
            },
            ContractReviveProjectInfo: {
                source: "ContractReviveProjectSource",
                contract: "ContractProjectContract"
            },
            ContractMetadataV0: {
                metadataVersion: "Text",
                types: "Vec<Si0Type>",
                spec: "ContractContractSpecV0"
            },
            ContractMetadataV1: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV1"
            },
            ContractMetadataV2: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV2"
            },
            ContractMetadataV3: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV3"
            },
            ContractMetadataV4: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV4",
                version: "Text"
            },
            ContractMetadataV5: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV5",
                version: "u64"
            },
            ContractMetadataV6: {
                types: "Vec<PortableType>",
                spec: "ContractContractSpecV6",
                version: "u64"
            },
            ContractMetadata: {
                _enum: {
                    V0: "ContractMetadataV0",
                    V1: "ContractMetadataV1",
                    V2: "ContractMetadataV2",
                    V3: "ContractMetadataV3",
                    V4: "ContractMetadataV4",
                    V5: "ContractMetadataV5",
                    V6: "ContractMetadataV6"
                }
            },
            ContractProjectV0: {
                metadataVersion: "Text",
                source: "ContractProjectSource",
                contract: "ContractProjectContract",
                types: "Vec<Si0Type>",
                spec: "ContractContractSpecV0"
            },
            ContractProject: "(ContractProjectInfo, ContractMetadata)",
            ContractProjectContract: {
                _alias: {
                    docs: "documentation"
                },
                name: "Text",
                version: "Text",
                authors: "Vec<Text>",
                description: "Option<Text>",
                docs: "Option<Text>",
                repository: "Option<Text>",
                homepage: "Option<Text>",
                license: "Option<Text>"
            },
            ContractProjectSource: {
                _alias: {
                    wasmHash: "hash"
                },
                wasmHash: "[u8; 32]",
                language: "Text",
                compiler: "Text",
                wasm: "Raw"
            },
            ContractReviveProjectSource: {
                _alias: {
                    wasmHash: "hash",
                    wasm: "contract_binary"
                },
                wasmHash: "[u8; 32]",
                language: "Text",
                compiler: "Text",
                wasm: "Raw"
            },
            ContractEnvironmentV4: {
                _alias: {
                    hashType: "hash"
                },
                accountId: "Option<ContractTypeSpec>",
                balance: "Option<ContractTypeSpec>",
                blockNumber: "Option<ContractTypeSpec>",
                hashType: "Option<ContractTypeSpec>",
                timestamp: "Option<ContractTypeSpec>",
                maxEventTopics: "Option<u32>"
            }
        }
    }, mKe = {
        listening: {
            aliasSection: "net",
            description: "Returns true if client is actively listening for network connections. Otherwise false.",
            params: [],
            type: "bool"
        },
        peerCount: {
            aliasSection: "net",
            description: "Returns number of peers connected to node.",
            params: [],
            type: "Text"
        },
        version: {
            aliasSection: "net",
            description: "Returns protocol version.",
            params: [],
            type: "Text"
        }
    }, yKe = {
        clientVersion: {
            aliasSection: "web3",
            description: "Returns current client version.",
            params: [],
            type: "Text"
        },
        sha3: {
            aliasSection: "web3",
            description: "Returns sha3 of the given data",
            params: [
                {
                    name: "data",
                    type: "Bytes"
                }
            ],
            type: "H256"
        }
    }, wKe = {
        ...mKe,
        ...yKe,
        accounts: {
            description: "Returns accounts list.",
            params: [],
            type: "Vec<H160>"
        },
        blockNumber: {
            description: "Returns the blockNumber",
            params: [],
            type: "U256"
        },
        call: {
            description: "Call contract, returning the output data.",
            params: [
                {
                    name: "request",
                    type: "EthCallRequest"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "Bytes"
        },
        chainId: {
            description: "Returns the chain ID used for transaction signing at the current best block. None is returned if not available.",
            params: [],
            type: "U64"
        },
        coinbase: {
            description: "Returns block author.",
            params: [],
            type: "H160"
        },
        estimateGas: {
            description: "Estimate gas needed for execution of given contract.",
            params: [
                {
                    name: "request",
                    type: "EthCallRequest"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "U256"
        },
        feeHistory: {
            description: "Returns fee history for given block count & reward percentiles",
            params: [
                {
                    name: "blockCount",
                    type: "U256"
                },
                {
                    name: "newestBlock",
                    type: "BlockNumber"
                },
                {
                    name: "rewardPercentiles",
                    type: "Option<Vec<f64>>"
                }
            ],
            type: "EthFeeHistory"
        },
        gasPrice: {
            description: "Returns current gas price.",
            params: [],
            type: "U256"
        },
        getBalance: {
            description: "Returns balance of the given account.",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "U256"
        },
        getBlockByHash: {
            description: "Returns block with given hash.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                },
                {
                    name: "full",
                    type: "bool"
                }
            ],
            type: "Option<EthRichBlock>"
        },
        getBlockByNumber: {
            description: "Returns block with given number.",
            params: [
                {
                    name: "block",
                    type: "BlockNumber"
                },
                {
                    name: "full",
                    type: "bool"
                }
            ],
            type: "Option<EthRichBlock>"
        },
        getBlockTransactionCountByHash: {
            description: "Returns the number of transactions in a block with given hash.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                }
            ],
            type: "U256"
        },
        getBlockTransactionCountByNumber: {
            description: "Returns the number of transactions in a block with given block number.",
            params: [
                {
                    name: "block",
                    type: "BlockNumber"
                }
            ],
            type: "U256"
        },
        getCode: {
            description: "Returns the code at given address at given time (block number).",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "Bytes"
        },
        getFilterChanges: {
            description: "Returns filter changes since last poll.",
            params: [
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "EthFilterChanges"
        },
        getFilterLogs: {
            description: "Returns all logs matching given filter (in a range 'from' - 'to').",
            params: [
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "Vec<EthLog>"
        },
        getLogs: {
            description: "Returns logs matching given filter object.",
            params: [
                {
                    name: "filter",
                    type: "EthFilter"
                }
            ],
            type: "Vec<EthLog>"
        },
        getProof: {
            description: "Returns proof for account and storage.",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    name: "storageKeys",
                    type: "Vec<H256>"
                },
                {
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "EthAccount"
        },
        getStorageAt: {
            description: "Returns content of the storage at given address.",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    name: "index",
                    type: "U256"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "H256"
        },
        getTransactionByBlockHashAndIndex: {
            description: "Returns transaction at given block hash and index.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                },
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "EthTransaction"
        },
        getTransactionByBlockNumberAndIndex: {
            description: "Returns transaction by given block number and index.",
            params: [
                {
                    name: "number",
                    type: "BlockNumber"
                },
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "EthTransaction"
        },
        getTransactionByHash: {
            description: "Get transaction by its hash.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                }
            ],
            type: "EthTransaction"
        },
        getTransactionCount: {
            description: "Returns the number of transactions sent from given address at given time (block number).",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "U256"
        },
        getTransactionReceipt: {
            description: "Returns transaction receipt by transaction hash.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                }
            ],
            type: "EthReceipt"
        },
        getUncleByBlockHashAndIndex: {
            description: "Returns an uncles at given block and index.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                },
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "EthRichBlock"
        },
        getUncleByBlockNumberAndIndex: {
            description: "Returns an uncles at given block and index.",
            params: [
                {
                    name: "number",
                    type: "BlockNumber"
                },
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "EthRichBlock"
        },
        getUncleCountByBlockHash: {
            description: "Returns the number of uncles in a block with given hash.",
            params: [
                {
                    name: "hash",
                    type: "H256"
                }
            ],
            type: "U256"
        },
        getUncleCountByBlockNumber: {
            description: "Returns the number of uncles in a block with given block number.",
            params: [
                {
                    name: "number",
                    type: "BlockNumber"
                }
            ],
            type: "U256"
        },
        getWork: {
            description: "Returns the hash of the current block, the seedHash, and the boundary condition to be met.",
            params: [],
            type: "EthWork"
        },
        hashrate: {
            description: "Returns the number of hashes per second that the node is mining with.",
            params: [],
            type: "U256"
        },
        maxPriorityFeePerGas: {
            description: "Returns max priority fee per gas",
            params: [],
            type: "U256"
        },
        mining: {
            description: "Returns true if client is actively mining new blocks.",
            params: [],
            type: "bool"
        },
        newBlockFilter: {
            description: "Returns id of new block filter.",
            params: [],
            type: "U256"
        },
        newFilter: {
            description: "Returns id of new filter.",
            params: [
                {
                    name: "filter",
                    type: "EthFilter"
                }
            ],
            type: "U256"
        },
        newPendingTransactionFilter: {
            description: "Returns id of new block filter.",
            params: [],
            type: "U256"
        },
        protocolVersion: {
            description: "Returns protocol version encoded as a string (quotes are necessary).",
            params: [],
            type: "u64"
        },
        sendRawTransaction: {
            description: "Sends signed transaction, returning its hash.",
            params: [
                {
                    name: "bytes",
                    type: "Bytes"
                }
            ],
            type: "H256"
        },
        sendTransaction: {
            description: "Sends transaction; will block waiting for signer to return the transaction hash",
            params: [
                {
                    name: "tx",
                    type: "EthTransactionRequest"
                }
            ],
            type: "H256"
        },
        submitHashrate: {
            description: "Used for submitting mining hashrate.",
            params: [
                {
                    name: "index",
                    type: "U256"
                },
                {
                    name: "hash",
                    type: "H256"
                }
            ],
            type: "bool"
        },
        submitWork: {
            description: "Used for submitting a proof-of-work solution.",
            params: [
                {
                    name: "nonce",
                    type: "H64"
                },
                {
                    name: "headerHash",
                    type: "H256"
                },
                {
                    name: "mixDigest",
                    type: "H256"
                }
            ],
            type: "bool"
        },
        subscribe: {
            description: "Subscribe to Eth subscription.",
            params: [
                {
                    name: "kind",
                    type: "EthSubKind"
                },
                {
                    isOptional: !0,
                    name: "params",
                    type: "EthSubParams"
                }
            ],
            pubsub: [
                "subscription",
                "subscribe",
                "unsubscribe"
            ],
            type: "Null"
        },
        syncing: {
            description: "Returns an object with data about the sync status or false.",
            params: [],
            type: "EthSyncStatus"
        },
        uninstallFilter: {
            description: "Uninstalls filter.",
            params: [
                {
                    name: "index",
                    type: "U256"
                }
            ],
            type: "bool"
        }
    }, eB = {
        account_basic: {
            description: "Returns pallet_evm::Accounts by address.",
            params: [
                {
                    name: "address",
                    type: "H160"
                }
            ],
            type: "EvmAccount"
        },
        account_code_at: {
            description: "For a given account address, returns pallet_evm::AccountCodes.",
            params: [
                {
                    name: "address",
                    type: "H160"
                }
            ],
            type: "Bytes"
        },
        author: {
            description: "Returns the converted FindAuthor::find_author authority id.",
            params: [],
            type: "H160"
        },
        call: {
            description: "Returns a frame_ethereum::call response. If `estimate` is true,",
            params: [
                {
                    name: "from",
                    type: "H160"
                },
                {
                    name: "to",
                    type: "H160"
                },
                {
                    name: "data",
                    type: "Vec<u8>"
                },
                {
                    name: "value",
                    type: "U256"
                },
                {
                    name: "gasLimit",
                    type: "U256"
                },
                {
                    name: "maxFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "maxPriorityFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "nonce",
                    type: "Option<U256>"
                },
                {
                    name: "estimate",
                    type: "bool"
                },
                {
                    name: "accessList",
                    type: "Option<Vec<(H160, Vec<H256>)>>"
                }
            ],
            type: "Result<EvmCallInfo, DispatchError>"
        },
        chain_id: {
            description: "Returns runtime defined pallet_evm::ChainId.",
            params: [],
            type: "u64"
        },
        create: {
            description: "Returns a frame_ethereum::call response. If `estimate` is true,",
            params: [
                {
                    name: "from",
                    type: "H160"
                },
                {
                    name: "data",
                    type: "Vec<u8>"
                },
                {
                    name: "value",
                    type: "U256"
                },
                {
                    name: "gasLimit",
                    type: "U256"
                },
                {
                    name: "maxFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "maxPriorityFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "nonce",
                    type: "Option<U256>"
                },
                {
                    name: "estimate",
                    type: "bool"
                },
                {
                    name: "accessList",
                    type: "Option<Vec<(H160, Vec<H256>)>>"
                }
            ],
            type: "Result<EvmCreateInfo, DispatchError>"
        },
        current_all: {
            description: "Return all the current data for a block in a single runtime call.",
            params: [],
            type: "(Option<BlockV2>, Option<Vec<EthReceiptV3>>, Option<Vec<EthTransactionStatus>>)"
        },
        current_block: {
            description: "Return the current block.",
            params: [],
            type: "BlockV2"
        },
        current_receipts: {
            description: "Return the current receipt.",
            params: [],
            type: "Option<Vec<EthReceiptV3>>"
        },
        current_transaction_statuses: {
            description: "Return the current transaction status.",
            params: [],
            type: "Option<Vec<EthTransactionStatus>>"
        },
        elasticity: {
            description: "Return the elasticity multiplier.",
            params: [],
            type: "Option<Permill>"
        },
        extrinsic_filter: {
            description: "Receives a `Vec<OpaqueExtrinsic>` and filters all the ethereum transactions.",
            params: [
                {
                    name: "xts",
                    type: "Vec<Extrinsic>"
                }
            ],
            type: "Vec<TransactionV2>"
        },
        gas_price: {
            description: "Returns FixedGasPrice::min_gas_price",
            params: [],
            type: "u256"
        },
        storage_at: {
            description: "For a given account address and index, returns pallet_evm::AccountStorages.",
            params: [
                {
                    name: "address",
                    type: "H160"
                },
                {
                    name: "index",
                    type: "u256"
                }
            ],
            type: "H256"
        }
    }, _Ke = {
        call: {
            description: "Returns a frame_ethereum::call response. If `estimate` is true,",
            params: [
                {
                    name: "from",
                    type: "H160"
                },
                {
                    name: "to",
                    type: "H160"
                },
                {
                    name: "data",
                    type: "Vec<u8>"
                },
                {
                    name: "value",
                    type: "U256"
                },
                {
                    name: "gasLimit",
                    type: "U256"
                },
                {
                    name: "maxFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "maxPriorityFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "nonce",
                    type: "Option<U256>"
                },
                {
                    name: "estimate",
                    type: "bool"
                },
                {
                    name: "accessList",
                    type: "Option<Vec<(H160, Vec<H256>)>>"
                }
            ],
            type: "Result<EvmCallInfoV2, DispatchError>"
        },
        create: {
            description: "Returns a frame_ethereum::call response. If `estimate` is true,",
            params: [
                {
                    name: "from",
                    type: "H160"
                },
                {
                    name: "data",
                    type: "Vec<u8>"
                },
                {
                    name: "value",
                    type: "U256"
                },
                {
                    name: "gasLimit",
                    type: "U256"
                },
                {
                    name: "maxFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "maxPriorityFeePerGas",
                    type: "Option<U256>"
                },
                {
                    name: "nonce",
                    type: "Option<U256>"
                },
                {
                    name: "estimate",
                    type: "bool"
                },
                {
                    name: "accessList",
                    type: "Option<Vec<(H160, Vec<H256>)>>"
                }
            ],
            type: "Result<EvmCreateInfoV2, DispatchError>"
        }
    }, xKe = {
        ConvertTransactionRuntimeApi: [
            {
                methods: {
                    convert_transaction: {
                        description: "Converts an Ethereum-style transaction to Extrinsic",
                        params: [
                            {
                                name: "transaction",
                                type: "TransactionV2"
                            }
                        ],
                        type: "Extrinsic"
                    }
                },
                version: 2
            },
            {
                methods: {
                    convert_transaction: {
                        description: "Converts an Ethereum-style transaction to Extrinsic",
                        params: [
                            {
                                name: "transaction",
                                type: "TransactionV3"
                            }
                        ],
                        type: "Extrinsic"
                    }
                },
                version: 3
            }
        ],
        DebugRuntimeApi: [
            {
                methods: {
                    trace_block: {
                        description: "Trace all block extrinsics",
                        params: [
                            {
                                name: "extrinsics",
                                type: "Vec<Extrinsic>"
                            },
                            {
                                name: "knownTransactions",
                                type: "Vec<H256>"
                            }
                        ],
                        type: "Result<(), DispatchError>"
                    },
                    trace_transaction: {
                        description: "Trace transaction extrinsics",
                        params: [
                            {
                                name: "extrinsics",
                                type: "Vec<Extrinsic>"
                            },
                            {
                                name: "transaction",
                                type: "EthTransaction"
                            }
                        ],
                        type: "Result<(), DispatchError>"
                    }
                },
                version: 4
            }
        ],
        EthereumRuntimeRPCApi: [
            {
                methods: {
                    ...eB
                },
                version: 4
            },
            {
                methods: {
                    ...eB,
                    ..._Ke
                },
                version: 5
            }
        ]
    }, vKe = {
        BlockV0: {
            header: "EthHeader",
            transactions: "Vec<TransactionV0>",
            ommers: "Vec<EthHeader>"
        },
        LegacyTransaction: {
            nonce: "U256",
            gasPrice: "U256",
            gasLimit: "U256",
            action: "EthTransactionAction",
            value: "U256",
            input: "Bytes",
            signature: "EthLegacyTransactionSignature"
        },
        TransactionV0: "LegacyTransaction"
    }, SKe = {
        BlockV1: {
            header: "EthHeader",
            transactions: "Vec<TransactionV1>",
            ommers: "Vec<EthHeader>"
        },
        EIP2930Transaction: {
            chainId: "u64",
            nonce: "U256",
            gasPrice: "U256",
            gasLimit: "U256",
            action: "EthTransactionAction",
            value: "U256",
            input: "Bytes",
            accessList: "EthAccessList",
            signature: "EthTransactionSignature"
        },
        TransactionV1: {
            _enum: {
                Legacy: "LegacyTransaction",
                EIP2930: "EIP2930Transaction"
            }
        }
    }, kKe = {
        BlockV2: {
            header: "EthHeader",
            transactions: "Vec<TransactionV2>",
            ommers: "Vec<EthHeader>"
        },
        EIP1559Transaction: {
            chainId: "u64",
            nonce: "U256",
            maxPriorityFeePerGas: "U256",
            maxFeePerGas: "U256",
            gasLimit: "U256",
            action: "EthTransactionAction",
            value: "U256",
            input: "Bytes",
            accessList: "EthAccessList",
            signature: "EthTransactionSignature"
        },
        TransactionV2: {
            _enum: {
                Legacy: "LegacyTransaction",
                EIP2930: "EIP2930Transaction",
                EIP1559: "EIP1559Transaction"
            }
        }
    }, TKe = {
        BlockV3: {
            header: "EthHeader",
            transactions: "Vec<TransactionV3>",
            ommers: "Vec<EthHeader>"
        },
        EIP7702Transaction: {
            chainId: "u64",
            nonce: "U256",
            maxPriorityFeePerGas: "U256",
            maxFeePerGas: "U256",
            gasLimit: "U256",
            destination: "EthTransactionAction",
            value: "U256",
            data: "Bytes",
            accessList: "EthAccessList",
            authorizationList: "EthAuthorizationList",
            signature: "EthTransactionSignature"
        },
        TransactionV3: {
            _enum: {
                Legacy: "LegacyTransaction",
                EIP2930: "EIP2930Transaction",
                EIP1559: "EIP1559Transaction",
                EIP7702: "EIP7702Transaction"
            }
        }
    }, CKe = {
        ...vKe,
        ...SKe,
        ...kKe,
        ...TKe,
        EthereumAccountId: "GenericEthereumAccountId",
        EthereumAddress: "GenericEthereumAccountId",
        EthereumLookupSource: "GenericEthereumLookupSource",
        EthereumSignature: "[u8; 65]",
        EthAccessListItem: {
            address: "EthAddress",
            slots: "Vec<H256>"
        },
        EthAccessList: "Vec<EthAccessListItem>",
        EthAuthorizationList: "Vec<EthAuthorizationListItem>",
        EthAuthorizationListItem: {
            chainId: "u64",
            address: "H160",
            nonce: "U256",
            signature: "EthAuthorizationSignature"
        },
        EthAuthorizationSignature: {
            oddYParity: "bool",
            r: "H256",
            s: "H256"
        },
        EthAccount: {
            address: "EthAddress",
            balance: "U256",
            nonce: "U256",
            codeHash: "H256",
            storageHash: "H256",
            accountProof: "Vec<Bytes>",
            storageProof: "Vec<EthStorageProof>"
        },
        EthAddress: "H160",
        EthBlock: {
            header: "EthHeader",
            transactions: "Vec<EthTransaction>",
            ommers: "Vec<EthHeader>"
        },
        EthHeader: {
            parentHash: "H256",
            ommersHash: "H256",
            beneficiary: "EthAddress",
            stateRoot: "H256",
            transactionsRoot: "H256",
            receiptsRoot: "H256",
            logsBloom: "EthBloom",
            difficulty: "U256",
            number: "U256",
            gasLimit: "U256",
            gasUsed: "U256",
            timestamp: "u64",
            extraData: "Bytes",
            mixMash: "H256",
            nonce: "H64"
        },
        EthRichBlock: {
            _alias: {
                blockHash: "hash",
                blockSize: "size"
            },
            blockHash: "Option<H256>",
            parentHash: "H256",
            sha3Uncles: "H256",
            author: "EthAddress",
            miner: "EthAddress",
            stateRoot: "H256",
            transactionsRoot: "H256",
            receiptsRoot: "H256",
            number: "Option<U256>",
            gasUsed: "U256",
            gasLimit: "U256",
            extraData: "Bytes",
            logsBloom: "EthBloom",
            timestamp: "U256",
            difficulty: "U256",
            totalDifficulty: "Option<U256>",
            sealFields: "Vec<Bytes>",
            uncles: "Vec<H256>",
            transactions: "Vec<EthTransaction>",
            blockSize: "Option<U256>"
        },
        EthBloom: "H2048",
        EthCallRequest: {
            from: "Option<EthAddress>",
            to: "Option<EthAddress>",
            gasPrice: "Option<U256>",
            gas: "Option<U256>",
            value: "Option<U256>",
            data: "Option<Bytes>",
            nonce: "Option<U256>"
        },
        EthFeeHistory: {
            oldestBlock: "U256",
            baseFeePerGas: "Vec<U256>",
            gasUsedRatio: "Vec<f64>",
            reward: "Option<Vec<Vec<U256>>>"
        },
        EthFilter: {
            fromBlock: "Option<BlockNumber>",
            toBlock: "Option<BlockNumber>",
            blockHash: "Option<H256>",
            address: "Option<EthFilterAddress>",
            topics: "Option<EthFilterTopic>"
        },
        EthFilterAddress: {
            _enum: {
                Single: "EthAddress",
                Multiple: "Vec<EthAddress>",
                Null: "Null"
            }
        },
        EthFilterChanges: {
            _enum: {
                Logs: "Vec<EthLog>",
                Hashes: "Vec<H256>",
                Empty: "Null"
            }
        },
        EthFilterTopic: {
            _enum: {
                Single: "EthFilterTopicInner",
                Multiple: "Vec<EthFilterTopicInner>",
                Null: "Null"
            }
        },
        EthFilterTopicEntry: "Option<H256>",
        EthFilterTopicInner: {
            _enum: {
                Single: "EthFilterTopicEntry",
                Multiple: "Vec<EthFilterTopicEntry>",
                Null: "Null"
            }
        },
        EthRichHeader: {
            _alias: {
                blockHash: "hash",
                blockSize: "size"
            },
            blockHash: "Option<H256>",
            parentHash: "H256",
            sha3Uncles: "H256",
            author: "EthAddress",
            miner: "EthAddress",
            stateRoot: "H256",
            transactionsRoot: "H256",
            receiptsRoot: "H256",
            number: "Option<U256>",
            gasUsed: "U256",
            gasLimit: "U256",
            extraData: "Bytes",
            logsBloom: "EthBloom",
            timestamp: "U256",
            difficulty: "U256",
            sealFields: "Vec<Bytes>",
            blockSize: "Option<U256>"
        },
        EthLog: {
            address: "EthAddress",
            topics: "Vec<H256>",
            data: "Bytes",
            blockHash: "Option<H256>",
            blockNumber: "Option<U256>",
            transactionHash: "Option<H256>",
            transactionIndex: "Option<U256>",
            logIndex: "Option<U256>",
            transactionLogIndex: "Option<U256>",
            removed: "bool"
        },
        EthReceipt: {
            transactionHash: "Option<H256>",
            transactionIndex: "Option<U256>",
            blockHash: "Option<H256>",
            from: "Option<EthAddress>",
            to: "Option<EthAddress>",
            blockNumber: "Option<U256>",
            cumulativeGasUsed: "U256",
            gasUsed: "Option<U256>",
            contractAddress: "Option<EthAddress>",
            logs: "Vec<EthLog>",
            root: "Option<H256>",
            logsBloom: "EthBloom",
            statusCode: "Option<U64>"
        },
        EthReceiptV0: "EthReceipt",
        EthReceiptV3: "EthReceipt",
        EthReceiptV4: "EthReceipt",
        EthStorageProof: {
            key: "U256",
            value: "U256",
            proof: "Vec<Bytes>"
        },
        EthSubKind: {
            _enum: [
                "newHeads",
                "logs",
                "newPendingTransactions",
                "syncing"
            ]
        },
        EthSubParams: {
            _enum: {
                None: "Null",
                Logs: "EthFilter"
            }
        },
        EthSubResult: {
            _enum: {
                Header: "EthRichHeader",
                Log: "EthLog",
                TransactionHash: "H256",
                SyncState: "EthSyncStatus"
            }
        },
        EthSyncInfo: {
            startingBlock: "U256",
            currentBlock: "U256",
            highestBlock: "U256",
            warpChunksAmount: "Option<U256>",
            warpChunksProcessed: "Option<U256>"
        },
        EthSyncStatus: {
            _enum: {
                Info: "EthSyncInfo",
                None: "Null"
            }
        },
        EthTransaction: {
            hash: "H256",
            nonce: "U256",
            blockHash: "Option<H256>",
            blockNumber: "Option<U256>",
            transactionIndex: "Option<U256>",
            from: "H160",
            to: "Option<H160>",
            value: "U256",
            gasPrice: "Option<U256>",
            maxFeePerGas: "Option<U256>",
            maxPriorityFeePerGas: "Option<U256>",
            gas: "U256",
            input: "Bytes",
            creates: "Option<H160>",
            raw: "Bytes",
            publicKey: "Option<H512>",
            chainId: "Option<U64>",
            standardV: "U256",
            v: "U256",
            r: "U256",
            s: "U256",
            accessList: "Option<Vec<EthAccessListItem>>",
            transactionType: "Option<U256>"
        },
        EthLegacyTransactionSignature: {
            v: "u64",
            r: "H256",
            s: "H256"
        },
        EthTransactionSignature: {
            oddYParity: "bool",
            r: "H256",
            s: "H256"
        },
        EthTransactionAction: {
            _enum: {
                Call: "H160",
                Create: "Null"
            }
        },
        EthTransactionCondition: {
            _enum: {
                block: "u64",
                time: "u64"
            }
        },
        EthTransactionRequest: {
            from: "Option<EthAddress>",
            to: "Option<EthAddress>",
            gasPrice: "Option<U256>",
            gas: "Option<U256>",
            value: "Option<U256>",
            data: "Option<Bytes>",
            nonce: "Option<U256>"
        },
        EthTransactionStatus: {
            transactionHash: "H256",
            transactionIndex: "u32",
            from: "EthAddress",
            to: "Option<EthAddress>",
            contractAddress: "Option<EthAddress>",
            logs: "Vec<EthLog>",
            logsBloom: "EthBloom"
        },
        EthWork: {
            powHash: "H256",
            seedHash: "H256",
            target: "H256",
            number: "Option<u64>"
        }
    }, EKe = {
        rpc: wKe,
        runtime: xKe,
        types: CKe
    }, IKe = {
        AuthorFilterAPI: [
            {
                methods: {
                    can_author: {
                        description: "The runtime api used to predict whether an author will be eligible in the given slot",
                        params: [
                            {
                                name: "author",
                                type: "AccountId"
                            },
                            {
                                name: "relayParent",
                                type: "u32"
                            },
                            {
                                name: "parentHeader",
                                type: "Header"
                            }
                        ],
                        type: "bool"
                    }
                },
                version: 2
            },
            {
                methods: {
                    can_author: {
                        description: "The runtime api used to predict whether an author will be eligible in the given slot",
                        params: [
                            {
                                name: "author",
                                type: "AccountId"
                            },
                            {
                                name: "relayParent",
                                type: "u32"
                            }
                        ],
                        type: "bool"
                    }
                },
                version: 1
            }
        ],
        NimbusApi: [
            {
                methods: {
                    can_author: {
                        description: "The runtime api used to predict whether a Nimbus author will be eligible in the given slot",
                        params: [
                            {
                                name: "author",
                                type: "AccountId"
                            },
                            {
                                name: "relayParent",
                                type: "u32"
                            },
                            {
                                name: "parentHeader",
                                type: "Header"
                            }
                        ],
                        type: "bool"
                    }
                },
                version: 1
            }
        ]
    }, AKe = {
        rpc: {},
        runtime: IKe,
        types: {}
    }, PKe = {
        OracleApi: [
            {
                methods: {
                    get_all_values: {
                        description: "Retrieves all values",
                        params: [
                            {
                                name: "providerId",
                                type: "Raw"
                            }
                        ],
                        type: "Raw"
                    },
                    get_value: {
                        description: "Retrieves a single value",
                        params: [
                            {
                                name: "providerId",
                                type: "Raw"
                            },
                            {
                                name: "key",
                                type: "Raw"
                            }
                        ],
                        type: "Option<Raw>"
                    }
                },
                version: 1
            }
        ]
    }, OKe = {
        rpc: {},
        runtime: PKe,
        types: {}
    }, MKe = {
        TokensApi: [
            {
                methods: {
                    query_existential_deposit: {
                        description: "Query the existential amount for a specific currency",
                        params: [
                            {
                                name: "currencyId",
                                type: "Raw"
                            }
                        ],
                        type: "u128"
                    }
                },
                version: 1
            }
        ]
    }, RKe = {
        rpc: {},
        runtime: MKe,
        types: {}
    }, NKe = {
        methods: {
            description: "Retrieves the list of RPC methods that are exposed by the node",
            params: [],
            type: "RpcMethods"
        }
    }, VKe = {
        rpc: NKe,
        types: {
            RpcMethods: {
                version: "u32",
                methods: "Vec<Text>"
            }
        }
    }, DKe = {
        hasKey: {
            description: "Returns true if the keystore has private keys for the given public key and key type.",
            isUnsafe: !0,
            params: [
                {
                    name: "publicKey",
                    type: "Bytes"
                },
                {
                    name: "keyType",
                    type: "Text"
                }
            ],
            type: "bool"
        },
        hasSessionKeys: {
            description: "Returns true if the keystore has private keys for the given session public keys.",
            isUnsafe: !0,
            params: [
                {
                    name: "sessionKeys",
                    type: "Bytes"
                }
            ],
            type: "bool"
        },
        insertKey: {
            description: "Insert a key into the keystore.",
            isUnsafe: !0,
            params: [
                {
                    name: "keyType",
                    type: "Text"
                },
                {
                    name: "suri",
                    type: "Text"
                },
                {
                    name: "publicKey",
                    type: "Bytes"
                }
            ],
            type: "Bytes"
        },
        pendingExtrinsics: {
            description: "Returns all pending extrinsics, potentially grouped by sender",
            params: [],
            type: "Vec<Extrinsic>"
        },
        removeExtrinsic: {
            description: "Remove given extrinsic from the pool and temporarily ban it to prevent reimporting",
            isUnsafe: !0,
            params: [
                {
                    name: "bytesOrHash",
                    type: "Vec<ExtrinsicOrHash>"
                }
            ],
            type: "Vec<Hash>"
        },
        rotateKeys: {
            description: "Generate new session keys and returns the corresponding public keys",
            isUnsafe: !0,
            params: [],
            type: "Bytes"
        },
        submitAndWatchExtrinsic: {
            description: "Submit and subscribe to watch an extrinsic until unsubscribed",
            isSigned: !0,
            params: [
                {
                    name: "extrinsic",
                    type: "Extrinsic"
                }
            ],
            pubsub: [
                "extrinsicUpdate",
                "submitAndWatchExtrinsic",
                "unwatchExtrinsic"
            ],
            type: "ExtrinsicStatus"
        },
        submitExtrinsic: {
            description: "Submit a fully formatted extrinsic for block inclusion",
            isSigned: !0,
            params: [
                {
                    name: "extrinsic",
                    type: "Extrinsic"
                }
            ],
            type: "Hash"
        }
    }, BKe = {
        rpc: DKe,
        types: {
            ExtrinsicOrHash: {
                _enum: {
                    Hash: "Hash",
                    Extrinsic: "Bytes"
                }
            },
            ExtrinsicStatus: {
                _enum: {
                    Future: "Null",
                    Ready: "Null",
                    Broadcast: "Vec<Text>",
                    InBlock: "Hash",
                    Retracted: "Hash",
                    FinalityTimeout: "Hash",
                    Finalized: "Hash",
                    Usurped: "Hash",
                    Dropped: "Null",
                    Invalid: "Null"
                }
            }
        }
    }, FKe = {
        getBlock: {
            description: "Get header and body of a relay chain block",
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "hash",
                    type: "BlockHash"
                }
            ],
            type: "SignedBlock"
        },
        getBlockHash: {
            description: "Get the block hash for a specific block",
            params: [
                {
                    isOptional: !0,
                    name: "blockNumber",
                    type: "BlockNumber"
                }
            ],
            type: "BlockHash"
        },
        getFinalizedHead: {
            alias: [
                "chain_getFinalisedHead"
            ],
            description: "Get hash of the last finalized block in the canon chain",
            params: [],
            type: "BlockHash"
        },
        getHeader: {
            alias: [
                "chain_getHead"
            ],
            description: "Retrieves the header for a specific block",
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "hash",
                    type: "BlockHash"
                }
            ],
            type: "Header"
        },
        subscribeAllHeads: {
            description: "Retrieves the newest header via subscription",
            params: [],
            pubsub: [
                "allHead",
                "subscribeAllHeads",
                "unsubscribeAllHeads"
            ],
            type: "Header"
        },
        subscribeFinalizedHeads: {
            alias: [
                "chain_subscribeFinalisedHeads",
                "chain_unsubscribeFinalisedHeads"
            ],
            description: "Retrieves the best finalized header via subscription",
            params: [],
            pubsub: [
                "finalizedHead",
                "subscribeFinalizedHeads",
                "unsubscribeFinalizedHeads"
            ],
            type: "Header"
        },
        subscribeNewHeads: {
            alias: [
                "chain_unsubscribeNewHeads",
                "subscribe_newHead",
                "unsubscribe_newHead"
            ],
            description: "Retrieves the best header via subscription",
            params: [],
            pubsub: [
                "newHead",
                "subscribeNewHead",
                "unsubscribeNewHead"
            ],
            type: "Header"
        }
    }, LKe = {
        rpc: FKe,
        types: {
            BlockHash: "Hash"
        }
    }, zKe = {
        getKeys: {
            description: "Returns the keys with prefix from a child storage, leave empty to get all the keys",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "prefix",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Vec<StorageKey>"
        },
        getKeysPaged: {
            alias: [
                "childstate_getKeysPagedAt"
            ],
            description: "Returns the keys with prefix from a child storage with pagination support",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "prefix",
                    type: "StorageKey"
                },
                {
                    name: "count",
                    type: "u32"
                },
                {
                    isOptional: !0,
                    name: "startKey",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Vec<StorageKey>"
        },
        getStorage: {
            description: "Returns a child storage entry at a specific block state",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Option<StorageData>"
        },
        getStorageEntries: {
            description: "Returns child storage entries for multiple keys at a specific block state",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "keys",
                    type: "Vec<StorageKey>"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Vec<Option<StorageData>>"
        },
        getStorageHash: {
            description: "Returns the hash of a child storage entry at a block state",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Option<Hash>"
        },
        getStorageSize: {
            description: "Returns the size of a child storage entry at a block state",
            params: [
                {
                    name: "childKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "Hash"
                }
            ],
            type: "Option<u64>"
        }
    }, UKe = {
        rpc: zKe,
        types: {
            PrefixedStorageKey: "StorageKey"
        }
    }, HKe = {
        localStorageClear: {
            description: "Clear offchain local storage under given key and prefix",
            isUnsafe: !0,
            params: [
                {
                    name: "kind",
                    type: "StorageKind"
                },
                {
                    name: "key",
                    type: "Bytes"
                }
            ],
            type: "Null"
        },
        localStorageGet: {
            description: "Get offchain local storage under given key and prefix",
            isUnsafe: !0,
            params: [
                {
                    name: "kind",
                    type: "StorageKind"
                },
                {
                    name: "key",
                    type: "Bytes"
                }
            ],
            type: "Option<Bytes>"
        },
        localStorageSet: {
            description: "Set offchain local storage under given key and prefix",
            isUnsafe: !0,
            params: [
                {
                    name: "kind",
                    type: "StorageKind"
                },
                {
                    name: "key",
                    type: "Bytes"
                },
                {
                    name: "value",
                    type: "Bytes"
                }
            ],
            type: "Null"
        }
    }, jKe = {
        OffchainWorkerApi: [
            {
                methods: {
                    offchain_worker: {
                        description: "Starts the off-chain task for given block header.",
                        params: [
                            {
                                name: "header",
                                type: "Header"
                            }
                        ],
                        type: "Null"
                    }
                },
                version: 2
            },
            {
                methods: {
                    offchain_worker: {
                        description: "Starts the off-chain task for given block header.",
                        params: [
                            {
                                name: "number",
                                type: "BlockNumber"
                            }
                        ],
                        type: "Null"
                    }
                },
                version: 1
            }
        ]
    }, qKe = {
        rpc: HKe,
        runtime: jKe,
        types: {
            StorageKind: {
                _enum: {
                    PERSISTENT: 1,
                    LOCAL: 2
                }
            }
        }
    }, WKe = {
        queryFeeDetails: {
            deprecated: "Use `api.call.transactionPaymentApi.queryFeeDetails` instead",
            description: "Query the detailed fee of a given encoded extrinsic",
            params: [
                {
                    name: "extrinsic",
                    type: "Bytes"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "FeeDetails"
        },
        queryInfo: {
            deprecated: "Use `api.call.transactionPaymentApi.queryInfo` instead",
            description: "Retrieves the fee information for an encoded extrinsic",
            params: [
                {
                    name: "extrinsic",
                    type: "Bytes"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "RuntimeDispatchInfoV1"
        }
    }, Jw = {
        query_fee_details: {
            description: "The transaction fee details",
            params: [
                {
                    name: "uxt",
                    type: "Extrinsic"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "FeeDetails"
        }
    }, CS = {
        query_call_fee_details: {
            description: "The call fee details",
            params: [
                {
                    name: "call",
                    type: "Call"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "FeeDetails"
        }
    }, ES = {
        query_info: {
            description: "The transaction info",
            params: [
                {
                    name: "uxt",
                    type: "Extrinsic"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "RuntimeDispatchInfo"
        }
    }, tB = {
        query_call_info: {
            description: "The call info",
            params: [
                {
                    name: "call",
                    type: "Call"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "RuntimeDispatchInfo"
        }
    }, IS = {
        query_length_to_fee: {
            description: "Query the output of the current LengthToFee given some input",
            params: [
                {
                    name: "length",
                    type: "u32"
                }
            ],
            type: "Balance"
        },
        query_weight_to_fee: {
            description: "Query the output of the current WeightToFee given some input",
            params: [
                {
                    name: "weight",
                    type: "Weight"
                }
            ],
            type: "Balance"
        }
    }, KKe = {
        TransactionPaymentApi: [
            {
                methods: {
                    ...IS,
                    ...ES,
                    ...Jw
                },
                version: 4
            },
            {
                methods: {
                    ...IS,
                    ...ES,
                    ...Jw
                },
                version: 3
            },
            {
                methods: {
                    ...ES,
                    ...Jw
                },
                version: 2
            },
            {
                methods: {
                    query_info: {
                        description: "The transaction info",
                        params: [
                            {
                                name: "uxt",
                                type: "Extrinsic"
                            },
                            {
                                name: "len",
                                type: "u32"
                            }
                        ],
                        type: "RuntimeDispatchInfo"
                    },
                    ...Jw
                },
                version: 1
            }
        ],
        TransactionPaymentCallApi: [
            {
                methods: {
                    ...IS,
                    ...tB,
                    ...CS
                },
                version: 3
            },
            {
                methods: {
                    ...tB,
                    ...CS
                },
                version: 2
            },
            {
                methods: {
                    CALL: {
                        description: "The call info",
                        params: [
                            {
                                name: "call",
                                type: "Call"
                            },
                            {
                                name: "len",
                                type: "u32"
                            }
                        ],
                        type: "RuntimeDispatchInfo"
                    },
                    ...CS
                },
                version: 1
            }
        ]
    }, $Ke = {
        rpc: WKe,
        runtime: KKe,
        types: {
            FeeDetails: {
                inclusionFee: "Option<InclusionFee>"
            },
            InclusionFee: {
                baseFee: "Balance",
                lenFee: "Balance",
                adjustedWeightFee: "Balance"
            },
            RuntimeDispatchInfo: {
                weight: "Weight",
                class: "DispatchClass",
                partialFee: "Balance"
            },
            RuntimeDispatchInfoV1: {
                weight: "WeightV1",
                class: "DispatchClass",
                partialFee: "Balance"
            },
            RuntimeDispatchInfoV2: {
                weight: "WeightV2",
                class: "DispatchClass",
                partialFee: "Balance"
            }
        }
    }, XKe = {
        call: {
            alias: [
                "state_callAt"
            ],
            description: "Perform a call to a builtin on the chain",
            params: [
                {
                    name: "method",
                    type: "Text"
                },
                {
                    name: "data",
                    type: "Bytes"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Bytes"
        },
        getChildKeys: {
            description: "Retrieves the keys with prefix of a specific child storage",
            params: [
                {
                    name: "childStorageKey",
                    type: "StorageKey"
                },
                {
                    name: "childDefinition",
                    type: "StorageKey"
                },
                {
                    name: "childType",
                    type: "u32"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Vec<StorageKey>"
        },
        getChildReadProof: {
            description: "Returns proof of storage for child key entries at a specific block state.",
            params: [
                {
                    name: "childStorageKey",
                    type: "PrefixedStorageKey"
                },
                {
                    name: "keys",
                    type: "Vec<StorageKey>"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "ReadProof"
        },
        getChildStorage: {
            description: "Retrieves the child storage for a key",
            params: [
                {
                    name: "childStorageKey",
                    type: "StorageKey"
                },
                {
                    name: "childDefinition",
                    type: "StorageKey"
                },
                {
                    name: "childType",
                    type: "u32"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "StorageData"
        },
        getChildStorageHash: {
            description: "Retrieves the child storage hash",
            params: [
                {
                    name: "childStorageKey",
                    type: "StorageKey"
                },
                {
                    name: "childDefinition",
                    type: "StorageKey"
                },
                {
                    name: "childType",
                    type: "u32"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Hash"
        },
        getChildStorageSize: {
            description: "Retrieves the child storage size",
            params: [
                {
                    name: "childStorageKey",
                    type: "StorageKey"
                },
                {
                    name: "childDefinition",
                    type: "StorageKey"
                },
                {
                    name: "childType",
                    type: "u32"
                },
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "u64"
        },
        getKeys: {
            deprecated: "Use `api.rpc.state.getKeysPaged` to retrieve keys",
            description: "Retrieves the keys with a certain prefix",
            params: [
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Vec<StorageKey>"
        },
        getKeysPaged: {
            alias: [
                "state_getKeysPagedAt"
            ],
            description: "Returns the keys with prefix with pagination support.",
            params: [
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    name: "count",
                    type: "u32"
                },
                {
                    isOptional: !0,
                    name: "startKey",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Vec<StorageKey>"
        },
        getMetadata: {
            description: "Returns the runtime metadata",
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Metadata"
        },
        getPairs: {
            deprecated: "Use `api.rpc.state.getKeysPaged` to retrieve keys",
            description: "Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)",
            isUnsafe: !0,
            params: [
                {
                    name: "prefix",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Vec<KeyValue>"
        },
        getReadProof: {
            description: "Returns proof of storage entries at a specific block state",
            params: [
                {
                    name: "keys",
                    type: "Vec<StorageKey>"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "ReadProof"
        },
        getRuntimeVersion: {
            alias: [
                "chain_getRuntimeVersion"
            ],
            description: "Get the runtime version",
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "RuntimeVersion"
        },
        getStorage: {
            alias: [
                "state_getStorageAt"
            ],
            description: "Retrieves the storage for a key",
            params: [
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "StorageData"
        },
        getStorageHash: {
            alias: [
                "state_getStorageHashAt"
            ],
            description: "Retrieves the storage hash",
            params: [
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Hash"
        },
        getStorageSize: {
            alias: [
                "state_getStorageSizeAt"
            ],
            description: "Retrieves the storage size",
            params: [
                {
                    name: "key",
                    type: "StorageKey"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "u64"
        },
        queryStorage: {
            description: "Query historical storage entries (by key) starting from a start block",
            isUnsafe: !0,
            params: [
                {
                    name: "keys",
                    type: "Vec<StorageKey>"
                },
                {
                    name: "fromBlock",
                    type: "Hash"
                },
                {
                    isOptional: !0,
                    name: "toBlock",
                    type: "BlockHash"
                }
            ],
            type: "Vec<StorageChangeSet>"
        },
        queryStorageAt: {
            description: "Query storage entries (by key) starting at block hash given as the second parameter",
            params: [
                {
                    name: "keys",
                    type: "Vec<StorageKey>"
                },
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "Vec<StorageChangeSet>"
        },
        subscribeRuntimeVersion: {
            alias: [
                "chain_subscribeRuntimeVersion",
                "chain_unsubscribeRuntimeVersion"
            ],
            description: "Retrieves the runtime version via subscription",
            params: [],
            pubsub: [
                "runtimeVersion",
                "subscribeRuntimeVersion",
                "unsubscribeRuntimeVersion"
            ],
            type: "RuntimeVersion"
        },
        subscribeStorage: {
            description: "Subscribes to storage changes for the provided keys",
            params: [
                {
                    isOptional: !0,
                    name: "keys",
                    type: "Vec<StorageKey>"
                }
            ],
            pubsub: [
                "storage",
                "subscribeStorage",
                "unsubscribeStorage"
            ],
            type: "StorageChangeSet"
        },
        traceBlock: {
            description: "Provides a way to trace the re-execution of a single block",
            isUnsafe: !0,
            params: [
                {
                    name: "block",
                    type: "Hash"
                },
                {
                    name: "targets",
                    type: "Option<Text>"
                },
                {
                    name: "storageKeys",
                    type: "Option<Text>"
                },
                {
                    name: "methods",
                    type: "Option<Text>"
                }
            ],
            type: "TraceBlockResponse"
        },
        trieMigrationStatus: {
            description: "Check current migration state",
            isUnsafe: !0,
            params: [
                {
                    isHistoric: !0,
                    isOptional: !0,
                    name: "at",
                    type: "BlockHash"
                }
            ],
            type: "MigrationStatusResult"
        }
    }, GKe = {
        rpc: XKe,
        types: {
            ApiId: "[u8; 8]",
            BlockTrace: {
                blockHash: "Text",
                parentHash: "Text",
                tracingTargets: "Text",
                storageKeys: "Text",
                spans: "Vec<BlockTraceSpan>",
                events: "Vec<BlockTraceEvent>"
            },
            BlockTraceEvent: {
                target: "Text",
                data: "BlockTraceEventData",
                parentId: "Option<u64>"
            },
            BlockTraceEventData: {
                stringValues: "HashMap<Text, Text>"
            },
            BlockTraceSpan: {
                id: "u64",
                parentId: "Option<u64>",
                name: "Text",
                target: "Text",
                wasm: "bool"
            },
            KeyValueOption: "(StorageKey, Option<StorageData>)",
            MigrationStatusResult: {
                topRemainingToMigrate: "u64",
                childRemainingToMigrate: "u64"
            },
            ReadProof: {
                at: "Hash",
                proof: "Vec<Bytes>"
            },
            RuntimeVersionApi: "(ApiId, u32)",
            RuntimeVersion: {
                specName: "Text",
                implName: "Text",
                authoringVersion: "u32",
                specVersion: "u32",
                implVersion: "u32",
                apis: "Vec<RuntimeVersionApi>",
                transactionVersion: "u32",
                stateVersion: "u8"
            },
            RuntimeVersionPre4: {
                specName: "Text",
                implName: "Text",
                authoringVersion: "u32",
                specVersion: "u32",
                implVersion: "u32",
                apis: "Vec<RuntimeVersionApi>",
                transactionVersion: "u32"
            },
            RuntimeVersionPre3: {
                specName: "Text",
                implName: "Text",
                authoringVersion: "u32",
                specVersion: "u32",
                implVersion: "u32",
                apis: "Vec<RuntimeVersionApi>"
            },
            RuntimeVersionPartial: {
                specName: "Text",
                specVersion: "u32",
                apis: "Vec<RuntimeVersionApi>"
            },
            SpecVersion: "u32",
            StorageChangeSet: {
                block: "Hash",
                changes: "Vec<KeyValueOption>"
            },
            TraceBlockResponse: {
                _enum: {
                    TraceError: "TraceError",
                    BlockTrace: "BlockTrace"
                }
            },
            TraceError: {
                error: "Text"
            }
        }
    }, vx = Object.freeze(Object.defineProperty({
        __proto__: null,
        assetConversion: NHe,
        assets: DHe,
        attestations: pqe,
        aura: FHe,
        author: BKe,
        authorship: LHe,
        babe: HHe,
        balances: jHe,
        beefy: XHe,
        benchmark: ZHe,
        blockbuilder: YHe,
        bridges: hqe,
        chain: LKe,
        childstate: UKe,
        claims: gqe,
        collective: QHe,
        consensus: eje,
        contracts: rje,
        contractsAbi: bKe,
        crowdloan: bqe,
        cumulus: wqe,
        democracy: ije,
        dev: aje,
        discovery: lje,
        dryRunApi: Nqe,
        elections: uje,
        engine: fje,
        eth: EKe,
        evm: pje,
        extrinsics: hje,
        finality: xqe,
        fungibles: bje,
        genericAsset: mje,
        genesisBuilder: wje,
        gilt: _je,
        grandpa: Sje,
        identity: kje,
        imOnline: Tje,
        lottery: Cje,
        metadata: THe,
        mixnet: Ije,
        mmr: Rje,
        nfts: Vje,
        nimbus: AKe,
        nompools: Bje,
        offchain: qKe,
        offences: Fje,
        ormlOracle: OKe,
        ormlTokens: RKe,
        parachains: Pqe,
        payment: $Ke,
        poll: Oqe,
        pow: zje,
        proxy: Uje,
        purchase: Mqe,
        recovery: Hje,
        rpc: VKe,
        runtime: PHe,
        scaleInfo: MHe,
        scheduler: jje,
        session: Kje,
        society: $je,
        staking: Jje,
        state: GKe,
        statement: Qje,
        support: eqe,
        syncstate: nqe,
        system: iqe,
        treasury: oqe,
        txpayment: aqe,
        txqueue: lqe,
        uniques: uqe,
        utility: dqe,
        vesting: fqe,
        xcm: cKe,
        xcmPaymentApi: uKe,
        xcmRuntimeApi: fKe
    }, Symbol.toStringTag, {
        value: "Module"
    })), Am = {};
    Object.keys(vx).forEach((t)=>Object.entries(vx[t].rpc || {}).forEach(([e, n])=>{
            const r = n.aliasSection || t;
            Am[r] || (Am[r] = {}), Am[r][e] = Ye({}, n, {
                isSubscription: !!n.pubsub,
                jsonrpc: `${r}_${e}`,
                method: e,
                section: r
            });
        }));
    const nB = ma("PortableRegistry"), rB = {
        toNumber: ()=>-1
    }, ZKe = {
        Char: "u32",
        Str: "Text"
    }, JKe = sY([
        "sp_core::crypto::AccountId32",
        "sp_runtime::generic::era::Era",
        "sp_runtime::multiaddress::MultiAddress",
        "fp_account::AccountId20",
        "account::AccountId20",
        "polkadot_runtime_common::claims::EthereumAddress",
        "frame_support::weights::weight_v2::Weight",
        "sp_weights::weight_v2::Weight",
        "*_democracy::vote::Vote",
        "*_conviction_voting::vote::Vote",
        "*_identity::types::Data",
        "sp_core::OpaqueMetadata",
        "sp_core::OpaquePeerId",
        "sp_core::offchain::OpaqueMultiaddr",
        "primitive_types::*",
        "sp_arithmetic::per_things::*",
        "*_runtime::RuntimeCall",
        "*_runtime::RuntimeEvent",
        "ink::env::types::*",
        "ink::primitives::types::*",
        "ink_env::types::*",
        "ink_primitives::types::*"
    ]), YKe = sY([
        "pallet_identity::types::BitFlags"
    ]), rY = [
        "bitvec::order::Lsb0",
        "BitOrderLsb0"
    ], QKe = [
        "bitvec::order::Msb0",
        "BitOrderMsb0"
    ], sB = [
        ...rY,
        ...QKe
    ], e$e = [
        "BoundedBTreeMap",
        "BoundedBTreeSet",
        "BoundedVec",
        "Box",
        "BTreeMap",
        "BTreeSet",
        "Cow",
        "Option",
        "Range",
        "RangeInclusive",
        "Result",
        "WeakBoundedVec",
        "WrapperKeepOpaque",
        "WrapperOpaque"
    ], t$e = [
        "entries",
        "keys",
        "new",
        "size",
        "hash",
        "registry"
    ], n$e = [
        "generic",
        "misc",
        "pallet",
        "traits",
        "types"
    ];
    function iB(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++)n[r] = t[r].toString();
        return n;
    }
    function sY(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++)n[r] = t[r].split("::");
        return n;
    }
    function HA(t, e) {
        return t.length === e.length && t.every((n, r)=>{
            const s = e[r].toString();
            if (n === "*" || n === s) return !0;
            if (n.includes("*") && n.includes("_") && s.includes("_")) {
                let i = n.split("_"), o = s.split("_");
                if (i[0] === "*") {
                    const a = o.indexOf(i[1]);
                    a !== -1 && (i = i.slice(1), o = o.slice(a));
                }
                return i.length === 2 && i[1] === "*" && i[0] === o[0] ? !0 : HA(i, o);
            }
            return !1;
        });
    }
    function r$e({ def: t, path: e }) {
        return [
            "frame_support::weights::weight_v2::Weight",
            "sp_weights::weight_v2::Weight"
        ].includes(e.join("::")) ? !t.isComposite || t.asComposite.fields.length === 1 ? "WeightV1" : null : e.length && JKe.some((n)=>HA(n, e)) ? e[e.length - 1].toString() : null;
    }
    function iY(t, e, n, r, s = !1) {
        const i = r.length;
        if (i === 0 || e$e.includes(r[i - 1].toString())) return null;
        const o = new Array(i), a = new Array(i);
        for(let l = 0; l < i; l++){
            const u = xA(s ? r[l].replace("pallet_", "") : r[l]), d = u.toLowerCase();
            o[l] = u, a[l] = d;
        }
        let c = "";
        for(let l = 0; l < i; l++){
            const u = a[l];
            (l !== 1 || !n$e.includes(u)) && u !== a[l + 1] && (c += o[l]);
        }
        if (o[1] === "RawOrigin" && i === 2 && n.length === 2 && n[1].type.isSome) {
            const l = t[n[1].type.unwrap().toNumber()];
            l.type.path.length === 2 && (c = `${c}${l.type.path[1].toString()}`);
        }
        return {
            lookupIndex: e,
            name: c,
            params: n
        };
    }
    function s$e(t, e, { type: { params: n, path: r } }) {
        return iY(t, e, n, r);
    }
    function i$e(t, e, n) {
        const r = [
            n[e]
        ];
        for(let s = e + 1, i = n.length; s < i; s++){
            const o = n[s];
            o.name === t && r.push(o);
        }
        return r;
    }
    function oB(t, e) {
        const n = t.length;
        for(let r = 0; r < n; r++){
            const s = t[r];
            for(let i = r + 1; i < n; i++){
                const o = t[i];
                if (s.lookupIndex !== o.lookupIndex && s.name === o.name) return !1;
            }
        }
        for(let r = 0; r < n; r++){
            const s = t[r];
            e[s.lookupIndex] = s.name;
        }
        return !0;
    }
    function o$e(t, e, n) {
        const r = {};
        return n.map((s, i)=>{
            const { lookupIndex: o, name: a, params: c } = s;
            if (a) {
                if (r[o]) return s;
            } else return null;
            const l = i$e(a, i, n);
            if (l.length === 1 || !l.some((h)=>c.length !== h.params.length || c.some((m, w)=>!m.name.eq(h.params[w].name) || m.type.unwrapOr(rB).toNumber() !== h.params[w].type.unwrapOr(rB).toNumber()))) return s;
            const d = c.findIndex(({ type: h }, m)=>l.every(({ params: w }, v)=>w[m].type.isSome && (v === 0 || !w[m].type.eq(h))));
            if (d === -1) return s;
            const f = l.length, p = new Array(f);
            for(let h = 0; h < f; h++){
                const { lookupIndex: m, name: w, params: v } = l[h], { def: k, path: _ } = t.getSiType(v[d].type.unwrap());
                if (!k.isPrimitive && !_.length) return null;
                p[h] = {
                    lookupIndex: m,
                    name: k.isPrimitive ? `${w}${k.asPrimitive.toString()}` : `${w}${_[_.length - 1].toString()}`
                };
            }
            if (oB(p, r)) return s;
            for(let h = 0; h < f; h++){
                const { lookupIndex: m, name: w, params: v } = l[h], { def: k, path: _ } = t.getSiType(v[d].type.unwrap()), A = iY(e, m, v, _, !0);
                if (k.isPrimitive || !A) return null;
                p[h] = {
                    lookupIndex: m,
                    name: `${w}${A.name}`
                };
            }
            return oB(p, r) ? s : null;
        }).filter((s)=>!!s).map(({ lookupIndex: s, name: i, params: o })=>({
                lookupIndex: s,
                name: r[s] || i,
                params: o
            }));
    }
    function a$e(t, e, n, r) {
        if (t.registry.register(e), r.SpRuntimeUncheckedExtrinsic) {
            const [s, , i] = r.SpRuntimeUncheckedExtrinsic, o = t.getSiType(s.type.unwrap()), c = t.getSiType(i.type.unwrap()).path.join("::");
            let l = o.path.join("::");
            const u = l === "sp_runtime::multiaddress::MultiAddress";
            if (u) {
                const [d] = o.params;
                l = t.getSiType(d.type.unwrap()).path.join("::");
            }
            t.registry.register({
                AccountId: l.endsWith("::AccountId20") || l.endsWith("::H160") ? "AccountId20" : "AccountId32",
                Address: u ? "MultiAddress" : "AccountId",
                ExtrinsicSignature: [
                    "sp_runtime::MultiSignature"
                ].includes(c) ? "MultiSignature" : n[i.type.unwrap().toNumber()] || "MultiSignature"
            });
        }
    }
    function c$e(t, e) {
        const n = Object.keys(t).some((s)=>!s.startsWith("Pallet")), r = {};
        if (t.SpRuntimeUncheckedExtrinsic) {
            const [, { type: s }] = t.SpRuntimeUncheckedExtrinsic;
            r[s.unwrap().toNumber()] = "Call";
        } else n && !e && nB.warn("Unable to determine runtime Call type, cannot inspect sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic");
        if (t.FrameSystemEventRecord) {
            const [{ type: s }] = t.FrameSystemEventRecord;
            r[s.unwrap().toNumber()] = "Event";
        } else n && !e && nB.warn("Unable to determine runtime Event type, cannot inspect frame_system::EventRecord");
        return r;
    }
    function l$e(t, e) {
        const n = [], r = {};
        for(let c = 0, l = e.length; c < l; c++){
            const u = e[c], d = u.id.toNumber(), f = s$e(e, d, e[c]);
            f && n.push(f), r[d] = u;
        }
        const s = {}, i = {}, o = {}, a = o$e(t, e, n);
        for(let c = 0, l = a.length; c < l; c++){
            const { lookupIndex: u, name: d, params: f } = a[c];
            i[u] = d, s[d] = t.registry.createLookupType(u), o[d] = f;
        }
        return {
            lookups: s,
            names: i,
            params: o,
            types: r
        };
    }
    class u$e extends Gr {
        #e;
        #t;
        #n;
        #r;
        #s = {};
        #i;
        constructor(e, n, r){
            super(e, {
                types: "Vec<PortableType>"
            }, n);
            const { lookups: s, names: i, params: o, types: a } = l$e(this, this.types);
            this.#e = c$e(o, r), this.#t = s, this.#n = i, this.#r = o, this.#i = a;
        }
        get names() {
            return Object.values(this.#n).sort();
        }
        get paramTypes() {
            return this.#r;
        }
        get types() {
            return this.getT("types");
        }
        register() {
            a$e(this, this.#t, this.#n, this.#r);
        }
        getName(e) {
            return this.#n[this.#a(e)];
        }
        getSiType(e) {
            const n = (this.#i || this.types)[this.#a(e)];
            if (!n) throw new Error(`PortableRegistry: Unable to find type with lookupId ${e.toString()}`);
            return n.type;
        }
        getTypeDef(e) {
            const n = this.#a(e);
            if (!this.#s[n]) {
                const r = this.#n[n], s = {
                    info: Se.DoNotConstruct,
                    lookupIndex: n,
                    lookupName: r,
                    type: this.registry.createLookupType(n)
                };
                r && (this.#s[n] = s);
                const i = this.#l(this.getSiType(e), n);
                r || (this.#s[n] = s), Object.keys(i).forEach((o)=>{
                    (o !== "lookupName" || i[o]) && (this.#s[n][o] = i[o]);
                }), i.info === Se.Plain && (this.#s[n].lookupNameRoot = this.#s[n].lookupName, delete this.#s[n].lookupName);
            }
            return this.#s[n];
        }
        sanitizeField(e) {
            let n = null, r = null;
            return e.isSome && (n = tr(e.unwrap()), n.includes("#") ? (r = n, n = r.replace(/#/g, "_")) : t$e.includes(n) && (r = n, n = `${n}_`)), [
                n,
                r
            ];
        }
        #o(e) {
            const n = this.getTypeDef(e), r = e.toNumber();
            return [
                Se.DoNotConstruct,
                Se.Enum,
                Se.Struct
            ].includes(n.info) && n.lookupName ? {
                docs: n.docs,
                info: Se.Si,
                lookupIndex: r,
                lookupName: this.#n[r],
                type: this.registry.createLookupType(e)
            } : n;
        }
        #a(e) {
            if (br(e)) {
                if (!this.registry.isLookupType(e)) throw new Error(`PortableRegistry: Expected a lookup string type, found ${e}`);
                return parseInt(e.replace("Lookup", ""), 10);
            } else if (Xn(e)) return e;
            return e.toNumber();
        }
        #l(e, n) {
            const r = e.path.join("::");
            let s;
            const i = this.#e[n] || r$e(e);
            try {
                if (i) s = this.#w(n, i);
                else switch(e.def.type){
                    case "Array":
                        s = this.#f(n, e.def.asArray);
                        break;
                    case "BitSequence":
                        s = this.#y(n, e.def.asBitSequence);
                        break;
                    case "Compact":
                        s = this.#p(n, e.def.asCompact);
                        break;
                    case "Composite":
                        s = this.#h(n, e, e.def.asComposite);
                        break;
                    case "HistoricMetaCompat":
                        s = this.#g(n, e.def.asHistoricMetaCompat);
                        break;
                    case "Primitive":
                        s = this.#c(n, e);
                        break;
                    case "Sequence":
                        s = this.#_(n, e.def.asSequence);
                        break;
                    case "Tuple":
                        s = this.#m(n, e.def.asTuple);
                        break;
                    case "Variant":
                        s = this.#x(n, e, e.def.asVariant);
                        break;
                    default:
                        iLe(e.def.type);
                }
            } catch (o) {
                throw new Error(`PortableRegistry: ${n}${r ? ` (${r})` : ""}: Error extracting ${vn(e)}: ${o.message}`);
            }
            return Ye({
                docs: iB(e.docs),
                namespace: r
            }, s);
        }
        #f(e, { len: n, type: r }) {
            const s = n.toNumber();
            if (s > 2048) throw new Error("Only support for [Type; <length>], where length <= 2048");
            return so(this.registry, {
                info: Se.VecFixed,
                length: s,
                sub: this.#o(r)
            });
        }
        #y(e, { bitOrderType: n, bitStoreType: r }) {
            const s = this.#o(n), i = this.#o(r), [o, a] = sB.includes(s.namespace || "") ? [
                s,
                i
            ] : [
                i,
                s
            ];
            if (!o.namespace || !sB.includes(o.namespace)) throw new Error(`Unexpected bitOrder found as ${o.namespace || "<unknown>"}`);
            if (a.info !== Se.Plain || a.type !== "u8") throw new Error(`Only u8 bitStore is currently supported, found ${a.type}`);
            return rY.includes(o.namespace), {
                info: Se.Plain,
                type: "BitVec"
            };
        }
        #p(e, { type: n }) {
            return so(this.registry, {
                info: Se.Compact,
                sub: this.#o(n)
            });
        }
        #h(e, { params: n, path: r }, { fields: s }) {
            if (r.length) {
                const i = r[0].toString(), o = r[r.length - 1].toString();
                if (r.length === 1 && i === "BTreeMap") {
                    if (n.length !== 2) throw new Error(`BTreeMap requires 2 parameters, found ${n.length}`);
                    return so(this.registry, {
                        info: Se.BTreeMap,
                        sub: n.map(({ type: a })=>this.#o(a.unwrap()))
                    });
                } else if (r.length === 1 && i === "BTreeSet") {
                    if (n.length !== 1) throw new Error(`BTreeSet requires 1 parameter, found ${n.length}`);
                    return so(this.registry, {
                        info: Se.BTreeSet,
                        sub: this.#o(n[0].type.unwrap())
                    });
                } else if ([
                    "Range",
                    "RangeInclusive"
                ].includes(i)) {
                    if (n.length !== 1) throw new Error(`Range requires 1 parameter, found ${n.length}`);
                    return so(this.registry, {
                        info: i === "Range" ? Se.Range : Se.RangeInclusive,
                        sub: this.#o(n[0].type.unwrap()),
                        type: i
                    });
                } else if ([
                    "WrapperKeepOpaque",
                    "WrapperOpaque"
                ].includes(o)) {
                    if (n.length !== 1) throw new Error(`WrapperOpaque requires 1 parameter, found ${n.length}`);
                    return so(this.registry, {
                        info: o === "WrapperKeepOpaque" ? Se.WrapperKeepOpaque : Se.WrapperOpaque,
                        sub: this.#o(n[0].type.unwrap()),
                        type: o
                    });
                }
            }
            return YKe.some((i)=>HA(i, r)) ? this.#u(e, n, s) : this.#b(e, s);
        }
        #u(e, n, r) {
            if (n.length !== 1 || r.length !== 1) throw new Error("Set handling expects param/field as single entries");
            return so(this.registry, {
                info: Se.Set,
                length: this.registry.createTypeUnsafe(this.registry.createLookupType(r[0].type), []).bitLength(),
                sub: this.getSiType(n[0].type.unwrap()).def.asVariant.variants.map(({ index: s, name: i })=>({
                        index: s.toNumber(),
                        info: Se.Plain,
                        name: i.toString(),
                        type: "Null"
                    }))
            });
        }
        #b(e, n) {
            let r = !0, s = !0;
            const i = n.length;
            for(let c = 0; c < i; c++){
                const { name: l } = n[c];
                r = r && l.isSome, s = s && l.isNone;
            }
            if (!s && !r) throw new Error("Invalid fields type detected, expected either Tuple (all unnamed) or Struct (all named)");
            if (i === 0) return {
                info: Se.Null,
                type: "Null"
            };
            if (s && i === 1) {
                const c = this.#o(n[0].type);
                return Ye({}, c, e === -1 ? null : {
                    lookupIndex: e,
                    lookupName: this.#n[e],
                    lookupNameRoot: c.lookupName
                }, n[0].typeName.isSome ? {
                    typeName: _x(n[0].typeName.unwrap())
                } : null);
            }
            const [o, a] = this.#d(n);
            return so(this.registry, Ye({
                info: s ? Se.Tuple : Se.Struct,
                sub: o
            }, a.size ? {
                alias: a
            } : null, e === -1 ? null : {
                lookupIndex: e,
                lookupName: this.#n[e]
            }));
        }
        #d(e) {
            const n = new Map, r = e.length, s = new Array(r);
            for(let i = 0; i < r; i++){
                const { docs: o, name: a, type: c, typeName: l } = e[i], u = this.#o(c);
                if (a.isNone) s[i] = u;
                else {
                    const [d, f] = this.sanitizeField(a);
                    d && f && n.set(d, f), s[i] = Ye({
                        docs: iB(o),
                        name: d
                    }, u, l.isSome ? {
                        typeName: _x(l.unwrap())
                    } : null);
                }
            }
            return [
                s,
                n
            ];
        }
        #g(e, n) {
            return Ye({
                displayName: n.toString(),
                isFromSi: !0
            }, Tu(n));
        }
        #c(e, n) {
            const r = n.def.asPrimitive.type.toString();
            return {
                info: Se.Plain,
                type: ZKe[r] || r.toLowerCase()
            };
        }
        #w(e, n) {
            return {
                info: Se.Plain,
                type: n
            };
        }
        #_(e, { type: n }) {
            const r = this.#o(n);
            return r.type === "u8" ? {
                info: Se.Plain,
                type: "Bytes"
            } : so(this.registry, {
                info: Se.Vec,
                lookupIndex: e,
                lookupName: this.#n[e],
                sub: r
            });
        }
        #m(e, n) {
            if (n.length === 0) return {
                info: Se.Null,
                type: "Null"
            };
            if (n.length === 1) return this.getTypeDef(n[0]);
            const r = n.map((s)=>this.#o(s));
            return so(this.registry, {
                info: Se.Tuple,
                lookupIndex: e,
                lookupName: this.#n[e],
                sub: r
            });
        }
        #x(e, { params: n, path: r }, { variants: s }) {
            if (r.length) {
                const i = r[0].toString();
                if (i === "Option") {
                    if (n.length !== 1) throw new Error(`Option requires 1 parameter, found ${n.length}`);
                    return so(this.registry, {
                        info: Se.Option,
                        sub: this.#o(n[0].type.unwrap())
                    });
                } else if (i === "Result") {
                    if (n.length !== 2) throw new Error(`Result requires 2 parameters, found ${n.length}`);
                    return so(this.registry, {
                        info: Se.Result,
                        sub: n.map(({ type: o }, a)=>Ye({
                                name: [
                                    "Ok",
                                    "Error"
                                ][a]
                            }, this.#o(o.unwrap())))
                    });
                }
            }
            return s.length === 0 ? {
                info: Se.Null,
                type: "Null"
            } : this.#v(e, s);
        }
        #v(e, n) {
            const r = [];
            return n.slice().sort((s, i)=>s.index.cmp(i.index)).forEach(({ fields: s, index: i, name: o })=>{
                const a = i.toNumber();
                for(; r.length !== a;)r.push({
                    index: r.length,
                    info: Se.Null,
                    name: `__Unused${r.length}`,
                    type: "Null"
                });
                r.push(Ye(this.#b(-1, s), {
                    index: a,
                    name: o.toString()
                }));
            }), so(this.registry, {
                info: Se.Enum,
                lookupIndex: e,
                lookupName: this.#n[e],
                sub: r
            });
        }
    }
    function jA(t, e = []) {
        for(let n = 0, r = t.length; n < r; n++){
            const s = t[n];
            Array.isArray(s) ? jA(s, e) : e.push(s);
        }
        return [
            ...new Set(e)
        ];
    }
    function Py(t, e) {
        const n = t.getTypeDef(e);
        return n.lookupName || n.type;
    }
    function uc(t, { sub: e }) {
        const { lookupName: n, type: r } = e;
        return qA([
            n || r
        ]);
    }
    function lf(t, { sub: e }) {
        return qA(e.map(({ lookupName: n, type: r })=>n || r));
    }
    function Db(t, { info: e }) {
        throw new Error(`Unhandled: Unable to create and validate type from ${t} (info=${Se[e]})`);
    }
    const d$e = {
        [Se.BTreeMap]: lf,
        [Se.BTreeSet]: uc,
        [Se.Compact]: uc,
        [Se.DoNotConstruct]: Db,
        [Se.Enum]: lf,
        [Se.HashMap]: lf,
        [Se.Int]: Db,
        [Se.Linkage]: uc,
        [Se.Null]: Db,
        [Se.Option]: uc,
        [Se.Plain]: (t, e)=>e.lookupName || e.type,
        [Se.Range]: uc,
        [Se.RangeInclusive]: uc,
        [Se.Result]: lf,
        [Se.Set]: lf,
        [Se.Si]: Db,
        [Se.Struct]: lf,
        [Se.Tuple]: lf,
        [Se.UInt]: Db,
        [Se.Vec]: uc,
        [Se.VecFixed]: uc,
        [Se.WrapperKeepOpaque]: uc,
        [Se.WrapperOpaque]: uc
    };
    function qA(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++){
            const s = t[r], i = Tu(s);
            n[r] = d$e[i.info](s, i);
        }
        return n;
    }
    const f$e = ma("metadata");
    function p$e(t, e, n) {
        const r = jA(qA(n)).filter((s)=>!t.hasType(s) && !t.isLookupType(s)).sort();
        if (r.length !== 0) {
            const s = `Unknown types found, no types for ${r.join(", ")}`;
            if (e) throw new Error(s);
            f$e.warn(s);
        }
        return n;
    }
    function oY(t, e) {
        return e.map(({ type: n })=>t.getTypeDef(n).type);
    }
    function aB(t, e) {
        return t.getSiType(e).def.asVariant.variants.map(({ fields: n })=>oY(t, n));
    }
    function h$e({ lookup: t, pallets: e }) {
        return e.reduce((n, { calls: r, constants: s, events: i, storage: o })=>(n.push([
                oY(t, s)
            ]), r.isSome && n.push(aB(t, r.unwrap().type)), i.isSome && n.push(aB(t, i.unwrap().type)), o.isSome && n.push(o.unwrap().items.map(({ type: a })=>{
                if (a.isPlain) return [
                    t.getTypeDef(a.asPlain).type
                ];
                const { hashers: c, key: l, value: u } = a.asMap;
                return c.length === 1 ? [
                    t.getTypeDef(u).type,
                    t.getTypeDef(l).type
                ] : [
                    t.getTypeDef(u).type,
                    ...t.getSiType(l).def.asTuple.map((d)=>t.getTypeDef(d).type)
                ];
            })), n), []);
    }
    function g$e(t, e, n) {
        return p$e(t, n, jA(h$e(e)));
    }
    function b$e(t) {
        const e = t.map((r)=>r.toString().trim()), n = e.findIndex((r)=>!r.length);
        return n === -1 ? e : e.slice(0, n);
    }
    function m$e(t, { extrinsic: e, lookup: n, pallets: r }) {
        return t.createTypeUnsafe("MetadataLatest", [
            {
                extrinsic: e,
                lookup: {
                    types: n.types.map(({ id: s, type: i })=>t.createTypeUnsafe("PortableType", [
                            {
                                id: s,
                                type: Ye({}, i, {
                                    docs: b$e(i.docs)
                                })
                            }
                        ]))
                },
                pallets: r.map(({ calls: s, index: i, name: o })=>({
                        calls: t.createTypeUnsafe("Option<PalletCallMetadataLatest>", [
                            s.unwrapOr(null)
                        ]),
                        index: i,
                        name: o
                    }))
            }
        ]).toJSON();
    }
    function aY(t) {
        return t.isPlain ? t.asPlain : t.asMap.value;
    }
    function Jk(t, e, n) {
        const r = Py(t.lookup, aY(e));
        return n ? `Option<${r}>` : r;
    }
    function tb(t, { type: e }, n, r) {
        const s = {}, i = t.getSiType(e).def.asVariant.variants;
        for(let o = 0, a = i.length; o < a; o++)ni(s, i[o], r, n, o);
        return s;
    }
    const lo = {
        extrinsic: {},
        payload: {}
    }, y$e = {
        LimitParathreadCommits: lo,
        OnlyStakingAndClaims: lo,
        PrevalidateAttests: lo,
        RestrictFunctionality: lo,
        TransactionCallFilter: lo,
        ValidateDoubleVoteReports: lo
    }, w$e = {
        DisallowSigned: lo
    }, _$e = {
        ChargeAssetTxPayment: {
            extrinsic: {
                tip: "Compact<Balance>",
                assetId: "TAssetConversion"
            },
            payload: {}
        }
    }, x$e = {
        extrinsic: {
            mode: "u8"
        },
        payload: {
            metadataHash: "Option<[u8;32]>"
        }
    }, cB = {
        extrinsic: {
            era: "ExtrinsicEra"
        },
        payload: {
            blockHash: "Hash"
        }
    }, lB = {
        extrinsic: {
            tip: "Compact<Balance>"
        },
        payload: {}
    }, v$e = {
        ChargeTransactionPayment: lB,
        CheckBlockGasLimit: lo,
        CheckEra: cB,
        CheckGenesis: {
            extrinsic: {},
            payload: {
                genesisHash: "Hash"
            }
        },
        CheckMetadataHash: x$e,
        CheckMortality: cB,
        CheckNonZeroSender: lo,
        CheckNonce: {
            extrinsic: {
                nonce: "Compact<Index>"
            },
            payload: {}
        },
        CheckSpecVersion: {
            extrinsic: {},
            payload: {
                specVersion: "u32"
            }
        },
        CheckTxVersion: {
            extrinsic: {},
            payload: {
                transactionVersion: "u32"
            }
        },
        CheckVersion: {
            extrinsic: {},
            payload: {
                specVersion: "u32"
            }
        },
        CheckWeight: lo,
        LockStakingStatus: lo,
        SkipCheckIfFeeless: lB,
        ValidateEquivocationReport: lo,
        WeightReclaim: lo
    }, cY = Ye({}, v$e, y$e, w$e, _$e), AS = [
        "CheckVersion",
        "CheckGenesis",
        "CheckEra",
        "CheckNonce",
        "CheckWeight",
        "ChargeTransactionPayment",
        "CheckBlockGasLimit"
    ];
    function S$e(t, e = {}) {
        const n = [
            ...Object.keys(cY),
            ...Object.keys(e)
        ];
        return t.filter((r)=>!n.includes(r));
    }
    function uB(t, e, n = {}) {
        return t.map((r)=>n[r] || cY[r]).filter((r)=>!!r).reduce((r, s)=>Ye(r, s[e]), {});
    }
    function k$e(t, e) {
        if (!e?.length) return {
            DataType: Nc
        };
        const n = e.subarray(0, 2);
        return {
            DataType: t.findMetaEvent(n),
            value: {
                data: e.subarray(2),
                index: n
            }
        };
    }
    class lY extends eb {
        #e;
        #t;
        #n = null;
        #r;
        #s;
        constructor(e, n, r, s = "<unknown>", i = "<unknown>"){
            const o = r?.fields || [];
            super(e, o.map(({ type: c })=>e.createLookupType(c)), n), this.#e = r, this.#t = i, this.#r = s, this.#s = o.map(({ type: c })=>e.lookup.getTypeDef(c));
            const a = o.map(({ name: c })=>e.lookup.sanitizeField(c)[0]).filter((c)=>!!c);
            a.length === o.length && (this.#n = a, Vd(this, a, (c, l)=>this[l]));
        }
        get meta() {
            return this.#e;
        }
        get method() {
            return this.#t;
        }
        get names() {
            return this.#n;
        }
        get section() {
            return this.#r;
        }
        get typeDef() {
            return this.#s;
        }
        toHuman(e, n) {
            if (this.#n !== null) {
                const r = {};
                for(let s = 0, i = this.#n.length; s < i; s++)r[this.#n[s]] = this[s].toHuman(e, n);
                return r;
            }
            return super.toHuman(e);
        }
    }
    class T$e extends Gr {
        constructor(e, n){
            const { DataType: r, value: s } = k$e(e, n);
            super(e, {
                index: "EventId",
                data: r
            }, s);
        }
        get data() {
            return this.getT("data");
        }
        get index() {
            return this.getT("index");
        }
        get meta() {
            return this.data.meta;
        }
        get method() {
            return this.data.method;
        }
        get section() {
            return this.data.section;
        }
        get typeDef() {
            return this.data.typeDef;
        }
        toHuman(e, n) {
            return Ye({
                method: this.method,
                section: this.section
            }, e ? {
                docs: this.meta.docs.map((r)=>r.toString())
            } : null, super.toHuman(e, n));
        }
    }
    const Yk = 128, C$e = 0, Yf = new Uint8Array, WA = new Uint8Array([
        0
    ]), uY = 127, dY = "bare", KA = 4, dB = 63, fY = 192, E$e = 0, I$e = 64, pY = 4, fB = [
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicV4",
        "ExtrinsicV5"
    ], A$e = {
        bare: "ExtrinsicV5",
        general: "GeneralExtrinsic"
    }, pB = {
        bare: E$e,
        general: I$e
    }, $_ = {
        0: "bare",
        64: "general"
    };
    function Pm(t, e, n, r) {
        if (e instanceof $A) return e.unwrap();
        const s = (n & Yk) === Yk, i = (n & dB) === 5 ? A$e[r] : fB[n & dB] || fB[0];
        return t.createTypeUnsafe(i, [
            e,
            {
                isSigned: s,
                version: n
            }
        ]);
    }
    function P$e(t, e, n = pY, r = dY) {
        return Bt(e) || Array.isArray(e) || Fn(e) ? O$e(t, Dt(e), n, r) : e instanceof t.createClassUnsafe("Call") ? Pm(t, {
            method: e
        }, n, r) : Pm(t, e, n, r);
    }
    function O$e(t, e, n, r) {
        if (!e.length) return Pm(t, new Uint8Array, n, r);
        const [s, i] = W3(e), o = s + i.toNumber();
        if (o > e.length) throw new Error(`Extrinsic: length less than remainder, expected at least ${o}, found ${e.length}`);
        const a = e.subarray(s, o), c = a[0] & fY;
        return $_[`${c}`] === "general" ? Pm(t, e, a[0], $_[`${c}`] || r) : Pm(t, a.subarray(1), a[0], $_[`${c}`] || r);
    }
    class M$e extends X3 {
        #e;
        constructor(e, n, r, s){
            super(e, n, r);
            const i = Object.keys(e.getSignedExtensionTypes());
            if (this.version === 5 && s !== "general") {
                const a = (c)=>this.inner.signature[c];
                for(let c = 0, l = i.length; c < l; c++)_A(this, i[c], a);
            }
            const o = this.type & fY;
            this.#e = s || $_[`${o}`];
        }
        isGeneral() {
            return this.#e === "general";
        }
        get args() {
            return this.method.args;
        }
        get argsDef() {
            return this.method.argsDef;
        }
        get callIndex() {
            return this.method.callIndex;
        }
        get data() {
            return this.method.data;
        }
        get era() {
            return this.isGeneral() ? this.inner.era : this.inner.signature.era;
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get isSigned() {
            return this.isGeneral() ? !1 : this.inner.signature.isSigned;
        }
        get length() {
            return this.toU8a(!0).length;
        }
        get meta() {
            return this.method.meta;
        }
        get method() {
            return this.inner.method;
        }
        get nonce() {
            return this.isGeneral() ? this.inner.nonce : this.inner.signature.nonce;
        }
        get signature() {
            if (this.isGeneral()) throw new Error("Extrinsic: GeneralExtrinsic does not have signature implemented");
            return this.inner.signature.signature;
        }
        get signer() {
            if (this.isGeneral()) throw new Error("Extrinsic: GeneralExtrinsic does not have signer implemented");
            return this.inner.signature.signer;
        }
        get tip() {
            return this.isGeneral() ? this.inner.tip : this.inner.signature.tip;
        }
        get assetId() {
            return this.isGeneral() ? this.inner.assetId : this.inner.signature.assetId;
        }
        get metadataHash() {
            return this.isGeneral() ? this.inner.metadataHash : this.inner.signature.metadataHash;
        }
        get mode() {
            return this.isGeneral() ? this.inner.mode : this.inner.signature.mode;
        }
        get type() {
            return this.inner.version;
        }
        get inner() {
            return this.unwrap();
        }
        get version() {
            if (this.type <= pY) return this.type | (this.isSigned ? Yk : C$e);
            if (this.isSigned) throw new Error("Signed Extrinsics are currently only available for ExtrinsicV4");
            return this.type | (this.isGeneral() ? pB.general : pB.bare);
        }
        is(e) {
            return this.method.is(e);
        }
        unwrap() {
            return super.unwrap();
        }
    }
    class $A extends M$e {
        #e;
        static LATEST_EXTRINSIC_VERSION = KA;
        constructor(e, n, { preamble: r, version: s } = {}){
            const o = e.metadata.extrinsic.versions.length ? e.metadata.extrinsic.versions[0] : void 0;
            super(e, P$e(e, n, s || o, r), void 0, r);
        }
        get hash() {
            return this.#e || (this.#e = super.hash), this.#e;
        }
        addSignature(e, n, r) {
            return this.inner.addSignature(e, n, r), this.#e = void 0, this;
        }
        inspect() {
            const e = Ai(...this.toU8aInner());
            return {
                inner: this.isSigned ? this.inner.inspect().inner : this.inner.method.inspect().inner,
                outer: [
                    es(e.length),
                    new Uint8Array([
                        this.version
                    ])
                ]
            };
        }
        sign(e, n) {
            return this.inner.sign(e, n), this.#e = void 0, this;
        }
        signFake(e, n) {
            return this.inner.signFake(e, n), this.#e = void 0, this;
        }
        toHex(e) {
            return nn(this.toU8a(e));
        }
        toHuman(e, n) {
            return Ye({}, {
                isSigned: this.isSigned,
                method: this.method.toHuman(e, n)
            }, this.isSigned ? {
                assetId: this.assetId ? this.assetId.toHuman(e, n) : null,
                era: this.era.toHuman(e, n),
                metadataHash: this.metadataHash ? this.metadataHash.toHex() : null,
                mode: this.mode ? this.mode.toHuman() : null,
                nonce: this.nonce.toHuman(e, n),
                signature: this.signature.toHex(),
                signer: this.signer.toHuman(e, n),
                tip: this.tip.toHuman(e, n)
            } : null);
        }
        toJSON() {
            return this.toHex();
        }
        toRawType() {
            return "Extrinsic";
        }
        toU8a(e) {
            const n = Ai(...this.toU8aInner());
            return e ? n : Xp(n);
        }
        toU8aInner() {
            return [
                new Uint8Array([
                    this.version
                ]),
                this.inner.toU8a()
            ];
        }
    }
    function R$e(t) {
        const e = t.toString(2);
        let n = 0;
        for(; e[e.length - 1 - n] === "0";)n++;
        return n;
    }
    function N$e(t, e) {
        if (Bt(e) || Fn(e) || Array.isArray(e)) return D$e(t, Dt(e));
        if (e) {
            if (eo(e)) return V$e(t, e);
        } else return [
            new sa(t),
            new sa(t)
        ];
        throw new Error("Invalid data passed to Mortal era");
    }
    function V$e(t, e) {
        const { current: n, period: r } = e;
        let s = Math.pow(2, Math.ceil(Math.log2(r)));
        s = Math.min(Math.max(s, 4), 65536);
        const i = n % s, o = Math.max(s >> 12, 1), a = i / o * o;
        return [
            new sa(t, s),
            new sa(t, a)
        ];
    }
    function D$e(t, e) {
        if (e.length === 0) return [
            new sa(t),
            new sa(t)
        ];
        const n = uu(e.subarray(0, 1)).toNumber(), r = uu(e.subarray(1, 2)).toNumber(), s = n + (r << 8), i = 2 << s % 16, o = Math.max(i >> 12, 1), a = (s >> 4) * o;
        if (i < 4 || a >= i) throw new Error("Invalid data passed to Mortal era");
        return [
            new sa(t, i),
            new sa(t, a)
        ];
    }
    function Qk(t = new Uint8Array) {
        if (Bt(t)) return !t.length || t[0] === 0 ? new Uint8Array([
            0
        ]) : new Uint8Array([
            1,
            t[0],
            t[1]
        ]);
        if (t) {
            if (t instanceof bY) return Qk(t.toU8a());
            if (Fn(t)) return Qk(Hc(t));
            if (eo(t)) {
                const e = Object.entries(t).map(([s, i])=>[
                        s.toLowerCase(),
                        i
                    ]), n = e.find(([s])=>s.toLowerCase() === "mortalera"), r = e.find(([s])=>s.toLowerCase() === "immortalera");
                return n ? {
                    MortalEra: n[1]
                } : r ? {
                    ImmortalEra: r[1]
                } : {
                    MortalEra: t
                };
            }
        } else return new Uint8Array([
            0
        ]);
        throw new Error("Invalid data passed to Era");
    }
    class hY extends pa {
        constructor(e, n){
            super(e, WA);
        }
    }
    class gY extends eb {
        constructor(e, n){
            super(e, {
                period: sa,
                phase: sa
            }, N$e(e, n));
        }
        get encodedLength() {
            return 2;
        }
        get period() {
            return this[0];
        }
        get phase() {
            return this[1];
        }
        toHuman() {
            return {
                period: Lk(this.period),
                phase: Lk(this.phase)
            };
        }
        toJSON() {
            return this.toHex();
        }
        toU8a(e) {
            const n = this.period.toNumber(), r = Math.min(15, Math.max(1, R$e(n) - 1)) + (this.phase.toNumber() / Math.max(n >> 12, 1) << 4);
            return new Uint8Array([
                r & 255,
                r >> 8
            ]);
        }
        birth(e) {
            const n = this.phase.toNumber(), r = this.period.toNumber();
            return ~~((Math.max(Ms(e).toNumber(), n) - n) / r) * r + n;
        }
        death(e) {
            return this.birth(e) + this.period.toNumber();
        }
    }
    class bY extends fa {
        constructor(e, n){
            super(e, {
                ImmortalEra: hY,
                MortalEra: gY
            }, Qk(n));
        }
        get encodedLength() {
            return this.isImmortalEra ? this.asImmortalEra.encodedLength : this.asMortalEra.encodedLength;
        }
        get asImmortalEra() {
            if (!this.isImmortalEra) throw new Error(`Cannot convert '${this.type}' via asImmortalEra`);
            return this.inner;
        }
        get asMortalEra() {
            if (!this.isMortalEra) throw new Error(`Cannot convert '${this.type}' via asMortalEra`);
            return this.inner;
        }
        get isImmortalEra() {
            return this.index === 0;
        }
        get isMortalEra() {
            return this.index > 0;
        }
        toU8a(e) {
            return this.isMortalEra ? this.asMortalEra.toU8a(e) : this.asImmortalEra.toU8a(e);
        }
    }
    const hB = [
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadV4",
        "ExtrinsicPayloadV5"
    ], B$e = {
        bare: "ExtrinsicPayloadV5",
        general: "ExtrinsicPayloadV5"
    };
    function mY(t, e) {
        const n = e?.assetId;
        if (n && Fn(n)) {
            const r = t.createType("TAssetConversion", Hc(n));
            if (n === "0x00" || n === "0x01" + r.toHex().slice(2)) return {
                ...e,
                assetId: r.toJSON()
            };
        }
        return e;
    }
    function F$e(t, e, n = KA, r = dY) {
        if (e instanceof yY) return e.unwrap();
        const s = n === 5 ? B$e[r] : hB[n] || hB[0], i = mY(t, e);
        return t.createTypeUnsafe(s, [
            i,
            {
                version: n
            }
        ]);
    }
    class yY extends X3 {
        constructor(e, n, { preamble: r, version: s } = {}){
            super(e, F$e(e, n, s, r));
        }
        get blockHash() {
            return this.inner.blockHash;
        }
        get era() {
            return this.inner.era;
        }
        get genesisHash() {
            return this.inner.genesisHash || this.registry.createTypeUnsafe("Hash", []);
        }
        get method() {
            return this.inner.method;
        }
        get nonce() {
            return this.inner.nonce;
        }
        get specVersion() {
            return this.inner.specVersion || this.registry.createTypeUnsafe("u32", []);
        }
        get tip() {
            return this.inner.tip || this.registry.createTypeUnsafe("Compact<Balance>", []);
        }
        get transactionVersion() {
            return this.inner.transactionVersion || this.registry.createTypeUnsafe("u32", []);
        }
        get assetId() {
            return this.inner.assetId;
        }
        get metadataHash() {
            return this.inner.metadataHash;
        }
        eq(e) {
            return this.inner.eq(e);
        }
        sign(e) {
            const n = this.inner.sign(e);
            return {
                signature: nn(n)
            };
        }
        toHuman(e, n) {
            return this.inner.toHuman(e, n);
        }
        toJSON() {
            return this.toHex();
        }
        toRawType() {
            return "ExtrinsicPayload";
        }
        toString() {
            return this.toHex();
        }
        toU8a(e) {
            return super.toU8a(e ? {
                method: !0
            } : !1);
        }
    }
    class L$e extends Gr {
        constructor(e, n, { version: r = 0 } = {}){
            throw super(e, {}), new Error(`Unsupported extrinsic payload version ${r}`);
        }
    }
    class z$e extends Gr {
        constructor(e, n, { isSigned: r = !1, version: s = 0 } = {}){
            throw super(e, {}), new Error(`Unsupported ${r ? "" : "un"}signed extrinsic version ${s & uY}`);
        }
    }
    const gB = {
        address: "Address",
        assetId: "Option<TAssetConversion>",
        blockHash: "Hash",
        blockNumber: "BlockNumber",
        era: "ExtrinsicEra",
        genesisHash: "Hash",
        metadataHash: "Option<[u8;32]>",
        method: "Call",
        mode: "u8",
        nonce: "Compact<Index>",
        runtimeVersion: "RuntimeVersion",
        signedExtensions: "Vec<Text>",
        tip: "Compact<Balance>",
        version: "u8"
    };
    class U$e extends Gr {
        #e;
        constructor(e, n){
            const r = Ye({}, e.getSignedExtensionTypes(), e.getSignedExtensionExtra());
            super(e, Ye({}, r, gB, {
                withSignedTransaction: "bool"
            }), n), this.#e = {};
            const s = (i)=>this.get(i);
            for (const [i, o] of Object.entries(r))gB[i] || (this.#e[i] = o), _A(this, i, s);
        }
        get address() {
            return this.getT("address");
        }
        get blockHash() {
            return this.getT("blockHash");
        }
        get blockNumber() {
            return this.getT("blockNumber");
        }
        get era() {
            return this.getT("era");
        }
        get genesisHash() {
            return this.getT("genesisHash");
        }
        get method() {
            return this.getT("method");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get runtimeVersion() {
            return this.getT("runtimeVersion");
        }
        get signedExtensions() {
            return this.getT("signedExtensions");
        }
        get tip() {
            return this.getT("tip");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get version() {
            return this.getT("version");
        }
        get mode() {
            return this.getT("mode");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        get withSignedTransaction() {
            return this.getT("withSignedTransaction").isTrue;
        }
        toPayload() {
            const e = {}, n = Object.keys(this.#e);
            for(let r = 0, s = n.length; r < s; r++){
                const i = n[r], o = this.getT(i);
                (!(o instanceof Dd) || o.isSome) && (e[i] = o.toJSON());
            }
            return Ye(e, {
                address: this.address.toString(),
                assetId: this.assetId && this.assetId.isSome ? this.assetId.toHex() : null,
                blockHash: this.blockHash.toHex(),
                blockNumber: this.blockNumber.toHex(),
                era: this.era.toHex(),
                genesisHash: this.genesisHash.toHex(),
                metadataHash: this.metadataHash.isSome ? this.metadataHash.toHex() : null,
                method: this.method.toHex(),
                mode: this.mode.toNumber(),
                nonce: this.nonce.toHex(),
                signedExtensions: this.signedExtensions.map((r)=>r.toString()),
                specVersion: this.runtimeVersion.specVersion.toHex(),
                tip: this.tip.toHex(),
                transactionVersion: this.runtimeVersion.transactionVersion.toHex(),
                version: this.version.toNumber(),
                withSignedTransaction: this.withSignedTransaction
            });
        }
        toRaw() {
            const e = this.toPayload(), n = nn(this.registry.createTypeUnsafe("ExtrinsicPayload", [
                e,
                {
                    version: e.version
                }
            ]).toU8a({
                method: !0
            }));
            return {
                address: e.address,
                data: n,
                type: "payload"
            };
        }
    }
    const H$e = 4;
    class Sx extends Gr {
        constructor(e, n, { isSigned: r } = {}){
            super(e, {
                signature: "ExtrinsicSignatureV4",
                method: "Call"
            }, Sx.decodeExtrinsic(e, n, r));
        }
        static decodeExtrinsic(e, n, r = !1) {
            if (n instanceof Sx) return n;
            if (n instanceof e.createClassUnsafe("Call")) return {
                method: n
            };
            if (Bt(n)) {
                const s = e.createTypeUnsafe("ExtrinsicSignatureV4", [
                    n,
                    {
                        isSigned: r
                    }
                ]);
                return {
                    method: e.createTypeUnsafe("Call", [
                        n.subarray(s.encodedLength)
                    ]),
                    signature: s
                };
            }
            return n || {};
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get method() {
            return this.getT("method");
        }
        get signature() {
            return this.getT("signature");
        }
        get version() {
            return H$e;
        }
        addSignature(e, n, r) {
            return this.signature.addSignature(e, n, r), this;
        }
        sign(e, n) {
            return this.signature.sign(this.method, e, n), this;
        }
        signFake(e, n) {
            return this.signature.signFake(this.method, e, n), this;
        }
    }
    function j$e(t, e, n, r) {
        const s = n.length > 256 ? Gl(n) : n;
        return e.sign(s, r);
    }
    class eT extends Gr {
        #e;
        constructor(e, n){
            super(e, Ye({
                method: "Bytes"
            }, e.getSignedExtensionTypes(), e.getSignedExtensionExtra()), mY(e, n)), this.#e = {
                withType: e.createTypeUnsafe("ExtrinsicSignature", []) instanceof fa
            };
        }
        inspect() {
            return super.inspect({
                method: !0
            });
        }
        get blockHash() {
            return this.getT("blockHash");
        }
        get era() {
            return this.getT("era");
        }
        get genesisHash() {
            return this.getT("genesisHash");
        }
        get method() {
            return this.getT("method");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get specVersion() {
            return this.getT("specVersion");
        }
        get tip() {
            return this.getT("tip");
        }
        get transactionVersion() {
            return this.getT("transactionVersion");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        sign(e) {
            return j$e(this.registry, e, this.toU8a({
                method: !0
            }), this.#e);
        }
    }
    const q$e = new Uint8Array(256).fill(1);
    function PS(t, e) {
        return t.createTypeUnsafe("Address", [
            Bt(e) ? nn(e) : e
        ]);
    }
    class kx extends Gr {
        #e;
        constructor(e, n, { isSigned: r } = {}){
            const s = e.getSignedExtensionTypes();
            super(e, Ye({
                signer: "Address",
                signature: "ExtrinsicSignature"
            }, s), kx.decodeExtrinsicSignature(n, r)), this.#e = Object.keys(s), Vd(this, this.#e, (i)=>this.get(i));
        }
        static decodeExtrinsicSignature(e, n = !1) {
            if (e) {
                if (e instanceof kx) return e;
            } else return Yf;
            return n ? e : Yf;
        }
        get encodedLength() {
            return this.isSigned ? super.encodedLength : 0;
        }
        get isSigned() {
            return !this.signature.isEmpty;
        }
        get era() {
            return this.getT("era");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get signature() {
            return this.multiSignature.value || this.multiSignature;
        }
        get multiSignature() {
            return this.getT("signature");
        }
        get signer() {
            return this.getT("signer");
        }
        get tip() {
            return this.getT("tip");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get mode() {
            return this.getT("mode");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        _injectSignature(e, n, r) {
            for(let s = 0, i = this.#e.length; s < i; s++){
                const o = this.#e[s], a = r.get(o);
                Rr(a) || this.set(o, a);
            }
            return this.set("signer", e), this.set("signature", n), this;
        }
        addSignature(e, n, r) {
            return this._injectSignature(PS(this.registry, e), this.registry.createTypeUnsafe("ExtrinsicSignature", [
                n
            ]), new eT(this.registry, r));
        }
        createPayload(e, n) {
            const { era: r, runtimeVersion: { specVersion: s, transactionVersion: i } } = n;
            return new eT(this.registry, Ye({}, n, {
                era: r || WA,
                method: e.toHex(),
                specVersion: s,
                transactionVersion: i
            }));
        }
        sign(e, n, r) {
            if (!n?.addressRaw) throw new Error(`Expected a valid keypair for signing, found ${vn(n)}`);
            const s = this.createPayload(e, r);
            return this._injectSignature(PS(this.registry, n.addressRaw), this.registry.createTypeUnsafe("ExtrinsicSignature", [
                s.sign(n)
            ]), s);
        }
        signFake(e, n, r) {
            if (!n) throw new Error(`Expected a valid address for signing, found ${vn(n)}`);
            const s = this.createPayload(e, r);
            return this._injectSignature(PS(this.registry, n), this.registry.createTypeUnsafe("ExtrinsicSignature", [
                q$e
            ]), s);
        }
        toU8a(e) {
            return this.isSigned ? super.toU8a(e) : Yf;
        }
    }
    const W$e = 5;
    class Tx extends Gr {
        constructor(e, n, { isSigned: r } = {}){
            super(e, {
                signature: "ExtrinsicSignatureV5",
                method: "Call"
            }, Tx.decodeExtrinsic(e, n, r));
        }
        static decodeExtrinsic(e, n, r = !1) {
            if (n instanceof Tx) return n;
            if (n instanceof e.createClassUnsafe("Call")) return {
                method: n
            };
            if (Bt(n)) {
                const s = e.createTypeUnsafe("ExtrinsicSignatureV5", [
                    n,
                    {
                        isSigned: r
                    }
                ]);
                return {
                    method: e.createTypeUnsafe("Call", [
                        n.subarray(s.encodedLength)
                    ]),
                    signature: s
                };
            }
            return n || {};
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        get method() {
            return this.getT("method");
        }
        get signature() {
            return this.getT("signature");
        }
        get version() {
            return W$e;
        }
        get preamble() {
            return this.getT("preamble");
        }
        addSignature(e, n, r) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        sign(e, n) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        signFake(e, n) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
    }
    class wY extends Gr {
        constructor(e, n){
            super(e, Ye({
                method: "Bytes"
            }, e.getSignedExtensionTypes(), e.getSignedExtensionExtra()), n);
        }
        inspect() {
            return super.inspect({
                method: !0
            });
        }
        get blockHash() {
            return this.getT("blockHash");
        }
        get era() {
            return this.getT("era");
        }
        get genesisHash() {
            return this.getT("genesisHash");
        }
        get method() {
            return this.getT("method");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get specVersion() {
            return this.getT("specVersion");
        }
        get tip() {
            return this.getT("tip");
        }
        get transactionVersion() {
            return this.getT("transactionVersion");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        sign(e) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
    }
    class Cx extends Gr {
        #e;
        constructor(e, n, { isSigned: r } = {}){
            const s = e.getSignedExtensionTypes();
            super(e, Ye({
                signer: "Address",
                signature: "ExtrinsicSignature",
                transactionExtensionVersion: "u8"
            }, s), Cx.decodeExtrinsicSignature(n, r)), this.#e = Object.keys(s), Vd(this, this.#e, (i)=>this.get(i));
        }
        static decodeExtrinsicSignature(e, n = !1) {
            if (e) {
                if (e instanceof Cx) return e;
            } else return Yf;
            return n ? e : Yf;
        }
        get encodedLength() {
            return this.isSigned ? super.encodedLength : 0;
        }
        get isSigned() {
            return !this.signature.isEmpty;
        }
        get era() {
            return this.getT("era");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get signature() {
            return this.multiSignature.value || this.multiSignature;
        }
        get multiSignature() {
            return this.getT("signature");
        }
        get signer() {
            return this.getT("signer");
        }
        get tip() {
            return this.getT("tip");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get mode() {
            return this.getT("mode");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        get transactionExtensionVersion() {
            return this.getT("transactionExtensionVersion");
        }
        _injectSignature(e, n, r) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        addSignature(e, n, r) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        createPayload(e, n) {
            const { era: r, runtimeVersion: { specVersion: s, transactionVersion: i } } = n;
            return new wY(this.registry, Ye({}, n, {
                era: r || WA,
                method: e.toHex(),
                specVersion: s,
                transactionVersion: i
            }));
        }
        sign(e, n, r) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        signFake(e, n, r) {
            throw new Error("Extrinsic: ExtrinsicV5 does not include signing support");
        }
        toU8a(e) {
            return this.isSigned ? super.toU8a(e) : Yf;
        }
    }
    function K$e(t) {
        if (!t.length) return new Uint8Array;
        const [e, n] = W3(t), r = e + n.toNumber();
        if (r > t.length) throw new Error(`Extrinsic: length less than remainder, expected at least ${r}, found ${t.length}`);
        const s = t.subarray(e, r);
        if (s[0] !== 69) throw new Error(`Extrinsic: incorrect version for General Transactions, expected 5, found ${s[0] & uY}`);
        return s.subarray(1);
    }
    class Ex extends Gr {
        #e;
        #t;
        constructor(e, n, r){
            const s = e.getSignedExtensionTypes();
            super(e, Ye({
                transactionExtensionVersion: "u8"
            }, s, {
                method: "Call"
            }), Ex.decodeExtrinsic(e, n)), this.#e = r?.version || 5, this.#t = 64;
        }
        static decodeExtrinsic(e, n) {
            if (n) {
                if (n instanceof Ex) return n;
                if (Bt(n) || Array.isArray(n) || Fn(n)) return K$e(Dt(n));
                if (eo(n)) {
                    const { payload: r, transactionExtensionVersion: s } = n;
                    return Ye(r || {}, {
                        transactionExtensionVersion: s || e.getTransactionExtensionVersion()
                    });
                }
            } else return Yf;
            return {};
        }
        get encodedLength() {
            return super.encodedLength;
        }
        get era() {
            return this.getT("era");
        }
        get nonce() {
            return this.getT("nonce");
        }
        get tip() {
            return this.getT("tip");
        }
        get assetId() {
            return this.getT("assetId");
        }
        get mode() {
            return this.getT("mode");
        }
        get metadataHash() {
            return this.getT("metadataHash");
        }
        get transactionExtensionVersion() {
            return this.getT("transactionExtensionVersion");
        }
        get method() {
            return this.getT("method");
        }
        get version() {
            return this.#e;
        }
        get preamble() {
            return this.#t;
        }
        toHex(e) {
            return nn(this.toU8a(e));
        }
        toU8a(e) {
            return e ? this.encode() : Xp(this.encode());
        }
        toRawType() {
            return "GeneralExt";
        }
        encode() {
            return Ai(new Uint8Array([
                this.version | this.preamble
            ]), super.toU8a());
        }
        signFake() {
            throw new Error("Extrinsic: Type GeneralExtrinsic does not have signFake implemented");
        }
        addSignature() {
            throw new Error("Extrinsic: Type GeneralExtrinsic does not have addSignature implemented");
        }
        sign() {
            throw new Error("Extrinsic: Type GeneralExtrinsic does not have sign implemented");
        }
        signature() {
            throw new Error("Extrinsic: Type GeneralExtrinsic does not have the signature getter");
        }
    }
    function bB(t) {
        if (Bt(t) || Array.isArray(t)) return Dt(t);
        if (t) {
            if (Fn(t)) return Hc(t);
            if (br(t)) return Xd(t.toString());
        } else return new Uint8Array;
        throw new Error(`Unknown type passed to AccountId constructor, found typeof ${typeof t}`);
    }
    class _Y extends Gd {
        constructor(e, n = 264, r){
            const s = bB(r);
            if (s.length * 8 < n && s.some((o)=>o)) throw new Error(`Invalid AccountId provided, expected ${n >> 3} bytes, found ${s.length}`);
            super(e, s, n);
        }
        eq(e) {
            return super.eq(bB(e));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toString() {
            return MJ(this, this.registry.chainSS58);
        }
        toRawType() {
            return "AccountId";
        }
    }
    class Ix extends _Y {
        constructor(e, n){
            super(e, 256, n);
        }
    }
    class $$e extends _Y {
        constructor(e, n){
            super(e, 264, n);
        }
    }
    const X$e = 239, mB = 252, yB = 253, wB = 254, G$e = new ht(X$e), Z$e = new ht(1).shln(16), J$e = new ht(1).shln(32);
    function xY(t) {
        return t instanceof ws ? t.toBn() : Ya(t) || Xn(t) || Fn(t) || Bt(t) || $p(t) ? t : xY(Xd(t));
    }
    class ws extends Iy {
        constructor(e, n = new ht(0)){
            super(e, xY(n));
        }
        static calcLength(e) {
            const n = Ms(e);
            return n.lte(G$e) ? 1 : n.lt(Z$e) ? 2 : n.lt(J$e) ? 4 : 8;
        }
        static readLength(e) {
            const n = e[0];
            return n === mB ? [
                1,
                2
            ] : n === yB ? [
                1,
                4
            ] : n === wB ? [
                1,
                8
            ] : [
                0,
                1
            ];
        }
        static writeLength(e) {
            switch(e.length){
                case 2:
                    return new Uint8Array([
                        mB
                    ]);
                case 4:
                    return new Uint8Array([
                        yB
                    ]);
                case 8:
                    return new Uint8Array([
                        wB
                    ]);
                default:
                    return new Uint8Array([]);
            }
        }
        eq(e) {
            return Ya(e) || Xn(e) ? super.eq(e) : super.eq(this.registry.createTypeUnsafe("AccountIndex", [
                e
            ]));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toString() {
            const e = ws.calcLength(this);
            return MJ(this.toU8a().subarray(0, e), this.registry.chainSS58);
        }
        toRawType() {
            return "AccountIndex";
        }
    }
    class Y$e extends Gr {
        constructor(e, n){
            super(e, {
                header: "Header",
                extrinsics: "Vec<Extrinsic>"
            }, n);
        }
        get contentHash() {
            return this.registry.hash(this.toU8a());
        }
        get extrinsics() {
            return this.getT("extrinsics");
        }
        get hash() {
            return this.header.hash;
        }
        get header() {
            return this.getT("header");
        }
    }
    function XA(t, e) {
        return e.fields.reduce((n, { name: r, type: s }, i)=>(n[r.unwrapOr(`param${i}`).toString()] = t.createLookupType(s), n), {});
    }
    function Q$e(t, e, n) {
        const { args: r, callIndex: s } = e, i = s instanceof vY ? s.toU8a() : s, o = n || t.findMetaCall(i).meta;
        return {
            args: r,
            argsDef: XA(t, o),
            callIndex: s,
            meta: o
        };
    }
    function eXe(t, e, n) {
        const r = t.firstCallIndex.slice();
        r.set(e.subarray(0, 2), 0);
        const s = n || t.findMetaCall(r).meta;
        return {
            args: e.subarray(2),
            argsDef: XA(t, s),
            callIndex: r,
            meta: s
        };
    }
    function tXe(t, e = new Uint8Array, n) {
        if (Bt(e) || Fn(e)) return eXe(t, Dt(e), n);
        if (eo(e) && e.callIndex && e.args) return Q$e(t, e, n);
        throw new Error(`Call: Cannot decode value '${e}' of type ${typeof e}`);
    }
    class vY extends Gd {
        constructor(e, n){
            super(e, n, 16);
        }
        toPrimitive() {
            return this.toHex();
        }
    }
    class nXe extends Gr {
        _meta;
        constructor(e, n, r){
            const s = tXe(e, n, r);
            try {
                super(e, {
                    callIndex: vY,
                    args: Gr.with(s.argsDef)
                }, s);
            } catch (i) {
                let o = "unknown.unknown";
                try {
                    const a = e.findMetaCall(s.callIndex);
                    o = `${a.section}.${a.method}`;
                } catch  {}
                throw new Error(`Call: failed decoding ${o}:: ${i.message}`);
            }
            this._meta = s.meta;
        }
        get args() {
            return [
                ...this.getT("args").values()
            ];
        }
        get argsDef() {
            return XA(this.registry, this.meta);
        }
        get argsEntries() {
            return [
                ...this.getT("args").entries()
            ];
        }
        get callIndex() {
            return this.getT("callIndex").toU8a();
        }
        get data() {
            return this.getT("args").toU8a();
        }
        get meta() {
            return this._meta;
        }
        get method() {
            return this.registry.findMetaCall(this.callIndex).method;
        }
        get section() {
            return this.registry.findMetaCall(this.callIndex).section;
        }
        is(e) {
            return e.callIndex[0] === this.callIndex[0] && e.callIndex[1] === this.callIndex[1];
        }
        toHuman(e, n) {
            let r;
            try {
                r = this.registry.findMetaCall(this.callIndex);
            } catch  {}
            return Ye({
                args: this.argsEntries.reduce((s, [i, o])=>Ye(s, {
                        [i]: o.toHuman(e, n)
                    }), {}),
                method: r?.method,
                section: r?.section
            }, e && r ? {
                docs: r.meta.docs.map((s)=>s.toString())
            } : null);
        }
        toRawType() {
            return "Call";
        }
    }
    function Yw(t, e, n, r = !0) {
        return n && Mt(n.unwrapOrDefault) ? n : t.createTypeUnsafe(e, [
            r ? Gf(n) || Rr(n) ? null : Array.isArray(n) ? n : [
                n
            ] : n
        ]);
    }
    function rXe(t, e, n) {
        return e === "ss58Format" ? Yw(t, "Option<u32>", n, !1) : e === "tokenDecimals" ? Yw(t, "Option<Vec<u32>>", n) : e === "tokenSymbol" ? Yw(t, "Option<Vec<Text>>", n) : e === "isEthereum" ? Yw(t, "Bool", n, !1) : n;
    }
    function sXe(t, e) {
        return (e && Mt(e.entries) ? [
            ...e.entries()
        ] : Object.entries(e || {})).reduce((n, [r, s])=>(n[r] = rXe(t, r, s), n), {
            isEthereum: t.createTypeUnsafe("Bool", []),
            ss58Format: t.createTypeUnsafe("Option<u32>", []),
            tokenDecimals: t.createTypeUnsafe("Option<Vec<u32>>", []),
            tokenSymbol: t.createTypeUnsafe("Option<Vec<Text>>", [])
        });
    }
    class iXe extends GJ {
        constructor(e, n){
            super(e, sXe(e, n));
        }
        get isEthereum() {
            return this.getT("isEthereum");
        }
        get ss58Format() {
            return this.getT("ss58Format");
        }
        get tokenDecimals() {
            return this.getT("tokenDecimals");
        }
        get tokenSymbol() {
            return this.getT("tokenSymbol");
        }
    }
    const oXe = ja("aura"), aXe = ja("BABE"), cXe = ja("FRNK"), lXe = ja("pow_"), uXe = ja("nmbs");
    function dXe(t, e, n) {
        return n[t.createTypeUnsafe("RawAuraPreDigest", [
            e.toU8a(!0)
        ]).slotNumber.mod(new ht(n.length)).toNumber()];
    }
    function fXe(t, e, n) {
        const r = t.createTypeUnsafe("RawBabePreDigestCompat", [
            e.toU8a(!0)
        ]);
        return n[r.value.toNumber()];
    }
    function pXe(t, e) {
        return t.createTypeUnsafe("AccountId", [
            e
        ]);
    }
    class hXe extends Gd {
        constructor(e, n){
            super(e, Xn(n) ? $l(n, {
                isLe: !1
            }) : n, 32);
        }
        get isAura() {
            return this.eq(oXe);
        }
        get isBabe() {
            return this.eq(aXe);
        }
        get isGrandpa() {
            return this.eq(cXe);
        }
        get isPow() {
            return this.eq(lXe);
        }
        get isNimbus() {
            return this.eq(uXe);
        }
        extractAuthor(e, n) {
            if (n?.length) {
                if (this.isAura) return dXe(this.registry, e, n);
                if (this.isBabe) return fXe(this.registry, e, n);
            }
            if (this.isPow || this.isNimbus) return pXe(this.registry, e);
        }
        toHuman() {
            return this.toString();
        }
        toRawType() {
            return "ConsensusEngineId";
        }
        toString() {
            return this.isAscii ? Kl(this) : nn(this);
        }
    }
    const _B = new Uint8Array([
        255
    ]);
    function gXe(t, e) {
        const n = Xd(e);
        return n.length === 32 ? t.createTypeUnsafe("AccountId", [
            n
        ]) : t.createTypeUnsafe("AccountIndex", [
            uu(n)
        ]);
    }
    function bXe(t, e) {
        if (e.length === 32) return t.createTypeUnsafe("AccountId", [
            e
        ]);
        if (e[0] === 255) return t.createTypeUnsafe("AccountId", [
            e.subarray(1)
        ]);
        const [n, r] = ws.readLength(e);
        return t.createTypeUnsafe("AccountIndex", [
            uu(e.subarray(n, n + r))
        ]);
    }
    function mXe(t, e) {
        return e instanceof SY ? e.inner : e instanceof Ix || e instanceof ws ? e : Ya(e) || Xn(e) || $p(e) ? t.createTypeUnsafe("AccountIndex", [
            e
        ]) : Array.isArray(e) || Fn(e) || Bt(e) ? bXe(t, Dt(e)) : gXe(t, e);
    }
    class SY extends X3 {
        constructor(e, n = new Uint8Array){
            super(e, mXe(e, n));
        }
        get encodedLength() {
            const e = this._rawLength;
            return e + (e > 1 ? 1 : 0);
        }
        get _rawLength() {
            return this.inner instanceof ws ? ws.calcLength(this.inner) : this.inner.encodedLength;
        }
        inspect() {
            const e = this.inner.toU8a().subarray(0, this._rawLength);
            return {
                outer: [
                    new Uint8Array(this.inner instanceof ws ? ws.writeLength(e) : _B),
                    e
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toRawType() {
            return "Address";
        }
        toU8a(e) {
            const n = this.inner.toU8a().subarray(0, this._rawLength);
            return e ? n : Ai(this.inner instanceof ws ? ws.writeLength(n) : _B, n);
        }
    }
    function xB(t, e) {
        return [
            0,
            32
        ].includes(e.length) ? {
            Id: e
        } : e.length === 20 ? {
            Address20: e
        } : e.length <= 8 ? {
            Index: t.createTypeUnsafe("AccountIndex", [
                e
            ]).toNumber()
        } : e;
    }
    function yXe(t, e) {
        return e instanceof Ix ? {
            Id: e
        } : Bt(e) ? xB(t, e) : e instanceof tT ? e : e instanceof ws || Ya(e) || Xn(e) ? {
            Index: Xn(e) ? e : e.toNumber()
        } : br(e) ? xB(t, Xd(e.toString())) : e;
    }
    class tT extends fa {
        constructor(e, n){
            super(e, {
                Id: "AccountId",
                Index: "Compact<AccountIndex>",
                Raw: "Bytes",
                Address32: "H256",
                Address20: "H160"
            }, yXe(e, n));
        }
        inspect() {
            const { inner: e, outer: n = [] } = this.inner.inspect();
            return {
                inner: e,
                outer: [
                    new Uint8Array([
                        this.index
                    ]),
                    ...n
                ]
            };
        }
        toString() {
            return this.value.toString();
        }
    }
    const Ax = 128, GA = 0, wXe = 127, kY = 0;
    function vB(t) {
        return t ? new Uint8Array([
            Ax | kY
        ]) : new Uint8Array([
            GA
        ]);
    }
    function _Xe(t) {
        return t.length ? t.subarray(0, 1) : new Uint8Array([
            GA
        ]);
    }
    function xXe(t, e) {
        return new Uint8Array([
            (new sg(t, e.aye).isTrue ? Ax : GA) | t.createTypeUnsafe("Conviction", [
                e.conviction || kY
            ]).index
        ]);
    }
    function vXe(t, e) {
        return Bt(e) ? _Xe(e) : Rr(e) || e instanceof Boolean || Cy(e) ? vB(new sg(t, e).isTrue) : Xn(e) ? vB(e < 0) : xXe(t, e);
    }
    class SXe extends Gd {
        #e;
        #t;
        constructor(e, n){
            const r = vXe(e, n);
            super(e, r, 8), this.#e = (r[0] & Ax) === Ax, this.#t = this.registry.createTypeUnsafe("Conviction", [
                r[0] & wXe
            ]);
        }
        get conviction() {
            return this.#t;
        }
        get isAye() {
            return this.#e;
        }
        get isNay() {
            return !this.isAye;
        }
        toHuman(e) {
            return {
                conviction: this.conviction.toHuman(e),
                vote: this.isAye ? "Aye" : "Nay"
            };
        }
        toPrimitive() {
            return {
                aye: this.isAye,
                conviction: this.conviction.toPrimitive()
            };
        }
        toRawType() {
            return "Vote";
        }
    }
    function SB(t) {
        return Bt(t) || Array.isArray(t) ? Dt(t) : Fn(t) || FUe(t.toString()) ? Hc(t.toString()) : br(t) ? Dt(t) : t;
    }
    class TY extends Gd {
        constructor(e, n = new Uint8Array){
            super(e, SB(n), 160);
        }
        eq(e) {
            return !!e && super.eq(SB(e));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toString() {
            return VUe(this);
        }
        toRawType() {
            return "AccountId";
        }
    }
    const kXe = new Uint8Array([
        255
    ]);
    function TXe(t, e) {
        const n = Xd(e);
        return n.length === 20 ? t.createTypeUnsafe("EthereumAccountId", [
            n
        ]) : t.createTypeUnsafe("AccountIndex", [
            uu(n)
        ]);
    }
    function CXe(t, e) {
        if (e.length === 20) return t.createTypeUnsafe("EthereumAccountId", [
            e
        ]);
        if (e[0] === 255) return t.createTypeUnsafe("EthereumAccountId", [
            e.subarray(1)
        ]);
        const [n, r] = ws.readLength(e);
        return t.createTypeUnsafe("AccountIndex", [
            uu(e.subarray(n, n + r))
        ]);
    }
    function EXe(t, e) {
        return e instanceof CY ? e.inner : e instanceof TY || e instanceof ws ? e : Bt(e) || Array.isArray(e) || Fn(e) ? CXe(t, Dt(e)) : Ya(e) || Xn(e) || $p(e) ? t.createTypeUnsafe("AccountIndex", [
            e
        ]) : TXe(t, e);
    }
    class CY extends X3 {
        constructor(e, n = new Uint8Array){
            super(e, EXe(e, n));
        }
        get encodedLength() {
            const e = this._rawLength;
            return e + (e > 1 ? 1 : 0);
        }
        get _rawLength() {
            return this.inner instanceof ws ? ws.calcLength(this.inner) : this.inner.encodedLength;
        }
        toHex() {
            return nn(this.toU8a());
        }
        toRawType() {
            return "Address";
        }
        toU8a(e) {
            const n = this.inner.toU8a().subarray(0, this._rawLength);
            return e ? n : Ai(this.inner instanceof ws ? ws.writeLength(n) : kXe, n);
        }
    }
    function IXe(t, e) {
        const n = e[0];
        if (n) {
            if (n >= 1 && n <= 33) {
                const r = n - 1, s = e.subarray(1, r + 1);
                return [
                    t.createTypeUnsafe("Raw", [
                        s
                    ]),
                    1
                ];
            } else if (n >= 34 && n <= 37) return [
                e.subarray(1, 33),
                n - 32
            ];
        } else return [
            void 0,
            void 0
        ];
        throw new Error(`Unable to decode Data, invalid indicator byte ${n}`);
    }
    function AXe(t, e) {
        return Bt(e) || br(e) ? IXe(t, Dt(e)) : e ? [
            e,
            void 0
        ] : [
            void 0,
            void 0
        ];
    }
    class PXe extends fa {
        constructor(e, n){
            if (super(e, {
                None: "Null",
                Raw: "Bytes",
                BlakeTwo256: "H256",
                Sha256: "H256",
                Keccak256: "H256",
                ShaThree256: "H256"
            }, ...AXe(e, n)), this.isRaw && this.asRaw.length > 32) throw new Error("Data.Raw values are limited to a maximum length of 32 bytes");
        }
        get asBlakeTwo256() {
            return this.value;
        }
        get asKeccak256() {
            return this.value;
        }
        get asRaw() {
            return this.value;
        }
        get asSha256() {
            return this.value;
        }
        get asShaThree256() {
            return this.value;
        }
        get isBlakeTwo256() {
            return this.index === 2;
        }
        get isKeccak256() {
            return this.index === 4;
        }
        get isNone() {
            return this.index === 0;
        }
        get isRaw() {
            return this.index === 1;
        }
        get isSha256() {
            return this.index === 3;
        }
        get isShaThree256() {
            return this.index === 5;
        }
        get encodedLength() {
            return this.toU8a().length;
        }
        toU8a() {
            if (this.index === 0) return new Uint8Array(1);
            if (this.index === 1) {
                const n = this.value.toU8a(!0), r = Math.min(n.length, 32), s = new Uint8Array(r + 1);
                return s.set([
                    r + 1
                ], 0), s.set(n.subarray(0, r), 1), s;
            }
            const e = new Uint8Array(33);
            return e.set([
                this.index + 32
            ], 0), e.set(this.value.toU8a(), 1), e;
        }
    }
    const OXe = {
        Blake2_128: [
            16,
            !1
        ],
        Blake2_128Concat: [
            16,
            !0
        ],
        Blake2_256: [
            32,
            !1
        ],
        Identity: [
            0,
            !0
        ],
        Twox128: [
            16,
            !1
        ],
        Twox256: [
            32,
            !1
        ],
        Twox64Concat: [
            8,
            !0
        ]
    };
    function MXe(t) {
        if (Bt(t) || !t || br(t)) return {
            key: t
        };
        if (t instanceof t9) return {
            key: t,
            method: t.method,
            section: t.section
        };
        if (Mt(t)) return {
            key: t(),
            method: t.method,
            section: t.section
        };
        if (Array.isArray(t)) {
            const [e, n = []] = t;
            if (!Mt(e)) throw new Error("Expected function input for key construction");
            if (e.meta && e.meta.type.isMap) {
                const r = e.meta.type.asMap;
                if (!Array.isArray(n) || n.length !== r.hashers.length) throw new Error(`Expected an array of ${r.hashers.length} values as params to a Map query`);
            }
            return {
                key: e(...n),
                method: e.method,
                section: e.section
            };
        }
        throw new Error(`Unable to convert input ${t} to StorageKey`);
    }
    function RXe(t, e, n) {
        let r = 32;
        const s = n.length, i = new Array(s);
        for(let o = 0; o < s; o++){
            const [a, c] = n[o], [l, u] = OXe[a.type], d = u ? t.createTypeUnsafe(Py(t.lookup, c), [
                e.subarray(r + l)
            ]) : t.createTypeUnsafe("Raw", [
                e.subarray(r, r + l)
            ]);
            r += l + (u ? d.encodedLength : 0), i[o] = d;
        }
        return i;
    }
    function NXe(t, e, n) {
        if (!n || !n.type.isMap) return [];
        const { hashers: r, key: s } = n.type.asMap, i = r.length === 1 ? [
            s
        ] : t.lookup.getSiType(s).def.asTuple;
        return RXe(t, e, r.map((o, a)=>[
                o,
                i[a]
            ]));
    }
    function VXe(t) {
        if (t instanceof t9) return t.meta;
        if (Mt(t)) return t.meta;
        if (Array.isArray(t)) {
            const [e] = t;
            return e.meta;
        }
    }
    function DXe(t, e) {
        if (e instanceof t9) return e.outputType;
        if (Mt(e)) return Jk(t, e.meta.type);
        if (Array.isArray(e)) {
            const [n] = e;
            if (n.meta) return Jk(t, n.meta.type);
        }
        return "Raw";
    }
    class t9 extends J3 {
        #e;
        #t;
        #n;
        #r;
        #s;
        constructor(e, n, r = {}){
            const { key: s, method: i, section: o } = MXe(n);
            super(e, s), this.#n = DXe(e, n), this.setMeta(VXe(n), r.section || o, r.method || i);
        }
        get args() {
            return this.#e;
        }
        get meta() {
            return this.#t;
        }
        get method() {
            return this.#r;
        }
        get outputType() {
            return this.#n;
        }
        get section() {
            return this.#s;
        }
        is(e) {
            return e.section === this.section && e.method === this.method;
        }
        setMeta(e, n, r) {
            this.#t = e, this.#r = r || this.#r, this.#s = n || this.#s, e && (this.#n = Jk(this.registry, e.type));
            try {
                this.#e = NXe(this.registry, this.toU8a(!0), e);
            } catch  {}
            return this;
        }
        toHuman(e, n) {
            return this.#e.length ? this.#e.map((r)=>r.toHuman(void 0, n)) : super.toHuman(void 0, n);
        }
        toRawType() {
            return "StorageKey";
        }
    }
    const BXe = Object.freeze(Object.defineProperty({
        __proto__: null,
        BitVec: pWe,
        Bool: sg,
        Bytes: J3,
        Data: PXe,
        F32: RD,
        F64: ND,
        GeneralExtrinsic: Ex,
        GenericAccountId: Ix,
        GenericAccountId32: Ix,
        GenericAccountId33: $$e,
        GenericAccountIndex: ws,
        GenericAddress: tT,
        GenericBlock: Y$e,
        GenericCall: nXe,
        GenericChainProperties: iXe,
        GenericConsensusEngineId: hXe,
        GenericEthereumAccountId: TY,
        GenericEthereumLookupSource: CY,
        GenericEvent: T$e,
        GenericEventData: lY,
        GenericExtrinsic: $A,
        GenericExtrinsicEra: bY,
        GenericExtrinsicPayload: yY,
        GenericExtrinsicPayloadUnknown: L$e,
        GenericExtrinsicPayloadV4: eT,
        GenericExtrinsicPayloadV5: wY,
        GenericExtrinsicSignatureV4: kx,
        GenericExtrinsicSignatureV5: Cx,
        GenericExtrinsicUnknown: z$e,
        GenericExtrinsicV4: Sx,
        GenericExtrinsicV5: Tx,
        GenericImmortalEra: hY,
        GenericLookupSource: SY,
        GenericMortalEra: gY,
        GenericMultiAddress: tT,
        GenericSignerPayload: U$e,
        GenericVote: SXe,
        I128: FD,
        I16: DD,
        I256: LD,
        I32: Xk,
        I64: BD,
        I8: VD,
        ISize: zD,
        Null: Nc,
        OptionBool: TWe,
        StorageKey: t9,
        Text: XJ,
        Type: EWe,
        U128: jD,
        U16: HD,
        U256: qD,
        U32: Iy,
        U64: sa,
        U8: UD,
        USize: WD,
        bool: sg,
        f32: RD,
        f64: ND,
        i128: FD,
        i16: DD,
        i256: LD,
        i32: Xk,
        i64: BD,
        i8: VD,
        isize: zD,
        u128: jD,
        u16: HD,
        u256: qD,
        u32: Iy,
        u64: sa,
        u8: UD,
        usize: WD
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function EY(t) {
        return ({ name: e })=>t(e);
    }
    const ZA = EY(tr), IY = EY((t)=>t.toString());
    function FXe(t, e) {
        return t.callIndex[0] === e[0] && t.callIndex[1] === e[1];
    }
    function LXe(t, e, n, r) {
        const s = r.fields, i = tr(r.name), o = (...a)=>{
            if (s.length !== a.length) throw new Error(`Extrinsic ${e}.${i} expects ${s.length} arguments, got ${a.length}.`);
            return t.createTypeUnsafe("Call", [
                {
                    args: a,
                    callIndex: n
                },
                r
            ]);
        };
        return o.is = (a)=>FXe(a, n), o.callIndex = n, o.meta = r, o.method = i, o.section = e, o.toJSON = ()=>r.toJSON(), o;
    }
    function AY({ calls: t }) {
        return t.isSome;
    }
    function PY(t, e, n, r, s) {
        const { fields: i, index: o } = n, a = i.length, c = new Array(a);
        for(let l = 0; l < a; l++){
            const { name: u, type: d, typeName: f } = i[l];
            c[l] = Ye({
                name: tr(u.unwrapOr(`param${l}`)),
                type: Py(e, d)
            }, f.isSome ? {
                typeName: f.unwrap()
            } : null);
        }
        return LXe(t, r, new Uint8Array([
            s,
            o.toNumber()
        ]), t.createTypeUnsafe("FunctionMetadataLatest", [
            Ye({
                args: c
            }, n)
        ]));
    }
    function zXe(t, { lookup: e, pallets: n }, r) {
        const s = {}, i = n.filter(AY);
        for(let o = 0, a = i.length; o < a; o++){
            const { calls: c, index: l, name: u } = i[o], d = tr(u), f = r >= 12 ? l.toNumber() : o;
            ni(s, d, ()=>tb(e, c.unwrap(), ZA, (p)=>PY(t, e, p, d, f)));
        }
        return s;
    }
    function OS(t, e) {
        return e.toNumber() >= 2 ? t.createTypeUnsafe("StorageHasherV10", [
            e.toNumber() + 1
        ]) : t.createTypeUnsafe("StorageHasherV10", [
            e
        ]);
    }
    function UXe(t, e) {
        return e.isMap ? [
            Ye({}, e.asMap, {
                hasher: OS(t, e.asMap.hasher)
            }),
            1
        ] : e.isDoubleMap ? [
            Ye({}, e.asDoubleMap, {
                hasher: OS(t, e.asDoubleMap.hasher),
                key2Hasher: OS(t, e.asDoubleMap.key2Hasher)
            }),
            2
        ] : [
            e.asPlain,
            0
        ];
    }
    function HXe(t, e) {
        const n = e.storage.unwrapOr(null);
        return t.createTypeUnsafe("ModuleMetadataV10", [
            Ye({}, e, {
                storage: n ? Ye({}, n, {
                    items: n.items.map((r)=>Ye({}, r, {
                            type: t.createTypeUnsafe("StorageEntryTypeV10", UXe(t, r.type))
                        }))
                }) : null
            })
        ]);
    }
    function jXe(t, { modules: e }) {
        return t.createTypeUnsafe("MetadataV10", [
            {
                modules: e.map((n)=>HXe(t, n))
            }
        ]);
    }
    function qXe(t, { modules: e }) {
        return t.createTypeUnsafe("MetadataV11", [
            {
                extrinsic: {
                    signedExtensions: [],
                    version: 0
                },
                modules: e
            }
        ]);
    }
    function WXe(t, { extrinsic: e, modules: n }) {
        return t.createTypeUnsafe("MetadataV12", [
            {
                extrinsic: e,
                modules: n.map((r)=>t.createTypeUnsafe("ModuleMetadataV12", [
                        Ye({}, r, {
                            index: 255
                        })
                    ]))
            }
        ]);
    }
    function KXe(t, e) {
        return t.createTypeUnsafe("MetadataV13", [
            e
        ]);
    }
    const $Xe = {
        assets: {
            Approval: "AssetApproval",
            ApprovalKey: "AssetApprovalKey",
            Balance: "TAssetBalance",
            DestroyWitness: "AssetDestroyWitness"
        },
        babe: {
            EquivocationProof: "BabeEquivocationProof"
        },
        balances: {
            Status: "BalanceStatus"
        },
        beefy: {
            AuthorityId: "BeefyId"
        },
        contracts: {
            StorageKey: "ContractStorageKey"
        },
        electionProviderMultiPhase: {
            Phase: "ElectionPhase"
        },
        ethereum: {
            Block: "EthBlock",
            Header: "EthHeader",
            Receipt: "EthReceipt",
            Transaction: "EthTransaction",
            TransactionStatus: "EthTransactionStatus"
        },
        evm: {
            Account: "EvmAccount",
            Log: "EvmLog",
            Vicinity: "EvmVicinity"
        },
        grandpa: {
            Equivocation: "GrandpaEquivocation",
            EquivocationProof: "GrandpaEquivocationProof"
        },
        identity: {
            Judgement: "IdentityJudgement"
        },
        inclusion: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        paraDisputes: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        paraInclusion: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        paraScheduler: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        paraShared: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        parachains: {
            Id: "ParaId"
        },
        parasDisputes: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        parasInclusion: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        parasScheduler: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        parasShared: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        proposeParachain: {
            Proposal: "ParachainProposal"
        },
        proxy: {
            Announcement: "ProxyAnnouncement"
        },
        scheduler: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        shared: {
            ValidatorIndex: "ParaValidatorIndex"
        },
        society: {
            Judgement: "SocietyJudgement",
            Vote: "SocietyVote"
        },
        staking: {
            Compact: "CompactAssignments"
        },
        treasury: {
            Proposal: "TreasuryProposal"
        },
        xcm: {
            AssetId: "XcmAssetId"
        },
        xcmPallet: {
            AssetId: "XcmAssetId"
        }
    };
    function XXe({ knownTypes: t }, e) {
        return {
            ...$Xe[e] ?? {},
            ...t.typesAlias?.[e] ?? {}
        };
    }
    const GXe = [
        [
            "<",
            ">"
        ],
        [
            "<",
            ","
        ],
        [
            ",",
            ">"
        ],
        [
            "(",
            ")"
        ],
        [
            "(",
            ","
        ],
        [
            ",",
            ","
        ],
        [
            ",",
            ")"
        ]
    ];
    function Dl(t, e) {
        const n = e.toString(), r = t.findIndex(({ def: s })=>s.HistoricMetaCompat === n);
        return r !== -1 ? r : t.push({
            def: {
                HistoricMetaCompat: n
            }
        }) - 1;
    }
    function ZXe(t, ...e) {
        for(let n = 0, r = e.length; n < r; n++)Dl(t, e[n]);
    }
    function JXe(t, e) {
        return t.push({
            def: {
                Tuple: e
            }
        }) - 1;
    }
    function JA(t, e, n, r) {
        return n.push({
            def: {
                Variant: {
                    variants: r
                }
            },
            path: [
                `pallet_${t.toString()}`,
                "pallet",
                e
            ]
        }) - 1;
    }
    function YXe(t, e, n) {
        t.register({
            OriginCaller: {
                _enum: e.map((r, s)=>[
                        r.name.toString(),
                        n >= 12 ? r.index.toNumber() : s
                    ]).sort((r, s)=>r[1] - s[1]).reduce((r, [s, i])=>{
                    for(let o = Object.keys(r).length; o < i; o++)r[`Empty${o}`] = "Null";
                    return r[s] = AHe[s] || "Null", r;
                }, {})
            }
        });
    }
    function z1(t, e) {
        e.forEach((n)=>{
            const r = Object.keys(t).find((s)=>n.eq(s));
            if (r) n.setOverride(t[r]);
            else {
                const s = n.toString(), i = Object.entries(t).reduce((o, [a, c])=>GXe.reduce((l, [u, d])=>l.replace(`${u}${a}${d}`, `${u}${c}${d}`), o), s);
                s !== i && n.setOverride(i);
            }
        });
    }
    function QXe(t, e, n, r, s) {
        const i = r.map(({ args: o, docs: a, name: c }, l)=>(z1(s, o.map(({ type: u })=>u)), e.createTypeUnsafe("SiVariant", [
                {
                    docs: a,
                    fields: o.map(({ name: u, type: d })=>e.createTypeUnsafe("SiField", [
                            {
                                name: u,
                                type: Dl(t, d)
                            }
                        ])),
                    index: l,
                    name: c
                }
            ])));
        return e.createTypeUnsafe("PalletCallMetadataV14", [
            {
                type: JA(n, "Call", t, i)
            }
        ]);
    }
    function eGe(t, e, n, r) {
        return n.map(({ docs: s, name: i, type: o, value: a })=>(z1(r, [
                o
            ]), e.createTypeUnsafe("PalletConstantMetadataV14", [
                {
                    docs: s,
                    name: i,
                    type: Dl(t, o),
                    value: a
                }
            ])));
    }
    function tGe(t, e, n, r, s) {
        const i = r.map(({ docs: o, name: a }, c)=>e.createTypeUnsafe("SiVariant", [
                {
                    docs: o,
                    fields: [],
                    index: c,
                    name: a
                }
            ]));
        return e.createTypeUnsafe("PalletErrorMetadataV14", [
            {
                type: JA(n, "Error", t, i)
            }
        ]);
    }
    function nGe(t, e, n, r, s) {
        const i = r.map(({ args: o, docs: a, name: c }, l)=>(z1(s, o), e.createTypeUnsafe("SiVariant", [
                {
                    docs: a,
                    fields: o.map((u)=>e.createTypeUnsafe("SiField", [
                            {
                                type: Dl(t, u)
                            }
                        ])),
                    index: l,
                    name: c
                }
            ])));
        return e.createTypeUnsafe("PalletEventMetadataV14", [
            {
                type: JA(n, "Event", t, i)
            }
        ]);
    }
    function MS(t, e, n, { hashers: r, isLinked: s, isOptional: i, keys: o, value: a }) {
        return z1(n, [
            a,
            ...Array.isArray(o) ? o : [
                o
            ]
        ]), e.createTypeUnsafe("StorageEntryTypeV14", [
            {
                Map: {
                    hashers: r,
                    key: r.length === 1 ? Dl(t, o[0]) : JXe(t, o.map((c)=>Dl(t, c))),
                    value: s ? Dl(t, `(${i ? `Option<${a.toString()}>` : a.toString()}, Linkage<${o[0].toString()}>)`) : Dl(t, a)
                }
            }
        ]);
    }
    function rGe(t, e, { items: n, prefix: r }, s) {
        return e.createTypeUnsafe("PalletStorageMetadataV14", [
            {
                items: n.map(({ docs: i, fallback: o, modifier: a, name: c, type: l })=>{
                    let u;
                    if (l.isPlain) {
                        const d = l.asPlain;
                        z1(s, [
                            d
                        ]), u = e.createTypeUnsafe("StorageEntryTypeV14", [
                            {
                                Plain: Dl(t, d)
                            }
                        ]);
                    } else if (l.isMap) {
                        const d = l.asMap;
                        u = MS(t, e, s, {
                            hashers: [
                                d.hasher
                            ],
                            isLinked: d.linked.isTrue,
                            isOptional: a.isOptional,
                            keys: [
                                d.key
                            ],
                            value: d.value
                        });
                    } else if (l.isDoubleMap) {
                        const d = l.asDoubleMap;
                        u = MS(t, e, s, {
                            hashers: [
                                d.hasher,
                                d.key2Hasher
                            ],
                            isLinked: !1,
                            isOptional: a.isOptional,
                            keys: [
                                d.key1,
                                d.key2
                            ],
                            value: d.value
                        });
                    } else {
                        const d = l.asNMap;
                        u = MS(t, e, s, {
                            hashers: d.hashers,
                            isLinked: !1,
                            isOptional: a.isOptional,
                            keys: d.keyVec,
                            value: d.value
                        });
                    }
                    return e.createTypeUnsafe("StorageEntryMetadataV14", [
                        {
                            docs: i,
                            fallback: o,
                            modifier: a,
                            name: c,
                            type: u
                        }
                    ]);
                }),
                prefix: r
            }
        ]);
    }
    function sGe(t, { signedExtensions: e, version: n }) {
        return t.createTypeUnsafe("ExtrinsicMetadataV14", [
            {
                signedExtensions: e.map((r)=>({
                        identifier: r,
                        type: 0
                    })),
                type: 0,
                version: n
            }
        ]);
    }
    function iGe(t, e, n, { calls: r, constants: s, errors: i, events: o, storage: a }) {
        const c = XXe(e, tr(n.name));
        return e.createTypeUnsafe("PalletMetadataV14", [
            {
                calls: r && QXe(t, e, n.name, r, c),
                constants: eGe(t, e, s, c),
                errors: i && tGe(t, e, n.name, i),
                events: o && nGe(t, e, n.name, o, c),
                index: n.index,
                name: n.name,
                storage: a && rGe(t, e, a, c)
            }
        ]);
    }
    function oGe(t, e, n) {
        const r = [];
        ZXe(r, "Null", "u8", "u16", "u32", "u64"), YXe(t, e.modules, n);
        const s = sGe(t, e.extrinsic), i = e.modules.map((o)=>iGe(r, t, o, {
                calls: o.calls.unwrapOr(null),
                constants: o.constants,
                errors: o.errors.length ? o.errors : null,
                events: o.events.unwrapOr(null),
                storage: o.storage.unwrapOr(null)
            }));
        return t.createTypeUnsafe("MetadataV14", [
            {
                extrinsic: s,
                lookup: {
                    types: r.map((o, a)=>t.createTypeUnsafe("PortableType", [
                            {
                                id: a,
                                type: o
                            }
                        ]))
                },
                pallets: i
            }
        ]);
    }
    function aGe(t, e, n) {
        const r = e.lookup.paramTypes.SpRuntimeUncheckedExtrinsic;
        return t.createTypeUnsafe("MetadataV15", [
            Ye({}, e, {
                extrinsic: t.createTypeUnsafe("ExtrinsicMetadataV15", [
                    Ye({}, e.extrinsic, {
                        addressType: r?.[0].type.unwrapOr(0),
                        callType: r?.[1].type.unwrapOr(0),
                        extraType: r?.[3].type.unwrapOr(0),
                        signatureType: r?.[2].type.unwrapOr(0)
                    })
                ]),
                outerEnums: t.createTypeUnsafe("OuterEnums15", [
                    {
                        callType: r?.[1].type.unwrapOr(0),
                        eventType: e.lookup.paramTypes.FrameSystemEventRecord?.[0].type.unwrapOr(0)
                    }
                ])
            })
        ]);
    }
    function cGe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = t.createTypeUnsafe("Vec<PalletAssociatedTypeMetadataV16>", [
            []
        ]), s = t.createTypeUnsafe("Vec<PalletViewFunctionMetadataV16>", [
            []
        ]);
        return t.createTypeUnsafe("PalletMetadataV16", [
            Ye({}, e, {
                associatedTypes: r,
                calls: e.calls.isSome ? uGe(t, e.calls.unwrap()) : null,
                constants: fGe(t, e.constants),
                deprecationInfo: n,
                errors: e.errors.isSome ? pGe(t, e.errors.unwrap()) : null,
                events: e.events.isSome ? dGe(t, e.events.unwrap()) : null,
                storage: e.storage.isSome ? lGe(t, e.storage.unwrap()) : null,
                viewFunctions: s
            })
        ]);
    }
    function lGe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = e.items.map((s)=>t.createTypeUnsafe("StorageEntryMetadataV16", [
                Ye({}, s, {
                    deprecationInfo: n
                })
            ]));
        return t.createTypeUnsafe("PalletStorageMetadataV16", [
            {
                items: t.createTypeUnsafe("Vec<StorageEntryMetadataV16>", [
                    r
                ]),
                prefix: e.prefix
            }
        ]);
    }
    function uGe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletCallMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function dGe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletEventMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function fGe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]);
        return t.createTypeUnsafe("Vec<PalletConstantMetadataV16>", [
            e.map((r)=>t.createTypeUnsafe("PalletConstantMetadataV16", [
                    Ye({}, r, {
                        deprecationInfo: n
                    })
                ]))
        ]);
    }
    function pGe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletErrorMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function hGe(t, e) {
        const n = e.signedExtensions.map(({ additionalSigned: i, identifier: o, type: a })=>t.createTypeUnsafe("TransactionExtensionMetadataV16", [
                {
                    identifier: o,
                    implict: i,
                    type: a
                }
            ])), r = n.map((i, o)=>t.createTypeUnsafe("Compact<u32>", [
                o
            ])), s = t.createTypeUnsafe("BTreeMap<u8, Vec<Compact<u32>>>", [
            new Map([
                [
                    t.createTypeUnsafe("u8", [
                        e.version
                    ]),
                    t.createTypeUnsafe("Vec<Compact<u32>>", [
                        r
                    ])
                ]
            ])
        ]);
        return t.createTypeUnsafe("ExtrinsicMetadataV16", [
            {
                addressType: e.addressType,
                callType: e.callType,
                signatureType: e.signatureType,
                transactionExtensions: n,
                transactionExtensionsByVersion: s,
                versions: [
                    e.version
                ]
            }
        ]);
    }
    function gGe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = e.methods.map((s)=>t.createTypeUnsafe("RuntimeApiMethodMetadataV16", [
                Ye({}, s, {
                    deprecationInfo: n
                })
            ]));
        return t.createTypeUnsafe("RuntimeApiMetadataV16", [
            Ye({}, e, {
                deprecationInfo: n,
                methods: r,
                version: t.createTypeUnsafe("Compact<u32>", [
                    0
                ])
            })
        ]);
    }
    function bGe(t, e, n) {
        const r = e.pallets.map((o)=>cGe(t, o)), s = hGe(t, e.extrinsic), i = e.apis.map((o)=>gGe(t, o));
        return t.createTypeUnsafe("MetadataV16", [
            Ye({}, e, {
                apis: i,
                extrinsic: s,
                pallets: r
            })
        ]);
    }
    function mGe(t, e, n) {
        return e;
    }
    const kB = 1635018093;
    class yGe extends Iy {
        constructor(e, n){
            if (super(e, n), !this.isEmpty && !this.eq(kB)) throw new Error(`MagicNumber mismatch: expected ${e.createTypeUnsafe("u32", [
                kB
            ]).toHex()}, found ${this.toHex()}`);
        }
    }
    const wGe = [
        16,
        15,
        14,
        13,
        12,
        11,
        10,
        9
    ], _Ge = wGe[0], xGe = 14;
    class n9 extends Gr {
        #e = new Map;
        constructor(e, n){
            super(e, {
                magicNumber: yGe,
                metadata: "MetadataAll"
            }, n);
        }
        #t = (e)=>{
            if (this.version > e) throw new Error(`Cannot convert metadata from version ${this.version} to ${e}`);
            return this.version === e;
        };
        #n = (e, n)=>{
            if (e !== "latest" && this.#t(e)) {
                const r = `asV${e}`;
                return this.#r()[r];
            }
            if (!this.#e.has(e)) {
                const r = e === "latest" ? `asV${_Ge}` : `asV${e - 1}`;
                this.#e.set(e, n(this.registry, this[r], this.version));
            }
            return this.#e.get(e);
        };
        #r = ()=>this.getT("metadata");
        get asCallsOnly() {
            return new n9(this.registry, {
                magicNumber: this.magicNumber,
                metadata: this.registry.createTypeUnsafe("MetadataAll", [
                    m$e(this.registry, this.asLatest),
                    xGe
                ])
            });
        }
        get asV9() {
            return this.#t(9), this.#r().asV9;
        }
        get asV10() {
            return this.#n(10, jXe);
        }
        get asV11() {
            return this.#n(11, qXe);
        }
        get asV12() {
            return this.#n(12, WXe);
        }
        get asV13() {
            return this.#n(13, KXe);
        }
        get asV14() {
            return this.#n(14, oGe);
        }
        get asV15() {
            return this.#n(15, aGe);
        }
        get asV16() {
            return this.#n(16, bGe);
        }
        get asLatest() {
            return this.#n("latest", mGe);
        }
        get magicNumber() {
            return this.getT("magicNumber");
        }
        get version() {
            return this.#r().index;
        }
        getUniqTypes(e) {
            return g$e(this.registry, this.asLatest, e);
        }
        toJSON() {
            return this.asLatest, super.toJSON();
        }
    }
    const OY = new Uint8Array([
        109,
        101,
        116,
        97,
        9
    ]), TB = OY.length - 1;
    function vGe(t, e) {
        if (e.length === 0) return OY;
        if (e[TB] === 9) try {
            return new n9(t, e);
        } catch  {
            e[TB] = 10;
        }
        return e;
    }
    class zh extends n9 {
        constructor(e, n){
            super(e, Bt(n) || br(n) ? vGe(e, Dt(n)) : n);
        }
    }
    function MY(t, { pallets: e }, n) {
        const r = {};
        for(let s = 0, i = e.length; s < i; s++){
            const { constants: o, name: a } = e[s];
            o.isEmpty || ni(r, tr(a), ()=>Zf({}, o, (c)=>{
                    const l = t.createTypeUnsafe(t.createLookupType(c.type), [
                        Hc(c.value.toHex())
                    ]);
                    return l.meta = c, l;
                }, ZA));
        }
        return r;
    }
    function RY(t, e) {
        return Ye({
            args: e.fields.map(({ type: n })=>t.getTypeDef(n).type)
        }, e);
    }
    function SGe(t, { lookup: e, pallets: n }, r) {
        const s = {};
        for(let i = 0, o = n.length; i < o; i++){
            const { errors: a, index: c, name: l } = n[i];
            if (a.isSome) {
                const u = r >= 12 ? c.toNumber() : i;
                ni(s, tr(l), ()=>tb(e, a.unwrap(), IY, (d)=>({
                            is: (f)=>oa(f) && oa(f.index) && f.index.eq(u) && (Bt(f.error) ? f.error[0] === d.index.toNumber() : oa(f.error) && f.error.eq(d.index)),
                            meta: t.createTypeUnsafe("ErrorMetadataLatest", [
                                RY(e, d)
                            ])
                        })));
            }
        }
        return s;
    }
    function NY({ events: t }) {
        return t.isSome;
    }
    function kGe(t, { lookup: e, pallets: n }, r) {
        const s = {}, i = n.filter(NY);
        for(let o = 0, a = i.length; o < a; o++){
            const { events: c, index: l, name: u } = i[o], d = r >= 12 ? l.toNumber() : o;
            ni(s, tr(u), ()=>tb(e, c.unwrap(), IY, (f)=>({
                        is: (p)=>oa(p) && Bt(p.index) && d === p.index[0] && f.index.eq(p.index[1]),
                        meta: t.createTypeUnsafe("EventMetadataLatest", [
                            RY(e, f)
                        ])
                    })));
        }
        return s;
    }
    const TGe = (t)=>t0(t, 128), CGe = {
        Blake2_128: (t)=>Gl(t, 128),
        Blake2_128Concat: (t)=>Ai(Gl(t, 128), Dt(t)),
        Blake2_256: (t)=>Gl(t, 256),
        Identity: (t)=>Dt(t),
        Twox128: (t)=>t0(t, 128),
        Twox256: (t)=>t0(t, 256),
        Twox64Concat: (t)=>Ai(t0(t, 64), Dt(t))
    };
    function EGe(t) {
        return CGe[t.type] || TGe;
    }
    const r9 = {
        args: [],
        hashers: [],
        keys: []
    };
    function IGe(t) {
        return !Rr(t);
    }
    function VY({ method: t, section: e }, { args: n, keys: r }) {
        if (Array.isArray(n)) {
            if (n.filter(IGe).length !== r.length) throw new Error(`Call to ${tr(e || "unknown")}.${tr(t || "unknown")} needs ${r.length} arguments, found [${n.join(", ")}]`);
        } else throw new Error(`Call to ${tr(e || "unknown")}.${tr(t || "unknown")} needs ${r.length} arguments`);
    }
    function DY(t, e, { args: n, hashers: r, keys: s }) {
        const i = s.length, o = new Array(i);
        for(let a = 0; a < i; a++)o[a] = EGe(r[a])(t.createTypeUnsafe(t.createLookupType(s[a]), [
            n[a]
        ]).toU8a());
        return [
            [
                t0(e.prefix, 128),
                t0(e.method, 128)
            ],
            o
        ];
    }
    function RS(t, e, n) {
        VY(e, n);
        const { meta: r } = e, [s, i] = DY(t, e, n);
        let o = [];
        if (r.type.isMap) {
            const { hashers: c, key: l } = r.type.asMap;
            o = c.length === 1 ? [
                `${c[0].type}(${Py(t.lookup, l)})`
            ] : t.lookup.getSiType(l).def.asTuple.map((u, d)=>`${c[d].type}(${Py(t.lookup, u)})`);
        }
        const a = [
            "module",
            "method"
        ].concat(...n.args.map((c, l)=>o[l]));
        return {
            inner: s.concat(...i).map((c, l)=>({
                    name: a[l],
                    outer: [
                        c
                    ]
                }))
        };
    }
    function Px(t, e, n) {
        const [r, s] = DY(t, e, n);
        return Ai(...r, ...s);
    }
    function NS(t, e, n) {
        return VY(e, n), Xp(Px(t, e, n));
    }
    function AGe(t, e, n) {
        const { meta: { type: r } } = e;
        return (...s)=>{
            if (r.isPlain) return n.skipHashing ? {
                inner: [],
                name: "wellKnown",
                outer: [
                    Dt(n.key)
                ]
            } : RS(t, e, r9);
            const { hashers: i, key: o } = r.asMap;
            return i.length === 1 ? RS(t, e, {
                args: s,
                hashers: i,
                keys: [
                    o
                ]
            }) : RS(t, e, {
                args: s,
                hashers: i,
                keys: t.lookup.getSiType(o).def.asTuple
            });
        };
    }
    function PGe(t, e, n) {
        const { meta: { type: r } } = e;
        let s = null;
        return (...i)=>{
            if (r.isPlain) return s || (s = n.skipHashing ? Xp(Dt(n.key)) : NS(t, e, r9)), s;
            const { hashers: o, key: a } = r.asMap;
            return o.length === 1 ? NS(t, e, {
                args: i,
                hashers: o,
                keys: [
                    a
                ]
            }) : NS(t, e, {
                args: i,
                hashers: o,
                keys: t.lookup.getSiType(a).def.asTuple
            });
        };
    }
    function OGe(t, e, n) {
        const { meta: r, method: s, prefix: i, section: o } = e, a = PGe(t, e, n);
        return a.inspect = AGe(t, e, n), a.meta = r, a.method = tr(s), a.prefix = i, a.section = o, a.toJSON = ()=>Ye({
                storage: {
                    method: s,
                    prefix: i,
                    section: o
                }
            }, r.toJSON()), a;
    }
    function MGe(t, { meta: { docs: e, name: n, type: r }, section: s }, { method: i }, o) {
        const a = t.createTypeUnsafe("StorageEntryMetadataLatest", [
            {
                docs: e,
                fallback: t.createTypeUnsafe("Bytes", []),
                modifier: t.createTypeUnsafe("StorageEntryModifierLatest", [
                    1
                ]),
                name: n,
                type: t.createTypeUnsafe("StorageEntryTypeLatest", [
                    r.asMap.key,
                    0
                ])
            }
        ]);
        o.meta = a;
        const c = (...l)=>t.createTypeUnsafe("StorageKey", [
                o(...l),
                {
                    method: i,
                    section: s
                }
            ]);
        return c.meta = a, c;
    }
    function RGe(t, e, n) {
        const { meta: { type: r }, method: s, section: i } = e;
        return n.iterKey = MGe(t, e, n, (...o)=>{
            if (o.length && (r.isPlain || o.length >= r.asMap.hashers.length)) throw new Error(`Iteration of ${tr(i || "unknown")}.${tr(s || "unknown")} needs arguments to be at least one less than the full arguments, found [${o.join(", ")}]`);
            if (o.length && r.isMap) {
                const { hashers: a, key: c } = r.asMap, l = a.length === 1 ? [
                    c
                ] : t.lookup.getSiType(c).def.asTuple;
                return new pa(t, Px(t, e, {
                    args: o,
                    hashers: a.slice(0, o.length),
                    keys: l.slice(0, o.length)
                }));
            }
            return new pa(t, Px(t, e, r9));
        }), n;
    }
    function BY(t, e, n) {
        const { meta: { type: r } } = e, s = OGe(t, e, n);
        return r.isMap && RGe(t, e, s), s.keyPrefix = (...i)=>s.iterKey && s.iterKey(...i) || mx(s())[1], s;
    }
    function CB(t, e) {
        const n = e.toLowerCase();
        return t.lookup.types.find((r)=>r.type.def.isPrimitive && r.type.def.asPrimitive.toString().toLowerCase() === n || r.type.def.isHistoricMetaCompat && r.type.def.asHistoricMetaCompat.toString().toLowerCase() === n);
    }
    function NGe(t, e) {
        let n = CB(t, e);
        if (!n && (e === "Bytes" || e.startsWith("[u8;"))) {
            const r = CB(t, "u8");
            if (r) if (e === "Bytes") n = t.lookup.types.find((s)=>s.type.def.isSequence && s.type.def.asSequence.type.eq(r.id) || s.type.def.isHistoricMetaCompat && s.type.def.asHistoricMetaCompat.eq(e));
            else {
                const s = Tu(e);
                n = t.lookup.types.find((i)=>i.type.def.isArray && i.type.def.asArray.eq({
                        len: s.length,
                        type: r.id
                    }) || i.type.def.isHistoricMetaCompat && i.type.def.asHistoricMetaCompat.eq(e));
            }
        }
        return n || console.warn(`Unable to map ${e} to a lookup index`), n;
    }
    function FY({ method: t, prefix: e, section: n }, r, { docs: s, type: i }) {
        return (o)=>BY(o, {
                meta: o.createTypeUnsafe("StorageEntryMetadataLatest", [
                    {
                        docs: o.createTypeUnsafe("Vec<Text>", [
                            [
                                s
                            ]
                        ]),
                        modifier: o.createTypeUnsafe("StorageEntryModifierLatest", [
                            "Required"
                        ]),
                        name: o.createTypeUnsafe("Text", [
                            t
                        ]),
                        toJSON: ()=>r,
                        type: o.createTypeUnsafe("StorageEntryTypeLatest", [
                            {
                                Plain: NGe(o, i)?.id || 0
                            }
                        ])
                    }
                ]),
                method: t,
                prefix: e,
                section: n
            }, {
                key: r,
                skipHashing: !0
            });
    }
    const VGe = "Substrate", DGe = "substrate";
    function fl(t, e, n) {
        return FY({
            method: t,
            prefix: VGe,
            section: DGe
        }, e, n);
    }
    const BGe = {
        changesTrieConfig: fl("changesTrieConfig", ":changes_trie", {
            docs: "Changes trie configuration is stored under this key.",
            type: "u32"
        }),
        childStorageKeyPrefix: fl("childStorageKeyPrefix", ":child_storage:", {
            docs: "Prefix of child storage keys.",
            type: "u32"
        }),
        code: fl("code", ":code", {
            docs: "Wasm code of the runtime.",
            type: "Bytes"
        }),
        defaultChildStorageKeyPrefix: fl("defaultChildStorageKeyPrefix", ":child_storage:default:", {
            docs: "Prefix of the default child storage keys in the top trie.",
            type: "u32"
        }),
        extrinsicIndex: fl("extrinsicIndex", ":extrinsic_index", {
            docs: "Current extrinsic index (u32) is stored under this key.",
            type: "u32"
        }),
        heapPages: fl("heapPages", ":heappages", {
            docs: "Number of wasm linear memory pages required for execution of the runtime.",
            type: "u64"
        }),
        intrablockEntropy: fl("intrablockEntropy", ":intrablock_entropy", {
            docs: "Current intra-block entropy (a universally unique `[u8; 32]` value) is stored here.",
            type: "[u8; 32]"
        }),
        storageVersionStorageKeyPostfix: fl("storageVersionStorageKeyPostfix", ":__STORAGE_VERSION__:", {
            docs: "The storage key postfix that is used to store the [`StorageVersion`] per pallet.",
            type: "u16"
        }),
        transactionLevelKey: fl("transactionLevelKey", ":transaction_level:", {
            docs: "The key that holds the current number of active layers.",
            type: "u32"
        })
    };
    function FGe(t) {
        const e = {}, n = Object.entries(BGe);
        for(let r = 0, s = n.length; r < s; r++)e[n[r][0]] = n[r][1](t);
        return {
            substrate: e
        };
    }
    const LGe = "palletVersion", zGe = ":__STORAGE_VERSION__:", UGe = {
        docs: "Returns the current pallet version from storage",
        type: "u16"
    };
    function HGe(t, { pallets: e }, n) {
        const r = FGe(t);
        for(let s = 0, i = e.length; s < i; s++){
            const { name: o, storage: a } = e[s];
            if (a.isSome) {
                const c = tr(o), { items: l, prefix: u } = a.unwrap(), d = u.toString();
                ni(r, c, ()=>Zf({
                        palletVersion: FY({
                            method: LGe,
                            prefix: d,
                            section: c
                        }, Px(t, {
                            method: zGe,
                            prefix: o.toString()
                        }, r9), UGe)(t)
                    }, l, (f)=>BY(t, {
                            meta: f,
                            method: f.name.toString(),
                            prefix: d,
                            section: c
                        }, {}), ZA));
            }
        }
        return r;
    }
    function jGe(t, e) {
        if (!(e instanceof zh)) throw new Error("You need to pass a valid Metadata instance to Decorated");
        const n = e.asLatest, r = e.version;
        return {
            consts: MY(t, n),
            errors: SGe(t, n, r),
            events: kGe(t, n, r),
            query: HGe(t, n),
            registry: t,
            tx: zXe(t, n, r)
        };
    }
    const qGe = new Uint8Array(2), EB = ma("registry");
    function IB(t, e) {
        return parseInt(t, 10) - parseInt(e, 10);
    }
    function LY(t) {
        return t.toString();
    }
    function zY(t, e) {
        const n = e.length, r = new Array(n);
        for(let s = 0; s < n; s++)r[s] = t.getTypeDef(e[s].type).type;
        return r;
    }
    function Ox(t) {
        const e = Object.keys(t);
        for(let n = 0, r = e.length; n < r; n++)delete t[e[n]];
    }
    function YA({ index: t }) {
        return t.toString();
    }
    function WGe(t, { lookup: e, pallets: n }, r, s) {
        Ox(s);
        for(let i = 0, o = n.length; i < o; i++){
            const { errors: a, index: c, name: l } = n[i];
            if (a.isSome) {
                const u = tr(l);
                ni(s, r >= 12 ? c.toNumber() : i, ()=>tb(e, a.unwrap(), YA, ({ docs: d, fields: f, index: p, name: h })=>({
                            args: zY(e, f),
                            docs: d.map(LY),
                            fields: f,
                            index: p.toNumber(),
                            method: h.toString(),
                            name: h.toString(),
                            section: u
                        })));
            }
        }
    }
    function KGe(t, { lookup: e, pallets: n }, r, s) {
        const i = n.filter(NY);
        Ox(s);
        for(let o = 0, a = i.length; o < a; o++){
            const { events: c, index: l, name: u } = i[o];
            ni(s, r >= 12 ? l.toNumber() : o, ()=>tb(e, c.unwrap(), YA, (d)=>{
                    const f = t.createType("EventMetadataLatest", Ye({}, d, {
                        args: zY(e, d.fields)
                    }));
                    return class extends lY {
                        constructor(p, h){
                            super(p, h, f, tr(u), d.name.toString());
                        }
                    };
                }));
        }
    }
    function $Ge(t, { lookup: e, pallets: n }, r, s, i) {
        const o = n.filter(AY);
        Ox(s), Ox(i);
        for(let a = 0, c = o.length; a < c; a++){
            const { calls: l, index: u, name: d } = o[a], f = r >= 12 ? u.toNumber() : a, p = tr(d), h = l.unwrap();
            ni(s, f, ()=>tb(e, h, YA, (v)=>PY(t, e, v, p, f)));
            const { path: m } = t.lookup.getSiType(h.type), w = m.findIndex((v)=>v.eq("pallet"));
            if (w !== -1) {
                const v = tr(m.slice(0, w).map((k, _)=>_ === 0 ? k.replace(/^(frame|pallet)_/, "") : k).join(" "));
                i[v] ? i[v].push(p) : i[v] = [
                    p
                ];
            }
        }
    }
    function XGe(t, e) {
        const n = t.getChainProperties(), r = MY(t, e.asLatest, e.version), s = r.system && (r.system.sS58Prefix || r.system.ss58Prefix);
        if (!s) return n;
        const { isEthereum: i, tokenDecimals: o, tokenSymbol: a } = n || {};
        return t.createTypeUnsafe("ChainProperties", [
            {
                isEthereum: i,
                ss58Format: s,
                tokenDecimals: o,
                tokenSymbol: a
            }
        ]);
    }
    class UY {
        #e;
        #t = new Map;
        #n = new Map;
        #r = null;
        #s = Gl;
        #i = {};
        #o;
        #a;
        #l = 0;
        #f = AS;
        #y = new Map;
        #p;
        #h;
        #u;
        #b;
        #d = {};
        #g = {};
        #c = {};
        #w = {};
        createdAtHash;
        constructor(e){
            this.#h = new Map(Object.entries({
                Json: GJ,
                Metadata: zh,
                PortableRegistry: u$e,
                Raw: pa,
                ...BXe
            })), this.#u = Array.from(this.#h.entries()), this.#b = vx;
            const n = Object.values(this.#b);
            for(let r = 0, s = n.length; r < s; r++)this.register(n[r].types);
            e && (this.createdAtHash = this.createType("BlockHash", e));
        }
        get chainDecimals() {
            if (this.#e?.tokenDecimals.isSome) {
                const e = this.#e.tokenDecimals.unwrap();
                if (e.length) return e.map((n)=>n.toNumber());
            }
            return [
                12
            ];
        }
        get chainIsEthereum() {
            return this.#e?.isEthereum.isTrue || !1;
        }
        get chainSS58() {
            return this.#e?.ss58Format.isSome ? this.#e.ss58Format.unwrap().toNumber() : void 0;
        }
        get chainTokens() {
            if (this.#e?.tokenSymbol.isSome) {
                const e = this.#e.tokenSymbol.unwrap();
                if (e.length) return e.map(LY);
            }
            return [
                Zp.getDefaults().unit
            ];
        }
        get firstCallIndex() {
            return this.#r || qGe;
        }
        isLookupType(e) {
            return /Lookup\d+$/.test(e);
        }
        createLookupType(e) {
            return `Lookup${typeof e == "number" ? e : e.toNumber()}`;
        }
        get knownTypes() {
            return this.#i;
        }
        get lookup() {
            return Zu(this.#o, "PortableRegistry has not been set on this registry");
        }
        get metadata() {
            return Zu(this.#a, "Metadata has not been set on this registry");
        }
        get unknownTypes() {
            return [
                ...this.#y.keys()
            ];
        }
        get signedExtensions() {
            return this.#f;
        }
        clearCache() {
            this.#t = new Map;
        }
        createClass(e) {
            return Im(this, e);
        }
        createClassUnsafe(e) {
            return Im(this, e);
        }
        createType(e, ...n) {
            return Zk(this, e, n);
        }
        createTypeUnsafe(e, n, r) {
            return Zk(this, e, n, r);
        }
        findMetaCall(e) {
            const [n, r] = [
                e[0],
                e[1]
            ];
            return Zu(this.#d[`${n}`] && this.#d[`${n}`][`${r}`], ()=>`findMetaCall: Unable to find Call with index [${n}, ${r}]/[${e.toString()}]`);
        }
        findMetaError(e) {
            const [n, r] = Bt(e) ? [
                e[0],
                e[1]
            ] : [
                e.index.toNumber(),
                Bt(e.error) ? e.error[0] : e.error.toNumber()
            ];
            return Zu(this.#g[`${n}`] && this.#g[`${n}`][`${r}`], ()=>`findMetaError: Unable to find Error with index [${n}, ${r}]/[${e.toString()}]`);
        }
        findMetaEvent(e) {
            const [n, r] = [
                e[0],
                e[1]
            ];
            return Zu(this.#c[`${n}`] && this.#c[`${n}`][`${r}`], ()=>`findMetaEvent: Unable to find Event with index [${n}, ${r}]/[${e.toString()}]`);
        }
        get(e, n, r) {
            return this.getUnsafe(e, n, r);
        }
        getUnsafe(e, n, r) {
            let s = this.#t.get(e) || this.#h.get(e);
            if (!s) {
                const i = this.#n.get(e);
                let o;
                i ? o = Im(this, i) : r ? o = KWe(this, r) : n && (EB.warn(`Unable to resolve type ${e}, it will fail on construction`), this.#y.set(e, !0), o = Z3.with(e)), o && (s = class extends o {
                }, this.#t.set(e, s), r && Xn(r.lookupIndex) && this.#t.set(this.createLookupType(r.lookupIndex), s));
            }
            return s;
        }
        getChainProperties() {
            return this.#e;
        }
        getClassName(e) {
            const n = [];
            for (const [r, s] of this.#u)e === s && n.push(r);
            for (const [r, s] of this.#t.entries())e === s && n.push(r);
            return n.length ? n.sort().reverse()[0] : void 0;
        }
        getDefinition(e) {
            return this.#n.get(e);
        }
        getModuleInstances(e, n) {
            return this.#i?.typesBundle?.spec?.[e.toString()]?.instances?.[n] || this.#w[n];
        }
        getOrThrow(e) {
            const n = this.get(e);
            if (!n) throw new Error(`type ${e} not found`);
            return n;
        }
        getOrUnknown(e) {
            return this.get(e, !0);
        }
        getTransactionExtensionVersion() {
            return 0;
        }
        getSignedExtensionExtra() {
            return uB(this.#f, "payload", this.#p);
        }
        getSignedExtensionTypes() {
            return uB(this.#f, "extrinsic", this.#p);
        }
        hasClass(e) {
            return this.#t.has(e) || !!this.#h.has(e);
        }
        hasDef(e) {
            return this.#n.has(e);
        }
        hasType(e) {
            return !this.#y.get(e) && (this.hasClass(e) || this.hasDef(e));
        }
        hash(e) {
            return this.createType("CodecHash", this.#s(e));
        }
        register(e, n) {
            if (Mt(e)) this.#t.set(e.name, e);
            else if (br(e)) {
                if (Mt(n)) {
                    if (e === n.toString()) throw new Error(`Unable to register circular ${e} === ${e}`);
                } else throw new Error(`Expected class definition passed to '${e}' registration`);
                this.#t.set(e, n);
            } else this.#_(e);
        }
        #_ = (e)=>{
            const n = Object.entries(e);
            for(let r = 0, s = n.length; r < s; r++){
                const [i, o] = n[r];
                if (Mt(o)) this.#t.set(i, o);
                else {
                    const a = br(o) ? o : vn(o);
                    if (i === a) throw new Error(`Unable to register circular ${i} === ${a}`);
                    this.#t.has(i) && this.#t.delete(i), this.#n.set(i, a);
                }
            }
        };
        setChainProperties(e) {
            e && (this.#e = e);
        }
        setHasher(e) {
            this.#s = e || Gl;
        }
        setKnownTypes(e) {
            this.#i = e;
        }
        setLookup(e) {
            this.#o = e, e.register();
        }
        #m = (e)=>{
            this.setLookup(e);
            let n = null;
            if (this.hasType("SpWeightsWeightV2Weight")) {
                const r = this.createType("SpWeightsWeightV2Weight");
                n = r.refTime && r.proofSize ? "SpWeightsWeightV2Weight" : "WeightV1";
            } else Ya(this.createType("Weight")) || (n = "WeightV1");
            n && this.register({
                Weight: n
            });
        };
        setMetadata(e, n, r, s) {
            this.#a = e.asLatest, this.#l = e.version, this.#r = null, this.#m(this.#a.lookup), $Ge(this, this.#a, this.#l, this.#d, this.#w), WGe(this, this.#a, this.#l, this.#g), KGe(this, this.#a, this.#l, this.#c);
            const [i] = Object.keys(this.#d).sort(IB);
            if (i) {
                const [o] = Object.keys(this.#d[i]).sort(IB);
                o && (this.#r = new Uint8Array([
                    parseInt(i, 10),
                    parseInt(o, 10)
                ]));
            }
            this.setSignedExtensions(n || (this.#a.extrinsic.versions.length > 0 && this.#a.extrinsic.versions.every((o)=>o > 0) ? this.#a.extrinsic.transactionExtensions.map(({ identifier: o })=>o.toString()) : AS), r, s), this.setChainProperties(XGe(this, e));
        }
        setSignedExtensions(e = AS, n, r) {
            if (this.#f = e, this.#p = n, !r) {
                const s = S$e(this.#f, this.#p);
                s.length && EB.warn(`Unknown signed extensions ${s.join(", ")} found, treating them as no-effect`);
            }
        }
    }
    function HY(t = 1750) {
        return (e)=>{
            let [n, r, s, i] = [
                0,
                0,
                au.EMPTY,
                au.EMPTY
            ];
            return new us((o)=>(e.subscribe(o), r++ === 0 && (n === 1 ? i.unsubscribe() : s = e.connect(), n = 3), ()=>{
                    --r === 0 && (n === 2 ? (n = 0, i.unsubscribe()) : (n = 1, i = fDe.schedule(()=>{
                        n = 0, s.unsubscribe();
                    }, t)));
                }));
        };
    }
    function GGe(t, e) {
        return vn({
            t
        }) === vn({
            t: e
        });
    }
    function ZGe(t) {
        throw t;
    }
    function JGe() {}
    function QA({ delay: t, skipChange: e = !1, skipTimeout: n = !1 } = {}) {
        return (r)=>r.pipe(cu(ZGe), e ? Nd(JGe) : ZDe(GGe), OZ(1), n ? aA() : HY(t));
    }
    function Be(t, e) {
        const r = am((...s)=>new us((i)=>{
                const o = e(...s).subscribe(i);
                return ()=>{
                    r.unmemoize(...s), o.unsubscribe();
                };
            }).pipe(QA()), {
            getInstanceId: ()=>t
        });
        return r;
    }
    const YGe = ma("rpc-core"), QGe = {
        fallback: void 0,
        modifier: {
            isOptional: !0
        },
        type: {
            asMap: {
                linked: {
                    isTrue: !1
                }
            },
            isMap: !1
        }
    }, eZe = 1024 * 10 * 10;
    function Qw(t, { noErrorLog: e, params: n, type: r }, s) {
        e || YGe.error(`${t}(${n.map(({ isOptional: i, name: o, type: a })=>`${o}${i ? "?" : ""}: ${a}`).join(", ")}): ${r}:: ${s.message}`);
    }
    function AB(t) {
        return [
            "0x3a636f6465"
        ].includes(t.toHex());
    }
    class tZe {
        #e;
        #t;
        #n;
        #r;
        #s = 0;
        #i;
        #o;
        mapping = new Map;
        provider;
        sections = [];
        constructor(e, n, { isPedantic: r = !0, provider: s, rpcCacheCapacity: i, ttl: o, userRpc: a = {} }){
            if (!s || !Mt(s.send)) throw new Error("Expected Provider to API create");
            this.#e = e, this.#t = r, this.#n = n, this.provider = s;
            const c = Object.keys(Am);
            this.sections.push(...c), this.#r = new NJ(i || eZe, o), this.addUserInterfaces(a);
        }
        get isConnected() {
            return this.provider.isConnected;
        }
        connect() {
            return this.provider.connect();
        }
        async disconnect() {
            return this.provider.disconnect();
        }
        get stats() {
            const e = this.provider.stats;
            return e ? {
                ...e,
                core: {
                    cacheHits: this.#s,
                    cacheSize: this.#r.length
                }
            } : void 0;
        }
        setRegistrySwap(e) {
            this.#i = am(e, {
                getInstanceId: ()=>this.#e
            });
        }
        setResolveBlockHash(e) {
            this.#o = am(e, {
                getInstanceId: ()=>this.#e
            });
        }
        addUserInterfaces(e) {
            this.sections.push(...Object.keys(e).filter((n)=>!this.sections.includes(n)));
            for(let n = 0, r = this.sections.length; n < r; n++){
                const s = this.sections[n], i = Ye({}, Am[s], e[s]), o = Object.keys(i);
                for(let a = 0, c = o.length; a < c; a++){
                    const l = o[a], u = i[l], d = u.endpoint || `${s}_${l}`;
                    if (!this.mapping.has(d)) {
                        const f = !!u.pubsub;
                        this[s] || (this[s] = {}), this.mapping.set(d, Ye({}, u, {
                            isSubscription: f,
                            jsonrpc: d,
                            method: l,
                            section: s
                        })), ni(this[s], l, ()=>f ? this._createMethodSubscribe(s, l, u) : this._createMethodSend(s, l, u));
                    }
                }
            }
        }
        _memomize(e, n) {
            const r = {
                getInstanceId: ()=>this.#e
            }, s = am(e(!0), r);
            return s.raw = am(e(!1), r), s.meta = n, s;
        }
        _formatResult(e, n, r, s, i, o, a) {
            return e ? this._formatOutput(n, r, s, i, o, a) : a;
        }
        _createMethodSend(e, n, r) {
            const s = r.endpoint || `${e}_${n}`, i = r.params.findIndex(({ isHistoric: l })=>l);
            let o = null;
            const a = async (l, u)=>{
                const d = i === -1 ? null : u[i], f = d && r.params[i].type === "BlockNumber" ? await this.#o?.(d) : d, { registry: p } = l && f && this.#i ? await this.#i(Dt(f)) : {
                    registry: this.#n
                }, h = this._formatParams(p, null, r, u), m = await this.provider.send(s, h.map((w)=>w.toJSON()), !!f);
                return this._formatResult(l, p, f, n, r, h, m);
            }, c = (l)=>(...u)=>{
                    const d = l && i !== -1 && !!u[i];
                    return new us((f)=>(a(l, u).then((p)=>{
                            f.next(p), f.complete();
                        }).catch((p)=>{
                            Qw(n, r, p), f.error(p), f.complete();
                        }), ()=>{
                            l ? o?.unmemoize(...u) : o?.raw.unmemoize(...u);
                        })).pipe(OZ(1), d ? HY() : aA());
                };
            return o = this._memomize(c, r), o;
        }
        _createSubscriber({ paramsJson: e, subName: n, subType: r, update: s }, i) {
            return new Promise((o, a)=>{
                this.provider.subscribe(r, n, e, s).then(o).catch((c)=>{
                    i(c), a(c);
                });
            });
        }
        _createMethodSubscribe(e, n, r) {
            const [s, i, o] = r.pubsub, a = `${e}_${i}`, c = `${e}_${o}`, l = `${e}_${s}`;
            let u = null;
            const d = (f)=>(...p)=>new us((h)=>{
                        let m = Promise.resolve(null);
                        const w = this.#n, v = (k)=>{
                            Qw(n, r, k), h.error(k);
                        };
                        try {
                            const k = this._formatParams(w, null, r, p), _ = (A, P)=>{
                                if (A) {
                                    Qw(n, r, A);
                                    return;
                                }
                                try {
                                    h.next(this._formatResult(f, w, null, n, r, k, P));
                                } catch (U) {
                                    h.error(U);
                                }
                            };
                            m = this._createSubscriber({
                                paramsJson: k.map((A)=>A.toJSON()),
                                subName: a,
                                subType: l,
                                update: _
                            }, v);
                        } catch (k) {
                            v(k);
                        }
                        return ()=>{
                            f ? u?.unmemoize(...p) : u?.raw.unmemoize(...p), m.then((k)=>Gf(k) ? Promise.resolve(!1) : this.provider.unsubscribe(l, c, k)).catch((k)=>Qw(n, r, k));
                        };
                    }).pipe(QA());
            return u = this._memomize(d, r), u;
        }
        _formatParams(e, n, r, s) {
            const i = s.length, o = r.params.filter(({ isOptional: c })=>!c).length;
            if (i < o || i > r.params.length) throw new Error(`Expected ${r.params.length} parameters${o === r.params.length ? "" : ` (${r.params.length - o} optional)`}, ${i} found instead`);
            const a = new Array(i);
            for(let c = 0; c < i; c++)a[c] = e.createTypeUnsafe(r.params[c].type, [
                s[c]
            ], {
                blockHash: n
            });
            return a;
        }
        _formatOutput(e, n, r, s, i, o) {
            if (s.type === "StorageData") {
                const a = i[0];
                return this._formatStorageData(e, n, a, o);
            } else if (s.type === "StorageChangeSet") {
                const a = i[0];
                return a ? this._formatStorageSet(e, o.block, a, o.changes) : e.createType("StorageChangeSet", o);
            } else if (s.type === "Vec<StorageChangeSet>") {
                const a = o, c = a.length, l = new Array(c);
                for(let u = 0; u < c; u++){
                    const { block: d, changes: f } = a[u];
                    l[u] = [
                        e.createType("BlockHash", d),
                        this._formatStorageSet(e, d, i[0], f)
                    ];
                }
                return r === "queryStorageAt" ? l[0][1] : l;
            }
            return e.createTypeUnsafe(s.type, [
                o
            ], {
                blockHash: n
            });
        }
        _formatStorageData(e, n, r, s) {
            const i = Gf(s), o = i ? null : AB(r) ? s : Dt(s);
            return this._newType(e, n, r, o, i);
        }
        _formatStorageSet(e, n, r, s) {
            const i = r.length, o = i !== 1, a = new Array(i);
            for(let c = 0; c < i; c++)a[c] = this._formatStorageSetEntry(e, n, r[c], s, o, c);
            return a;
        }
        _formatStorageSetEntry(e, n, r, s, i, o) {
            const a = r.toHex(), c = s.find(([h])=>h === a), l = Rr(c);
            if (l && i) {
                const h = this.#r.get(a);
                if (h) return this.#s++, h;
            }
            const u = l ? null : c[1], d = Gf(u), f = d || AB(r) ? u : Dt(u), p = this._newType(e, n, r, f, d, o);
            return this._setToCache(a, p), p;
        }
        _setToCache(e, n) {
            this.#r.set(e, n);
        }
        _newType(e, n, r, s, i, o = -1) {
            const a = r.meta ? e.createLookupType(aY(r.meta.type)) : r.outputType || "Raw", c = r.meta || QGe, l = o === -1 ? "" : ` entry ${o}:`;
            try {
                return e.createTypeUnsafe(a, [
                    i ? c.fallback ? a.includes("Linkage<") ? Ai(Hc(c.fallback.toHex()), new Uint8Array(2)) : Hc(c.fallback.toHex()) : void 0 : c.modifier.isOptional ? e.createTypeUnsafe(a, [
                        s
                    ], {
                        blockHash: n,
                        isPedantic: this.#t
                    }) : s
                ], {
                    blockHash: n,
                    isFallback: i && !!c.fallback,
                    isOptional: c.modifier.isOptional,
                    isPedantic: this.#t && !c.modifier.isOptional
                });
            } catch (u) {
                throw new Error(`Unable to decode storage ${r.section || "unknown"}.${r.method || "unknown"}:${l}: ${u.message}`);
            }
        }
    }
    function nT(t) {
        return cJ(t.number) ? t.number.unwrap() : t.number;
    }
    const nZe = {
        del: ()=>{},
        forEach: ()=>{},
        get: ()=>{},
        set: (t, e)=>e
    };
    let U1;
    function rZe(t = "", e) {
        U1 = nZe;
    }
    rZe();
    function jY(t) {
        return t.pipe(ve(([e])=>e));
    }
    function Cu(t) {
        return (e, n)=>Be(e, (...r)=>jY(t(n, ...r)));
    }
    function qY(t, e, n, r) {
        ni(t, e, ()=>Zf({}, n(e), (s)=>r(e, s)));
    }
    function sZe(t, e) {
        return Be(t, (n)=>{
            const r = Bt(n) ? n : Xd((n || "").toString());
            if (r.length > 8) return Te(e.registry.createType(r.length === 20 ? "AccountId20" : "AccountId", r));
            const s = e.registry.createType("AccountIndex", r);
            return e.derive.accounts.indexToId(s.toString()).pipe(ve((i)=>Zu(i, "Unable to retrieve accountId")));
        });
    }
    function iZe(t, [e, n, r, s, i]) {
        const o = t?.toString(), a = (c)=>c.toString() === o;
        return {
            isCouncil: (e?.map((c)=>Array.isArray(c) ? c[0] : c.who) || n || []).some(a),
            isSociety: (s || []).some(a),
            isSudo: i?.toString() === o,
            isTechCommittee: (r || []).some(a)
        };
    }
    function oZe(t, e) {
        return Be(t, ()=>{
            const n = [
                void 0,
                [],
                [],
                [],
                void 0
            ], r = [
                (e.query.elections || e.query.phragmenElection || e.query.electionsPhragmen)?.members,
                e.query.council?.members,
                e.query.technicalCommittee?.members,
                e.query.society?.members,
                e.query.sudo?.key
            ], s = r.filter((i)=>i);
            return s.length ? e.queryMulti(s).pipe(ve((i)=>{
                let o = -1;
                for(let a = 0, c = r.length; a < c; a++)Mt(r[a]) && (n[a] = i[++o]);
                return n;
            })) : Te(n);
        });
    }
    function aZe(t, e) {
        return Be(t, (n)=>e.derive.accounts._flags().pipe(ve((r)=>iZe(n, r))));
    }
    function cZe(t, e) {
        return Be(t, (n)=>{
            try {
                const r = Bt(n) ? n : Xd((n || "").toString());
                if (r.length > 8) {
                    const i = e.registry.createType(r.length === 20 ? "AccountId20" : "AccountId", r);
                    return e.derive.accounts.idToIndex(i).pipe(ve((o)=>[
                            i,
                            o
                        ]));
                }
                const s = e.registry.createType("AccountIndex", r);
                return e.derive.accounts.indexToId(s.toString()).pipe(ve((i)=>[
                        i,
                        s
                    ]));
            } catch  {
                return Te([
                    void 0,
                    void 0
                ]);
            }
        });
    }
    const lZe = {
        toHex: ()=>{}
    };
    function Ui(t) {
        return t && (t.isRaw ? Kl(t.asRaw.toU8a(!0)) : t.isNone ? void 0 : t.toHex());
    }
    function uZe(t) {
        return t.reduce((e, [n, r])=>{
            const s = Ui(n), i = Ui(r);
            return s && i && (e[s] = i), e;
        }, {});
    }
    function WY(t) {
        const e = t.unwrap();
        return Array.isArray(e) ? e[0] : e;
    }
    function dZe(t, e) {
        if (!t?.isSome) return {
            judgements: []
        };
        const { info: n, judgements: r } = WY(t), s = Ui(n.display);
        return {
            discord: Ui(n.discord),
            display: e && Ui(e[1]) || s,
            displayParent: e && s,
            email: Ui(n.email),
            github: Ui(n.github),
            image: Ui(n.image),
            judgements: r,
            legal: Ui(n.legal),
            matrix: Ui(n.matrix),
            other: n.additional ? uZe(n.additional) : {},
            parent: e?.[0],
            pgp: n.pgpFingerprint.unwrapOr(lZe).toHex(),
            riot: Ui(n.riot),
            twitter: Ui(n.twitter),
            web: Ui(n.web)
        };
    }
    function fZe(t, e, n) {
        if (e?.isSome) return Te([
            e,
            void 0
        ]);
        if (n?.isSome) {
            const r = n.unwrap();
            return et([
                t.derive.accounts._identity(r[0]).pipe(ve(([s])=>s)),
                Te(r)
            ]);
        }
        return Te([
            void 0,
            void 0
        ]);
    }
    function pZe(t, e) {
        return Be(t, (n)=>n && e.query.identity?.identityOf ? et([
                e.query.identity.identityOf(n),
                e.query.identity.superOf(n)
            ]) : Te([
                void 0,
                void 0
            ]));
    }
    function hZe(t, e) {
        return Be(t, (n)=>e.derive.accounts._identity(n).pipe(it(([r, s])=>fZe(e, r, s)), ve(([r, s])=>dZe(r, s)), it((r)=>gZe(r, e, n))));
    }
    function gZe(t, e, n) {
        const r = t.parent || n;
        return !r || !e.query.identity ? Te(t) : e.query.identity.subsOf(r).pipe(ve((s)=>{
            const i = s[1];
            return {
                ...t,
                subs: i
            };
        }));
    }
    const bZe = Cu((t, e)=>t.derive.accounts.hasIdentityMulti([
            e
        ]));
    function mZe(t, e) {
        return Be(t, (n)=>e.query.identity?.identityOf ? et([
                e.query.identity.identityOf.multi(n),
                e.query.identity.superOf.multi(n)
            ]).pipe(ve(([r, s])=>r.map((i, o)=>{
                    const a = s[o], c = a && a.isSome ? a.unwrap()[0].toString() : void 0;
                    let l;
                    if (i && i.isSome) {
                        const u = Ui(WY(i).info.display);
                        u && !Fn(u) && (l = u);
                    }
                    return {
                        display: l,
                        hasIdentity: !!(l || c),
                        parentId: c
                    };
                }))) : Te(n.map(()=>({
                    hasIdentity: !1
                }))));
    }
    function yZe(t, e) {
        return Be(t, (n)=>e.derive.accounts.indexes().pipe(ve((r)=>r[n.toString()])));
    }
    let VS = null;
    function wZe(t) {
        return t.query.indices.accounts.entries().pipe(ve((e)=>e.reduce((n, [r, s])=>(s.isSome && (n[s.unwrap()[0].toString()] = t.registry.createType("AccountIndex", r.args[0])), n), {})));
    }
    function _Ze(t, e) {
        return Be(t, ()=>VS ? Te(VS) : (e.query.indices ? wZe(e).pipe(V1({})) : Te({})).pipe(ve((n)=>(VS = n, n))));
    }
    function xZe(t, e) {
        return Be(t, (n)=>e.query.indices ? e.query.indices.accounts(n).pipe(ve((r)=>r.unwrapOr([])[0])) : Te(void 0));
    }
    function vZe(t, e) {
        return (e && t.query.nicks?.nameOf ? t.query.nicks.nameOf(e) : Te(void 0)).pipe(ve((n)=>n?.isSome ? Kl(n.unwrap()[0]).substring(0, t.consts.nicks.maxLength.toNumber()) : void 0));
    }
    function SZe(t, e) {
        return Be(t, (n)=>e.derive.accounts.idAndIndex(n).pipe(it(([r, s])=>et([
                    Te({
                        accountId: r,
                        accountIndex: s
                    }),
                    e.derive.accounts.identity(r),
                    vZe(e, r)
                ])), ve(([{ accountId: r, accountIndex: s }, i, o])=>({
                    accountId: r,
                    accountIndex: s,
                    identity: i,
                    nickname: o
                }))));
    }
    const kZe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _flags: oZe,
        _identity: pZe,
        accountId: sZe,
        flags: aZe,
        hasIdentity: bZe,
        hasIdentityMulti: mZe,
        idAndIndex: cZe,
        idToIndex: yZe,
        identity: hZe,
        indexToId: xZe,
        indexes: _Ze,
        info: SZe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function TZe(t, e) {
        const n = t.registry.getModuleInstances(t.runtimeVersion.specName, e), r = n?.length ? n[0] : e;
        return t.query[r];
    }
    function H1(t, e) {
        return (n, r)=>Be(n, e(TZe(r, t), r, n));
    }
    function eP(t, e) {
        return (n)=>H1(n, (r)=>()=>Mt(r?.[t]) ? r[t]() : Te(e));
    }
    const s9 = eP("members", []);
    function i9(t) {
        return H1(t, (e)=>()=>Mt(e?.prime) ? e.prime().pipe(ve((n)=>n.unwrapOr(null))) : Te(null));
    }
    function CZe(t, [e, n, r]) {
        return n.map((s, i)=>({
                hash: t.registry.createType("Hash", e[i]),
                proposal: s && s.isSome ? s.unwrap() : null,
                votes: r[i].unwrapOr(null)
            }));
    }
    function KY(t, e, n) {
        return (Mt(e?.proposals) && n.length ? et([
            Te(n),
            e.proposalOf.multi(n).pipe(cu(()=>Te(n.map(()=>null)))),
            e.voting.multi(n)
        ]) : Te([
            [],
            [],
            []
        ])).pipe(ve((r)=>CZe(t, r)));
    }
    function o9(t) {
        return H1(t, (e)=>()=>Te(Mt(e?.proposals)));
    }
    function a9(t) {
        return H1(t, (e, n)=>()=>n.derive[t].proposalHashes().pipe(it((r)=>KY(n, e, r))));
    }
    function c9(t) {
        return H1(t, (e, n)=>(r)=>Mt(e?.proposals) ? jY(KY(n, e, [
                    r
                ])) : Te(null));
    }
    const l9 = eP("proposalCount", null), u9 = eP("proposals", []), EZe = s9("allianceMotion"), IZe = o9("allianceMotion"), AZe = c9("allianceMotion"), PZe = l9("allianceMotion"), OZe = u9("allianceMotion"), MZe = a9("allianceMotion"), RZe = i9("allianceMotion"), NZe = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: IZe,
        members: EZe,
        prime: RZe,
        proposal: AZe,
        proposalCount: PZe,
        proposalHashes: OZe,
        proposals: MZe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function tP(t) {
        return t.query.voterList || t.query.voterBagsList || t.query.bagsList;
    }
    function VZe(t, e) {
        const n = t.map((s, i)=>({
                bag: e[i].unwrapOr(null),
                id: s,
                key: s.toString()
            })).sort((s, i)=>i.id.cmp(s.id)), r = n.length - 1;
        return n.map((s, i)=>Ye(s, {
                bagLower: i === r ? ss : n[i + 1].id,
                bagUpper: s.id,
                index: i
            }));
    }
    function DZe(t, e) {
        const n = tP(e);
        return Be(t, (r)=>{
            const s = r.map((i)=>Ms(i));
            return s.length ? n.listBags.multi(s).pipe(ve((i)=>VZe(s, i))) : Te([]);
        });
    }
    function BZe(t, e) {
        const n = tP(e);
        return Be(t, ()=>n.listBags.keys().pipe(it((r)=>e.derive.bagsList._getIds(r.map(({ args: [s] })=>s))), ve((r)=>r.filter(({ bag: s })=>s))));
    }
    function FZe(t, e) {
        return Be(t, (n)=>e.derive.bagsList._getIds([
                Ms(n)
            ]).pipe(ve((r)=>r[0])));
    }
    function LZe(t, e) {
        return Be(t, (n)=>e.derive.bagsList.listNodes(n.bag).pipe(ve((r)=>Ye({
                    nodes: r
                }, n))));
    }
    function zZe(t, e) {
        return Be(t, (n)=>e.derive.bagsList.get(n).pipe(it((r)=>e.derive.bagsList.expand(r))));
    }
    function UZe(t, e) {
        const n = new Sy(e), r = tP(t);
        return n.pipe(it((s)=>r.listNodes(s)), Nd((s)=>{
            kp(()=>{
                s.isSome && s.value.next.isSome ? n.next(s.unwrap().next.unwrap()) : n.complete();
            });
        }), z3(), ve((s)=>s.map((i)=>i.unwrap())));
    }
    function HZe(t, e) {
        return Be(t, (n)=>n && n.head.isSome ? UZe(e, n.head.unwrap()) : Te([]));
    }
    const jZe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _getIds: DZe,
        all: BZe,
        expand: LZe,
        get: FZe,
        getExpanded: zZe,
        listNodes: HZe
    }, Symbol.toStringTag, {
        value: "Module"
    })), qZe = "0x76657374696e6720";
    function WZe(t, e, n) {
        let r = t.registry.createType("Balance"), s = [], i = t.registry.createType("Balance"), o = !1;
        if (Array.isArray(n)) {
            s = n.filter(({ until: c })=>!c || e && c.gt(e)), o = s.some(({ amount: c })=>c && c.isMax()), i = t.registry.createType("Balance", s.filter(({ id: c })=>c.eq(qZe)).reduce((c, { amount: l })=>c.iadd(l), new ht(0)));
            const a = s.filter(({ amount: c })=>c && !c.isMax());
            a.length && (r = t.registry.createType("Balance", H_(...a.map(({ amount: c })=>c))));
        }
        return {
            allLocked: o,
            lockedBalance: r,
            lockedBreakdown: s,
            vestingLocked: i
        };
    }
    function PB(t, e, n, r) {
        const { allLocked: s, lockedBalance: i, lockedBreakdown: o, vestingLocked: a } = WZe(t, e, r);
        let c = null;
        if (n?.frameSystemAccountInfo?.frozen) {
            const { frameSystemAccountInfo: l, freeBalance: u, reservedBalance: d } = n, f = l.frozen.isZero() && d.isZero(), p = t.consts.balances.existentialDeposit, h = f ? new ht(0) : p, m = l.frozen.sub(d);
            c = t.registry.createType("Balance", s ? 0 : H_(new ht(0), u.sub(H_(h, m))));
        }
        return Ye({}, n, {
            availableBalance: t.registry.createType("Balance", s ? 0 : H_(new ht(0), n?.freeBalance ? n.freeBalance.sub(i) : new ht(0))),
            lockedBalance: i,
            lockedBreakdown: o,
            transferable: c,
            vestingLocked: a
        });
    }
    function KZe(t, e, n) {
        const r = n || [], s = !e.vestingLocked.isZero(), i = r.map(({ locked: c, perBlock: l, startingBlock: u })=>t.gt(u) ? vLe(c, l.mul(t.sub(u))) : ss), o = i.reduce((c, l)=>c.iadd(l), new ht(0)), a = r.reduce((c, { locked: l })=>c.iadd(l), new ht(0));
        return {
            isVesting: s,
            vestedBalance: o,
            vestedClaimable: s ? e.vestingLocked.sub(a.sub(o)) : ss,
            vesting: r.map(({ locked: c, perBlock: l, startingBlock: u }, d)=>({
                    endBlock: c.div(l).iadd(u),
                    locked: c,
                    perBlock: l,
                    startingBlock: u,
                    vested: i[d]
                })).filter(({ locked: c })=>!c.isZero()),
            vestingTotal: a
        };
    }
    function $Ze(t, e) {
        const [n, [r, s, i], o] = e, a = PB(t, o, n, s[0]);
        return Ye(a, KZe(o, a, r), {
            accountId: n.accountId,
            accountNonce: n.accountNonce,
            additional: s.slice(1).map((c, l)=>PB(t, o, n.additional[l], c)),
            namedReserves: i
        });
    }
    function XZe(t, e) {
        return et([
            t.query.balances.locks(e),
            t.query.balances.vesting(e)
        ]).pipe(ve(([n, r])=>{
            let s = null;
            if (r.isSome) {
                const { offset: i, perBlock: o, startingBlock: a } = r.unwrap();
                s = t.registry.createType("VestingInfo", {
                    locked: i,
                    perBlock: o,
                    startingBlock: a
                });
            }
            return [
                s ? [
                    s
                ] : null,
                [
                    n
                ],
                []
            ];
        }));
    }
    const GZe = (t)=>!!t;
    function OB(t) {
        return [
            t.map((e)=>!e),
            t.filter(GZe)
        ];
    }
    function ZZe(t, e, n = [
        "balances"
    ]) {
        const [r, s] = OB(n.map((a)=>t.derive[a]?.customLocks || t.query[a]?.locks)), [i, o] = OB(n.map((a)=>t.query[a]?.reserves));
        return et([
            t.query.vesting?.vesting ? t.query.vesting.vesting(e) : Te(t.registry.createType("Option<VestingInfo>")),
            s.length ? et(s.map((a)=>a(e))) : Te([]),
            o.length ? et(o.map((a)=>a(e))) : Te([])
        ]).pipe(ve(([a, c, l])=>{
            let u = -1, d = -1;
            const f = a.unwrapOr(null);
            return [
                f ? Array.isArray(f) ? f : [
                    f
                ] : null,
                r.map((p)=>p ? t.registry.createType("Vec<BalanceLock>") : c[++u]),
                i.map((p)=>p ? t.registry.createType("Vec<PalletBalancesReserveData>") : l[++d])
            ];
        }));
    }
    function $Y(t, e) {
        const n = e.registry.getModuleInstances(e.runtimeVersion.specName, "balances");
        return Be(t, (r)=>et([
                e.derive.balances.account(r),
                Mt(e.query.system?.account) || Mt(e.query.balances?.account) ? ZZe(e, r, n) : XZe(e, r)
            ]).pipe(it(([s, i])=>et([
                    Te(s),
                    Te(i),
                    e.derive.chain.bestNumber()
                ])), ve((s)=>$Ze(e, s))));
    }
    function Gi(t) {
        return t.registry.createType("Balance");
    }
    function MB(t, [e, n, r, s], i) {
        const o = t.registry.createType("Balance", e.toBn());
        return i.isFrameAccountData ? {
            frameSystemAccountInfo: {
                flags: s,
                frozen: r
            },
            freeBalance: e,
            frozenFee: t.registry.createType("Balance", 0),
            frozenMisc: t.registry.createType("Balance", 0),
            reservedBalance: n,
            votingBalance: o
        } : {
            freeBalance: e,
            frozenFee: r,
            frozenMisc: s,
            reservedBalance: n,
            votingBalance: o
        };
    }
    function JZe(t, [e, [n, [r, ...s], i]]) {
        return Ye({
            accountId: e,
            accountNonce: n,
            additional: s.map((o)=>MB(t, o, i))
        }, MB(t, r, i));
    }
    function YZe(t, e) {
        return et([
            t.query.balances.freeBalance(e),
            t.query.balances.reservedBalance(e),
            t.query.system.accountNonce(e)
        ]).pipe(ve(([n, r, s])=>[
                s,
                [
                    [
                        n,
                        r,
                        Gi(t),
                        Gi(t)
                    ]
                ],
                {
                    isFrameAccountData: !1
                }
            ]));
    }
    function XY(t, e) {
        const n = (r)=>[
                r,
                [
                    [
                        Gi(t),
                        Gi(t),
                        Gi(t),
                        Gi(t)
                    ]
                ],
                {
                    isFrameAccountData: !1
                }
            ];
        return Mt(t.query.system.account) ? t.query.system.account(e).pipe(ve(({ nonce: r })=>n(r))) : Mt(t.query.system.accountNonce) ? t.query.system.accountNonce(e).pipe(ve((r)=>n(r))) : Te(n(t.registry.createType("Index")));
    }
    function RB(t, e, n = [
        "balances"
    ]) {
        const r = n.map((i)=>t.derive[i]?.customAccount || t.query[i]?.account).filter((i)=>Mt(i)), s = (i, o)=>[
                i,
                o.map(({ feeFrozen: a, free: c, miscFrozen: l, reserved: u })=>[
                        c,
                        u,
                        a,
                        l
                    ]),
                {
                    isFrameAccountData: !1
                }
            ];
        return r.length ? Mt(t.query.system.account) ? et([
            t.query.system.account(e),
            ...r.map((i)=>i(e))
        ]).pipe(ve(([{ nonce: i }, ...o])=>s(i, o))) : et([
            t.query.system.accountNonce(e),
            ...r.map((i)=>i(e))
        ]).pipe(ve(([i, ...o])=>s(i, o))) : XY(t, e);
    }
    function QZe(t, e) {
        return t.query.system.account(e).pipe(ve((n)=>{
            const r = n.nonce ? n.data : n[1], s = n.nonce || n[0];
            if (!r || r.isEmpty) return [
                s,
                [
                    [
                        Gi(t),
                        Gi(t),
                        Gi(t),
                        Gi(t)
                    ]
                ],
                {
                    isFrameAccountData: !1
                }
            ];
            if (!!n.data.frozen) {
                const { flags: o, free: a, frozen: c, reserved: l } = r;
                return [
                    s,
                    [
                        [
                            a,
                            l,
                            c,
                            o
                        ]
                    ],
                    {
                        isFrameAccountData: !0
                    }
                ];
            } else {
                const { feeFrozen: o, free: a, miscFrozen: c, reserved: l } = r;
                return [
                    s,
                    [
                        [
                            a,
                            l,
                            o,
                            c
                        ]
                    ],
                    {
                        isFrameAccountData: !1
                    }
                ];
            }
        }));
    }
    function eJe(t, e) {
        const n = e.registry.getModuleInstances(e.runtimeVersion.specName, "balances"), r = n && n[0] !== "balances";
        return Be(t, (s)=>e.derive.accounts.accountId(s).pipe(it((i)=>i ? et([
                    Te(i),
                    r ? RB(e, i, n) : Mt(e.query.system?.account) ? QZe(e, i) : Mt(e.query.balances?.account) ? RB(e, i) : Mt(e.query.balances?.freeBalance) ? YZe(e, i) : XY(e, i)
                ]) : Te([
                    e.registry.createType("AccountId"),
                    [
                        e.registry.createType("Index"),
                        [
                            [
                                Gi(e),
                                Gi(e),
                                Gi(e),
                                Gi(e)
                            ]
                        ],
                        {
                            isFrameAccountData: !1
                        }
                    ]
                ])), ve((i)=>JZe(e, i))));
    }
    function tJe(t, e) {
        return Be(t, (n)=>n?.length ? et(n.map((r)=>e.derive.balances.account(r))) : Te([]));
    }
    const nJe = $Y, rJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        account: eJe,
        all: $Y,
        votingBalance: nJe,
        votingBalances: tJe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function sJe(t, e) {
        const n = t.tx.bounties ? t.tx.bounties : t.tx.treasury, r = [
            n.approveBounty,
            n.closeBounty,
            n.proposeCurator,
            n.unassignCurator
        ];
        return e.filter((s)=>r.find((i)=>s.proposal && i.is(s.proposal)));
    }
    function NB([t, e, n, r]) {
        const s = [];
        return t.forEach((i, o)=>{
            i.isSome && s.push({
                bounty: i.unwrap(),
                description: e[o].unwrapOrDefault().toUtf8(),
                index: n[o],
                proposals: r.filter((a)=>a.proposal && n[o].eq(a.proposal.args[0]))
            });
        }), s;
    }
    function iJe(t, e) {
        const n = e.query.bounties || e.query.treasury;
        return Be(t, ()=>n.bounties ? et([
                n.bountyCount(),
                e.query.council ? e.query.council.proposalCount() : Te(0)
            ]).pipe(it(()=>et([
                    n.bounties.keys(),
                    e.derive.council ? e.derive.council.proposals() : Te([])
                ])), it(([r, s])=>{
                const i = r.map(({ args: [o] })=>o);
                return et([
                    n.bounties.multi(i),
                    n.bountyDescriptions.multi(i),
                    Te(i),
                    Te(sJe(e, s))
                ]);
            }), ve(NB)) : Te(NB([
                [],
                [],
                [],
                []
            ])));
    }
    const oJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        bounties: iJe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function GY(t) {
        return (e, n)=>Be(e, ()=>t(n).pipe(ve(nT)));
    }
    function aJe(t, e) {
        const n = e.session?.validators ? e.session.validators() : Te(null), { logs: [r] } = t.digest, s = r && (r.isConsensus && r.asConsensus[0].isNimbus && r.asConsensus[1] || r.isPreRuntime && r.asPreRuntime[0].isNimbus && r.asPreRuntime[1]);
        if (s) {
            if (e.authorMapping?.mappingWithDeposit) return et([
                Te(t),
                n,
                e.authorMapping.mappingWithDeposit(s).pipe(ve((i)=>i.unwrapOr({
                        account: null
                    }).account))
            ]);
            if (e.parachainStaking?.selectedCandidates && e.session?.nextKeys) {
                const i = s.toHex();
                return et([
                    Te(t),
                    n,
                    e.parachainStaking.selectedCandidates().pipe(Uc((o)=>et([
                            Te(o),
                            e.session.nextKeys.multi(o).pipe(ve((a)=>a.findIndex((c)=>c.unwrapOrDefault().nimbus.toHex() === i)))
                        ])), ve(([o, a])=>a === -1 ? null : o[a]))
                ]);
            }
        }
        return et([
            Te(t),
            n,
            Te(null)
        ]);
    }
    function nP(t, e, n) {
        return t.queryAt(e.parentHash.isEmpty ? n || e.hash : e.parentHash).pipe(it((r)=>aJe(e, r)));
    }
    const cJe = GY((t)=>t.rpc.chain.subscribeNewHeads()), lJe = GY((t)=>t.rpc.chain.subscribeFinalizedHeads());
    function uJe(t, e) {
        return Be(t, ()=>et([
                e.derive.chain.bestNumber(),
                e.derive.chain.bestNumberFinalized()
            ]).pipe(ve(([n, r])=>e.registry.createType("BlockNumber", n.sub(r)))));
    }
    function ZY(t, e) {
        const [n] = t.logs.filter((o)=>o.isConsensus), r = t.logs.filter((o)=>o.isPreRuntime), [s] = t.logs.filter((o)=>o.isSeal);
        let i;
        try {
            for (const o of r){
                const [a, c] = o.asPreRuntime;
                if (i = a.extractAuthor(c, e), i) return i;
            }
            if (!i && n) {
                const [o, a] = n.asConsensus;
                i = o.extractAuthor(a, e);
            }
            if (!i && s) {
                const [o, a] = s.asSeal;
                i = o.extractAuthor(a, e);
            }
        } catch  {}
        return i;
    }
    function JY(t, e, n, r) {
        const s = t.createClass("Header");
        class i extends s {
            #e;
            constructor(a, c, l, u){
                super(a, c), this.#e = u || ZY(this.digest, l || []), this.createdAtHash = c?.createdAtHash;
            }
            get author() {
                return this.#e;
            }
        }
        return new i(t, e, n, r);
    }
    function dJe(t, e) {
        return t.map((n, r)=>{
            let s, i;
            const o = e.filter(({ phase: a })=>a.isApplyExtrinsic && a.asApplyExtrinsic.eq(r)).map(({ event: a })=>(a.section === "system" && (a.method === "ExtrinsicSuccess" ? i = a.data[0] : a.method === "ExtrinsicFailed" && (s = a.data[0], i = a.data[1])), a));
            return {
                dispatchError: s,
                dispatchInfo: i,
                events: o,
                extrinsic: n
            };
        });
    }
    function fJe(t, e, n, r, s) {
        const i = t.createClass("SignedBlock");
        class o extends i {
            #e;
            #t;
            #n;
            constructor(c, l, u, d, f){
                super(c, l), this.#e = f || ZY(this.block.header.digest, d || []), this.#t = u || [], this.#n = dJe(this.block.extrinsics, this.#t), this.createdAtHash = l?.createdAtHash;
            }
            get author() {
                return this.#e;
            }
            get events() {
                return this.#t;
            }
            get extrinsics() {
                return this.#n;
            }
        }
        return new o(t, e, n, r, s);
    }
    function pJe(t, e) {
        return Be(t, (n)=>et([
                e.rpc.chain.getBlock(n),
                e.queryAt(n)
            ]).pipe(it(([r, s])=>et([
                    Te(r),
                    s.system.events(),
                    nP(e, r.block.header, n)
                ])), ve(([r, s, [, i, o]])=>fJe(s.registry, r, s, i, o))));
    }
    function hJe(t, e) {
        return Be(t, (n)=>e.rpc.chain.getBlockHash(n).pipe(it((r)=>e.derive.chain.getBlock(r))));
    }
    function gJe(t, e) {
        return Be(t, (n)=>e.rpc.chain.getHeader(n).pipe(it((r)=>nP(e, r, n)), ve(([r, s, i])=>JY((s || r).registry, r, s, i))));
    }
    function bJe(t, e) {
        return Be(t, ()=>e.derive.chain.subscribeFinalizedHeads().pipe(Uc((n)=>e.derive.chain.getBlock(n.createdAtHash || n.hash))));
    }
    function mJe(t, e) {
        return Be(t, (n, r, s = [])=>e.rpc.chain.getHeader(n).pipe(it((i)=>i.parentHash.eq(r) ? Te([
                    i,
                    ...s
                ]) : e.derive.chain._getHeaderRange(i.parentHash, r, [
                    i,
                    ...s
                ]))));
    }
    function yJe(t, e) {
        return Be(t, ()=>{
            let n = null;
            return e.rpc.chain.subscribeFinalizedHeads().pipe(Uc((r)=>{
                const s = n, i = r.parentHash;
                return n = r.createdAtHash = r.hash, s === null || i.eq(s) ? Te(r) : e.derive.chain._getHeaderRange(i, s, [
                    r
                ]).pipe(it((o)=>Tc(o)));
            }));
        });
    }
    function wJe(t, e) {
        return Be(t, ()=>e.derive.chain.subscribeNewHeads().pipe(Uc((n)=>e.derive.chain.getBlock(n.createdAtHash || n.hash))));
    }
    function _Je(t, e) {
        return Be(t, ()=>e.rpc.chain.subscribeNewHeads().pipe(Uc((n)=>nP(e, n)), ve(([n, r, s])=>(n.createdAtHash = n.hash, JY(n.registry, n, r, s)))));
    }
    const xJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _getHeaderRange: mJe,
        bestNumber: cJe,
        bestNumberFinalized: lJe,
        bestNumberLag: uJe,
        getBlock: pJe,
        getBlockByNumber: hJe,
        getHeader: gJe,
        subscribeFinalizedBlocks: bJe,
        subscribeFinalizedHeads: yJe,
        subscribeNewBlocks: wJe,
        subscribeNewHeads: _Je
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function vJe(t) {
        return Te([
            t.consts.contracts.callBaseFee || t.registry.createType("Balance"),
            t.consts.contracts.contractFee || t.registry.createType("Balance"),
            t.consts.contracts.creationFee || t.registry.createType("Balance"),
            t.consts.contracts.transactionBaseFee || t.registry.createType("Balance"),
            t.consts.contracts.transactionByteFee || t.registry.createType("Balance"),
            t.consts.contracts.transferFee || t.registry.createType("Balance"),
            t.consts.contracts.rentByteFee || t.registry.createType("Balance"),
            t.consts.contracts.rentDepositOffset || t.registry.createType("Balance"),
            t.consts.contracts.surchargeReward || t.registry.createType("Balance"),
            t.consts.contracts.tombstoneDeposit || t.registry.createType("Balance")
        ]);
    }
    function SJe(t, e) {
        return Be(t, ()=>vJe(e).pipe(ve(([n, r, s, i, o, a, c, l, u, d])=>({
                    callBaseFee: n,
                    contractFee: r,
                    creationFee: s,
                    rentByteFee: c,
                    rentDepositOffset: l,
                    surchargeReward: u,
                    tombstoneDeposit: d,
                    transactionBaseFee: i,
                    transactionByteFee: o,
                    transferFee: a
                }))));
    }
    const kJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        fees: SJe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function TJe(t) {
        return !Array.isArray(t);
    }
    function CJe(t) {
        return t.stakeOf.entries().pipe(ve((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    r
                ])));
    }
    function EJe(t) {
        return t.votesOf.entries().pipe(ve((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    r
                ])));
    }
    function IJe(t, e) {
        return et([
            CJe(e),
            EJe(e)
        ]).pipe(ve(([n, r])=>{
            const s = [];
            return r.forEach(([i, o])=>{
                s.push([
                    i,
                    {
                        stake: t.registry.createType("Balance"),
                        votes: o
                    }
                ]);
            }), n.forEach(([i, o])=>{
                const a = s.find(([c])=>c.eq(i));
                a ? a[1].stake = o : s.push([
                    i,
                    {
                        stake: o,
                        votes: []
                    }
                ]);
            }), s;
        }));
    }
    function AJe(t) {
        return t.voting.entries().pipe(ve((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    TJe(r) ? {
                        stake: r.stake,
                        votes: r.votes
                    } : {
                        stake: r[0],
                        votes: r[1]
                    }
                ])));
    }
    function PJe(t, e) {
        const n = e.query.elections || e.query.phragmenElection || e.query.electionsPhragmen;
        return Be(t, ()=>n ? n.stakeOf ? IJe(e, n) : AJe(n) : Te([]));
    }
    function OJe(t, e) {
        return Be(t, (n)=>e.derive.council.votes().pipe(ve((r)=>(r.find(([s])=>s.eq(n)) || [
                    null,
                    {
                        stake: e.registry.createType("Balance"),
                        votes: []
                    }
                ])[1])));
    }
    const MJe = s9("council"), RJe = o9("council"), NJe = c9("council"), VJe = l9("council"), DJe = u9("council"), BJe = a9("council"), FJe = i9("council"), LJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: RJe,
        members: MJe,
        prime: FJe,
        proposal: NJe,
        proposalCount: VJe,
        proposalHashes: DJe,
        proposals: BJe,
        votes: PJe,
        votesOf: OJe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function zJe(t) {
        return nn(Ai(":child_storage:default:", Gl(Ai("crowdloan", (t.fundIndex || t.trieIndex).toU8a()))));
    }
    function UJe(t, e) {
        return Be(t, (n)=>e.query.crowdloan.funds(n).pipe(ve((r)=>r.isSome ? zJe(r.unwrap()) : null)));
    }
    function YY(t, e) {
        const n = [], r = [];
        return e.filter(({ event: { data: [, s], method: i, section: o } })=>o === "crowdloan" && [
                "Contributed",
                "Withdrew"
            ].includes(i) && s.eq(t)).reduce((s, { event: { data: [i], method: o } })=>(o === "Contributed" ? s.added.push(i.toHex()) : s.removed.push(i.toHex()), s), {
            added: n,
            blockHash: e.createdAtHash?.toHex() || "-",
            removed: r
        });
    }
    const DS = 1e3;
    function HJe(t, e) {
        let n = [], r = [];
        return t.query.system.events().pipe(it((s)=>{
            const i = YY(e, s);
            return i.added.length || i.removed.length ? (n = n.concat(...i.added), r = r.concat(...i.removed), Te({
                added: n,
                addedDelta: i.added,
                blockHash: s.createdAtHash?.toHex() || "-",
                removed: r,
                removedDelta: i.removed
            })) : N1;
        }), V1({
            added: n,
            addedDelta: [],
            blockHash: "-",
            removed: r,
            removedDelta: []
        }));
    }
    function jJe(t, e) {
        return t.query.system.events().pipe(it((n)=>n.filter(({ event: { data: [s], method: i, section: o } })=>o === "crowdloan" && [
                    "AllRefunded",
                    "Dissolved",
                    "PartiallyRefunded"
                ].includes(i) && s.eq(e)).length ? Te(n.createdAtHash?.toHex() || "-") : N1), V1("-"));
    }
    function qJe(t, e) {
        const n = new Sy(void 0);
        return n.pipe(it((r)=>t.rpc.childstate.getKeysPaged(e, "0x", DS, r)), Nd((r)=>{
            kp(()=>{
                r.length === DS ? n.next(r[DS - 1].toHex()) : n.complete();
            });
        }), z3(), ve((r)=>Qh(r)));
    }
    function WJe(t, e, n) {
        return jJe(t, e).pipe(it(()=>Mt(t.rpc.childstate.getKeysPaged) ? qJe(t, n) : t.rpc.childstate.getKeys(n, "0x")), ve((r)=>r.map((s)=>s.toHex())));
    }
    function KJe(t, e, n) {
        return et([
            WJe(t, e, n),
            HJe(t, e)
        ]).pipe(ve(([r, { added: s, blockHash: i, removed: o }])=>{
            const a = {};
            return r.forEach((c)=>{
                a[c] = !0;
            }), s.forEach((c)=>{
                a[c] = !0;
            }), o.forEach((c)=>{
                delete a[c];
            }), {
                blockHash: i,
                contributorsHex: Object.keys(a)
            };
        }));
    }
    function $Je(t, e) {
        return Be(t, (n)=>e.derive.crowdloan.childKey(n).pipe(it((r)=>r ? KJe(e, n, r) : Te({
                    blockHash: "-",
                    contributorsHex: []
                }))));
    }
    function QY(t, e, n) {
        return et(n.map((r)=>t.rpc.childstate.getStorage(e, r))).pipe(ve((r)=>r.map((s)=>t.registry.createType("Option<StorageData>", s)).map((s)=>s.isSome ? t.registry.createType("Balance", s.unwrap()) : t.registry.createType("Balance")).reduce((s, i, o)=>Ye(s, {
                    [n[o]]: i
                }), {})));
    }
    function XJe(t, e, n, r) {
        return t.query.system.events().pipe(it((s)=>{
            const i = YY(e, s), o = r.filter((a)=>i.added.includes(a) || i.removed.includes(a));
            return o.length ? QY(t, n, o) : N1;
        }), V1({}));
    }
    function GJe(t, e, n, r) {
        return et([
            QY(t, n, r),
            XJe(t, e, n, r)
        ]).pipe(ve(([s, i])=>Ye({}, s, i)));
    }
    function ZJe(t, e) {
        return Be(t, (n, r)=>e.derive.crowdloan.childKey(n).pipe(it((s)=>s && r.length ? GJe(e, n, s, r) : Te({}))));
    }
    const JJe = Object.freeze(Object.defineProperty({
        __proto__: null,
        childKey: UJe,
        contributions: $Je,
        ownContributions: ZJe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function YJe(t) {
        return !!t.proposalHash;
    }
    function QJe(t) {
        return !!t.tally;
    }
    function VB(t, e, n, r) {
        for(;;){
            const s = t.div(e), i = n.div(r);
            if (s.lt(i)) return !0;
            if (i.lt(s)) return !1;
            const o = t.mod(e), a = n.mod(r);
            if (a.isZero()) return !1;
            if (o.isZero()) return !0;
            t = r, n = e, e = a, r = o;
        }
    }
    function eYe(t, e, { votedAye: n, votedNay: r, votedTotal: s }) {
        const i = rJ(s);
        return i.isZero() ? !1 : t.isSuperMajorityApprove ? VB(r, i, n, e) : VB(r, e, n, i);
    }
    function tYe(t, e, n) {
        return t.isSimpleMajority ? n.votedAye.gt(n.votedNay) : eYe(t, e, n);
    }
    function nYe(t) {
        return t.reduce((e, n)=>{
            const { balance: r, vote: s } = n, i = s.conviction.index === 0, o = r.muln(i ? 1 : s.conviction.index).divn(i ? 10 : 1);
            return s.isAye ? (e.allAye.push(n), e.voteCountAye++, e.votedAye.iadd(o)) : (e.allNay.push(n), e.voteCountNay++, e.votedNay.iadd(o)), e.voteCount++, e.votedTotal.iadd(o), e;
        }, {
            allAye: [],
            allNay: [],
            voteCount: 0,
            voteCountAye: 0,
            voteCountNay: 0,
            votedAye: new ht(0),
            votedNay: new ht(0),
            votedTotal: new ht(0)
        });
    }
    function rYe(t, e) {
        const n = [], r = [];
        return e.forEach((s)=>{
            s.vote.isAye ? n.push(s) : r.push(s);
        }), {
            allAye: n,
            allNay: r,
            voteCount: n.length + r.length,
            voteCountAye: n.length,
            voteCountNay: r.length,
            votedAye: t.ayes,
            votedNay: t.nays,
            votedTotal: t.turnout
        };
    }
    function sYe(t, e, n) {
        const r = QJe(e.status) ? rYe(e.status.tally, n) : nYe(n);
        return Ye({}, r, {
            isPassing: tYe(e.status.threshold, t, r),
            votes: n
        });
    }
    function iYe(t) {
        if (t.isNone) return null;
        const e = t.unwrap();
        return YJe(e) ? e : e.isOngoing ? e.asOngoing : null;
    }
    function Yp(t) {
        return t.isLegacy ? t.asLegacy.hash_.toHex() : t.isLookup ? t.asLookup.hash_.toHex() : t.isInline ? t.asInline.hash.toHex() : br(t) ? Fn(t) ? t : dJ(t) : Bt(t) ? nn(t) : t.toHex();
    }
    function oYe(t) {
        return Yp(t.proposal || t.proposalHash);
    }
    const aYe = dJ("democrac");
    function cYe(t) {
        return t instanceof fa;
    }
    function lYe(t) {
        return t.isInline || t.isLegacy || t.isLookup;
    }
    function uYe(t) {
        return t.query.democracy.dispatchQueue().pipe(it((e)=>et([
                Te(e),
                t.derive.democracy.preimages(e.map(([, n])=>n))
            ])), ve(([e, n])=>e.map(([r, s, i], o)=>({
                    at: r,
                    image: n[o],
                    imageHash: Yp(s),
                    index: i
                }))));
    }
    function dYe(t) {
        return t.derive.democracy.referendumsFinished().pipe(it(()=>t.query.scheduler.agenda.keys()), it((e)=>{
            const n = e.map(({ args: [r] })=>r);
            return n.length ? et([
                Te(n),
                t.query.scheduler.agenda.multi(n).pipe(cu(()=>Te(n.map(()=>[]))))
            ]) : Te([
                [],
                []
            ]);
        }));
    }
    function fYe(t) {
        return dYe(t).pipe(it(([e, n])=>{
            const r = [];
            return e.forEach((s, i)=>{
                (n[i] || []).filter((o)=>o.isSome).forEach((o)=>{
                    const a = o.unwrap();
                    if (a.maybeId.isSome) {
                        const c = a.maybeId.unwrap().toHex();
                        if (c.startsWith(aYe)) {
                            const l = cYe(a.call) ? lYe(a.call) ? Yp(a.call) : a.call.isHash ? a.call.asHash.toHex() : a.call.asValue.args[0].toHex() : a.call.args[0].toHex();
                            r.push({
                                at: s,
                                imageHash: l,
                                index: t.registry.createType("(u64, ReferendumIndex)", c)[1]
                            });
                        }
                    }
                });
            }), et([
                Te(r),
                r.length ? t.derive.democracy.preimages(r.map(({ imageHash: s })=>s)) : Te([])
            ]);
        }), ve(([e, n])=>e.map((r, s)=>Ye({
                    image: n[s]
                }, r))));
    }
    function pYe(t, e) {
        return Be(t, ()=>Mt(e.query.scheduler?.agenda) ? fYe(e) : e.query.democracy.dispatchQueue ? uYe(e) : Te([]));
    }
    const eQ = [
        0,
        1,
        2,
        4,
        8,
        16,
        32
    ];
    function hYe(t, e, { approved: n, end: r }) {
        return [
            r,
            n.isTrue && e.isAye || n.isFalse && e.isNay ? r.add((t.consts.democracy.voteLockingPeriod || t.consts.democracy.enactmentPeriod).muln(eQ[e.conviction.index])) : ss
        ];
    }
    function gYe(t, [e, n], r) {
        const { balance: s, vote: i } = n.asStandard, [o, a] = r.isFinished ? hYe(t, i, r.asFinished) : [
            ss,
            ss
        ];
        return {
            balance: s,
            isDelegated: !1,
            isFinished: r.isFinished,
            referendumEnd: o,
            referendumId: e,
            unlockAt: a,
            vote: i
        };
    }
    function bYe(t, { balance: e, conviction: n, target: r }) {
        return t.derive.democracy.locks(r).pipe(ve((s)=>s.map(({ isFinished: i, referendumEnd: o, referendumId: a, unlockAt: c, vote: l })=>({
                    balance: e,
                    isDelegated: !0,
                    isFinished: i,
                    referendumEnd: o,
                    referendumId: a,
                    unlockAt: c.isZero() ? c : o.add((t.consts.democracy.voteLockingPeriod || t.consts.democracy.enactmentPeriod).muln(eQ[n.index])),
                    vote: t.registry.createType("Vote", {
                        aye: l.isAye,
                        conviction: n
                    })
                }))));
    }
    function mYe(t, { votes: e }) {
        return e.length ? t.query.democracy.referendumInfoOf.multi(e.map(([n])=>n)).pipe(ve((n)=>e.map((r, s)=>[
                    r,
                    n[s].unwrapOr(null)
                ]).filter((r)=>!!r[1] && Rr(r[1].end) && r[0][1].isStandard).map(([r, s])=>gYe(t, r, s)))) : Te([]);
    }
    function yYe(t, e) {
        return Be(t, (n)=>e.query.democracy.votingOf ? e.query.democracy.votingOf(n).pipe(it((r)=>r.isDirect ? mYe(e, r.asDirect) : r.isDelegating ? bYe(e, r.asDelegating) : Te([]))) : Te([]));
    }
    function wYe(t, e) {
        if (e.isNone) return Te(null);
        const [n, r] = e.unwrap();
        return t.derive.democracy.preimage(n).pipe(ve((s)=>({
                image: s,
                imageHash: Yp(n),
                threshold: r
            })));
    }
    function _Ye(t, e) {
        return Be(t, ()=>e.query.democracy?.nextExternal ? e.query.democracy.nextExternal().pipe(it((n)=>wYe(e, n))) : Te(null));
    }
    function xYe(t) {
        return t.ticket || t.deposit;
    }
    function vYe(t) {
        return (t.maybeTicket || t.deposit).unwrapOrDefault();
    }
    function SYe(t, e) {
        return !!e && !t.query.democracy.dispatchQueue;
    }
    function DB(t, [e, n, r, s]) {
        let i;
        try {
            i = t.registry.createType("Call", e.toU8a(!0));
        } catch (o) {
            console.error(o);
        }
        return {
            at: s,
            balance: r,
            proposal: i,
            proposer: n
        };
    }
    function kYe(t, e) {
        if (!e.isNone) {
            if (SYe(t, e)) {
                const n = e.unwrap();
                if (n.isMissing) return;
                const { data: r, deposit: s, provider: i, since: o } = n.asAvailable;
                return DB(t, [
                    r,
                    i,
                    s,
                    o
                ]);
            }
            return DB(t, e.unwrap());
        }
    }
    function TYe(t, [e, n, r]) {
        if (!n) return;
        const [s, i] = n.isUnrequested ? xYe(n.asUnrequested) : vYe(n.asRequested);
        let o;
        if (r) try {
            o = t.registry.createType("Call", r.toU8a(!0));
        } catch (a) {
            console.error(a);
        }
        return {
            at: ss,
            balance: i,
            proposal: o,
            proposalHash: e,
            proposer: s
        };
    }
    function CYe(t, e) {
        const n = e.map((r)=>Yp(r));
        return t.query.democracy.preimages.multi(n).pipe(ve((r)=>r.map((s)=>kYe(t, s))));
    }
    function EYe(t, e) {
        const n = e.map((s)=>Yp(s)), r = t.registry.lookup.getTypeDef(t.query.preimage.preimageFor.creator.meta.type.asMap.key).type;
        return t.query.preimage.statusFor.multi(n).pipe(it((s)=>{
            const i = s.map((a)=>a.unwrapOr(null)), o = i.map((a, c)=>a ? r === "H256" ? n[c] : a.isRequested ? [
                    n[c],
                    a.asRequested.len.unwrapOr(0)
                ] : [
                    n[c],
                    a.asUnrequested.len
                ] : null).filter((a)=>!!a);
            return t.query.preimage.preimageFor.multi(o).pipe(ve((a)=>{
                let c = -1;
                return i.map((l, u)=>l ? [
                        n[u],
                        l,
                        a[++c].unwrapOr(null)
                    ] : [
                        n[u],
                        null,
                        null
                    ]).map((l)=>TYe(t, l));
            }));
        }));
    }
    function IYe(t, e) {
        return Be(t, (n)=>n.length ? Mt(e.query.democracy.preimages) ? CYe(e, n) : Mt(e.query.preimage.preimageFor) ? EYe(e, n) : Te([]) : Te([]));
    }
    const AYe = Cu((t, e)=>t.derive.democracy.preimages([
            e
        ]));
    function PYe(t) {
        return Mt(t[1].mul);
    }
    function OYe([t, e, n]) {
        return t.filter(([, , r], s)=>!!n[s]?.isSome && !r.isEmpty).map(([r, s, i], o)=>{
            const a = n[o].unwrap();
            return Ye({
                image: e[o],
                imageHash: Yp(s),
                index: r,
                proposer: i
            }, PYe(a) ? {
                balance: a[1],
                seconds: a[0]
            } : {
                balance: a[0],
                seconds: a[1]
            });
        });
    }
    function MYe(t, e) {
        return Be(t, ()=>Mt(e.query.democracy?.publicProps) ? e.query.democracy.publicProps().pipe(it((n)=>n.length ? et([
                    Te(n),
                    e.derive.democracy.preimages(n.map(([, r])=>r)),
                    e.query.democracy.depositOf.multi(n.map(([r])=>r))
                ]) : Te([
                    [],
                    [],
                    []
                ])), ve(OYe)) : Te([]));
    }
    function RYe(t, e) {
        return Be(t, ()=>e.query.democracy?.lowestUnbaked ? e.queryMulti([
                e.query.democracy.lowestUnbaked,
                e.query.democracy.referendumCount
            ]).pipe(ve(([n, r])=>r.gt(n) ? [
                    ...Array(r.sub(n).toNumber())
                ].map((s, i)=>n.addn(i)) : [])) : Te([]));
    }
    function NYe(t, e) {
        return Be(t, ()=>e.derive.democracy.referendumsActive().pipe(it((n)=>n.length ? et([
                    Te(n),
                    e.derive.democracy._referendumsVotes(n)
                ]) : Te([
                    [],
                    []
                ])), ve(([n, r])=>n.map((s, i)=>Ye({}, s, r[i])))));
    }
    function VYe(t, e) {
        return Be(t, ()=>e.derive.democracy.referendumIds().pipe(it((n)=>n.length ? e.derive.democracy.referendumsInfo(n) : Te([]))));
    }
    function DYe(t, e) {
        return Be(t, ()=>e.derive.democracy.referendumIds().pipe(it((n)=>e.query.democracy.referendumInfoOf.multi(n)), ve((n)=>n.map((r)=>r.unwrapOr(null)).filter((r)=>!!r && r.isFinished).map((r)=>r.asFinished))));
    }
    function BYe(t, e) {
        return t.query.democracy.votersFor(e).pipe(it((n)=>et([
                Te(n),
                n.length ? t.query.democracy.voteOf.multi(n.map((r)=>[
                        e,
                        r
                    ])) : Te([]),
                t.derive.balances.votingBalances(n)
            ])), ve(([n, r, s])=>n.map((i, o)=>({
                    accountId: i,
                    balance: s[o].votingBalance || t.registry.createType("Balance"),
                    isDelegating: !1,
                    vote: r[o] || t.registry.createType("Vote")
                }))));
    }
    function FYe(t, e) {
        return t.filter(([, n])=>n.isDirect).map(([n, r])=>[
                n,
                r.asDirect.votes.filter(([s])=>s.eq(e))
            ]).filter(([, n])=>!!n.length).reduce((n, [r, s])=>s.reduce((i, [, o])=>(o.isStandard && i.push(Ye({
                    accountId: r,
                    isDelegating: !1
                }, o.asStandard)), i), n), []);
    }
    function LYe(t, e) {
        return t.query.democracy.votingOf.entries().pipe(ve((n)=>{
            const r = n.map(([{ args: [o] }, a])=>[
                    o,
                    a
                ]), s = FYe(r, e), i = r.filter(([, o])=>o.isDelegating).map(([o, a])=>[
                    o,
                    a.asDelegating
                ]);
            return i.forEach(([o, { balance: a, conviction: c, target: l }])=>{
                const u = i.find(([f])=>f.eq(l)), d = s.find(({ accountId: f })=>f.eq(u ? u[0] : l));
                d && s.push({
                    accountId: o,
                    balance: a,
                    isDelegating: !0,
                    vote: t.registry.createType("Vote", {
                        aye: d.vote.isAye,
                        conviction: c
                    })
                });
            }), s;
        }));
    }
    function zYe(t, e) {
        return Be(t, (n)=>et([
                e.derive.democracy.sqrtElectorate(),
                Mt(e.query.democracy.votingOf) ? LYe(e, n.index) : BYe(e, n.index)
            ]).pipe(ve(([r, s])=>sYe(r, n, s))));
    }
    function UYe(t, e) {
        return Be(t, (n)=>n.length ? et(n.map((r)=>e.derive.democracy._referendumVotes(r))) : Te([]));
    }
    function HYe(t, e) {
        return Be(t, (n, r)=>{
            const s = iYe(r);
            return s ? e.derive.democracy.preimage(s.proposal || s.proposalHash).pipe(ve((i)=>({
                    image: i,
                    imageHash: oYe(s),
                    index: e.registry.createType("ReferendumIndex", n),
                    status: s
                }))) : Te(null);
        });
    }
    function jYe(t, e) {
        return Be(t, (n)=>n.length ? e.query.democracy.referendumInfoOf.multi(n).pipe(it((r)=>et(n.map((s, i)=>e.derive.democracy._referendumInfo(s, r[i])))), ve((r)=>r.filter((s)=>!!s))) : Te([]));
    }
    function qYe(t, e) {
        return Be(t, ()=>e.query.balances.totalIssuance().pipe(ve(rJ)));
    }
    const WYe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _referendumInfo: HYe,
        _referendumVotes: zYe,
        _referendumsVotes: UYe,
        dispatchQueue: pYe,
        locks: yYe,
        nextExternal: _Ye,
        preimage: AYe,
        preimages: IYe,
        proposals: MYe,
        referendumIds: RYe,
        referendums: NYe,
        referendumsActive: VYe,
        referendumsFinished: DYe,
        referendumsInfo: jYe,
        sqrtElectorate: qYe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function KYe(t) {
        return !Array.isArray(t);
    }
    function $Ye(t) {
        return Array.isArray(t);
    }
    function BB(t) {
        return KYe(t) ? [
            t.who,
            t.stake
        ] : t;
    }
    function XYe(t) {
        return $Ye(t) ? t[0] : t;
    }
    function FB([, t], [, e]) {
        return e.cmp(t);
    }
    function GYe(t, e) {
        return e ? {
            candidacyBond: t.consts[e].candidacyBond,
            desiredRunnersUp: t.consts[e].desiredRunnersUp,
            desiredSeats: t.consts[e].desiredMembers,
            termDuration: t.consts[e].termDuration,
            votingBond: t.consts[e].votingBond,
            votingBondBase: t.consts[e].votingBondBase,
            votingBondFactor: t.consts[e].votingBondFactor
        } : {};
    }
    function ZYe(t) {
        const [e] = t.registry.getModuleInstances(t.runtimeVersion.specName, "council") || [
            "council"
        ], n = t.query.phragmenElection ? "phragmenElection" : t.query.electionsPhragmen ? "electionsPhragmen" : t.query.elections ? "elections" : null;
        return [
            t.query[e] ? e : "council",
            n
        ];
    }
    function JYe(t, e, n) {
        return t.queryMulti([
            t.query[e].members,
            t.query[n].candidates,
            t.query[n].members,
            t.query[n].runnersUp
        ]);
    }
    function YYe(t, e) {
        return et([
            t.query[e].members(),
            Te([]),
            Te([]),
            Te([])
        ]);
    }
    function QYe(t, e) {
        return Be(t, ()=>{
            const [n, r] = ZYe(e);
            return (r ? JYe(e, n, r) : YYe(e, n)).pipe(ve(([s, i, o, a])=>Ye({}, GYe(e, r), {
                    candidateCount: e.registry.createType("u32", i.length),
                    candidates: i.map(XYe),
                    members: o.length ? o.map(BB).sort(FB) : s.map((c)=>[
                            c,
                            e.registry.createType("Balance")
                        ]),
                    runnersUp: a.map(BB).sort(FB)
                })));
        });
    }
    const eQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        info: QYe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function tQe([t, e, n, r]) {
        return e.forEach((s, i)=>{
            const o = s.toString(), a = r[i], c = !n[i].isEmpty, l = t[o];
            (!l || l.hasMessage !== c || !l.blockCount.eq(a)) && (t[o] = {
                blockCount: a,
                hasMessage: c,
                isOnline: c || a.gt(ss)
            });
        }), t;
    }
    function nQe(t, e) {
        return Be(t, ()=>e.query.imOnline?.receivedHeartbeats ? e.derive.staking.overview().pipe(it(({ currentIndex: n, validators: r })=>et([
                    Te({}),
                    Te(r),
                    e.query.imOnline.receivedHeartbeats.multi(r.map((s, i)=>[
                            n,
                            i
                        ])),
                    e.query.imOnline.authoredBlocks.multi(r.map((s)=>[
                            n,
                            s
                        ]))
                ])), ve(tQe)) : Te({}));
    }
    const rQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        receivedHeartbeats: nQe
    }, Symbol.toStringTag, {
        value: "Module"
    })), sQe = s9("membership"), iQe = o9("membership"), oQe = c9("membership"), aQe = l9("membership"), cQe = u9("membership"), lQe = a9("membership"), uQe = i9("membership"), dQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: iQe,
        members: sQe,
        prime: uQe,
        proposal: oQe,
        proposalCount: aQe,
        proposalHashes: cQe,
        proposals: lQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function tQ(t, e) {
        return t.isSome ? t.unwrap().some((n)=>n.eq(e)) : !1;
    }
    function fQe(t, e) {
        const n = e.find(([r])=>r === t);
        if (n && n[1].isSome) {
            const [r, s] = n[1].unwrap();
            return Ye({
                collatorId: r
            }, s.isWithRetries ? {
                isRetriable: !0,
                retries: s.asWithRetries.toNumber()
            } : {
                isRetriable: !1,
                retries: 0
            });
        }
        return null;
    }
    function LB(t, e) {
        return e.map((n)=>{
            const r = n.find(([s])=>s === t);
            return r ? r[1] : null;
        });
    }
    function pQe(t, [e, n, r, s, i, o, a, c]) {
        return i.isNone ? null : {
            active: fQe(t, e),
            didUpdate: tQ(s, t),
            heads: a,
            id: t,
            info: Ye({
                id: t
            }, i.unwrap()),
            pendingSwapId: o.unwrapOr(null),
            relayDispatchQueue: c,
            retryCollators: LB(t, n),
            selectedCollators: LB(t, r)
        };
    }
    function hQe(t, e) {
        return Be(t, (n)=>e.query.registrar && e.query.parachains ? e.queryMulti([
                e.query.registrar.active,
                e.query.registrar.retryQueue,
                e.query.registrar.selectedThreads,
                e.query.parachains.didUpdate,
                [
                    e.query.registrar.paras,
                    n
                ],
                [
                    e.query.registrar.pendingSwap,
                    n
                ],
                [
                    e.query.parachains.heads,
                    n
                ],
                [
                    e.query.parachains.relayDispatchQueue,
                    n
                ]
            ]).pipe(ve((r)=>pQe(e.registry.createType("ParaId", n), r))) : Te(null));
    }
    function gQe([t, e, n, r, s]) {
        return t.map((i, o)=>({
                didUpdate: tQ(e, i),
                id: i,
                info: Ye({
                    id: i
                }, r[o].unwrapOr(null)),
                pendingSwapId: s[o].unwrapOr(null),
                relayDispatchQueueSize: n[o][0].toNumber()
            }));
    }
    function bQe(t, e) {
        return Be(t, ()=>e.query.registrar?.parachains && e.query.parachains ? e.query.registrar.parachains().pipe(it((n)=>et([
                    Te(n),
                    e.query.parachains.didUpdate(),
                    e.query.parachains.relayDispatchQueueSize.multi(n),
                    e.query.registrar.paras.multi(n),
                    e.query.registrar.pendingSwap.multi(n)
                ])), ve(gQe)) : Te([]));
    }
    const mQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        info: hQe,
        overview: bQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function rP([t, e, n, r, s]) {
        return {
            activeEra: e,
            activeEraStart: n,
            currentEra: r,
            currentIndex: t,
            validatorCount: s
        };
    }
    function yQe(t) {
        return t.queryMulti([
            t.query.session.currentIndex,
            t.query.staking.activeEra,
            t.query.staking.currentEra,
            t.query.staking.validatorCount
        ]).pipe(ve(([e, n, r, s])=>{
            const { index: i, start: o } = n.unwrapOrDefault();
            return rP([
                e,
                i,
                o,
                r.unwrapOrDefault(),
                s
            ]);
        }));
    }
    function wQe(t) {
        return t.query.session.currentIndex().pipe(ve((e)=>rP([
                e,
                t.registry.createType("EraIndex"),
                t.registry.createType("Option<Moment>"),
                t.registry.createType("EraIndex"),
                t.registry.createType("u32")
            ])));
    }
    function _Qe(t) {
        return Te(rP([
            t.registry.createType("SessionIndex", 1),
            t.registry.createType("EraIndex"),
            t.registry.createType("Option<Moment>"),
            t.registry.createType("EraIndex"),
            t.registry.createType("u32")
        ]));
    }
    function xQe(t, e) {
        return Be(t, ()=>e.query.session ? e.query.staking ? yQe(e) : wQe(e) : _Qe(e));
    }
    function vQe(t, e) {
        return Be(t, ()=>e.derive.session.indexes().pipe(ve((n)=>{
                const r = e.consts?.babe?.epochDuration || e.registry.createType("u64", 1), s = e.consts?.staking?.sessionsPerEra || e.registry.createType("SessionIndex", 1);
                return Ye({
                    eraLength: e.registry.createType("BlockNumber", s.mul(r)),
                    isEpoch: !!e.query.babe,
                    sessionLength: r,
                    sessionsPerEra: s
                }, n);
            })));
    }
    function sP(t) {
        return (e, n)=>Be(e, ()=>n.derive.session.progress().pipe(ve((r)=>r[t])));
    }
    function SQe(t, e, [n, r, s, i]) {
        const o = r.mul(e.sessionLength).iadd(s), a = n.sub(o), c = e.currentIndex.sub(i).imul(e.sessionLength).iadd(a);
        return Ye({
            eraProgress: t.registry.createType("BlockNumber", c),
            sessionProgress: t.registry.createType("BlockNumber", a)
        }, e);
    }
    function kQe(t) {
        return t.derive.session.info().pipe(ve((e)=>Ye({
                eraProgress: t.registry.createType("BlockNumber"),
                sessionProgress: t.registry.createType("BlockNumber")
            }, e)));
    }
    function TQe(t) {
        return t.derive.session.info().pipe(it((e)=>et([
                Te(e),
                t.query.staking?.erasStartSessionIndex ? t.queryMulti([
                    t.query.babe.currentSlot,
                    t.query.babe.epochIndex,
                    t.query.babe.genesisSlot,
                    [
                        t.query.staking.erasStartSessionIndex,
                        e.activeEra
                    ]
                ]) : t.queryMulti([
                    t.query.babe.currentSlot,
                    t.query.babe.epochIndex,
                    t.query.babe.genesisSlot
                ])
            ])), ve(([e, [n, r, s, i]])=>[
                e,
                [
                    n,
                    r,
                    s,
                    i && i.isSome ? i.unwrap() : t.registry.createType("SessionIndex", 1)
                ]
            ]));
    }
    function CQe(t, e) {
        return Be(t, ()=>e.query.babe ? TQe(e).pipe(ve(([n, r])=>SQe(e, n, r))) : kQe(e));
    }
    const EQe = sP("eraLength"), IQe = sP("eraProgress"), AQe = sP("sessionProgress"), PQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        eraLength: EQe,
        eraProgress: IQe,
        indexes: xQe,
        info: vQe,
        progress: CQe,
        sessionProgress: AQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function OQe(t) {
        return t.query.society.candidates().pipe(it((e)=>et([
                Te(e),
                t.query.society.suspendedCandidates.multi(e.map(({ who: n })=>n))
            ])), ve(([e, n])=>e.map(({ kind: r, value: s, who: i }, o)=>({
                    accountId: i,
                    isSuspended: n[o].isSome,
                    kind: r,
                    value: s
                }))));
    }
    function MQe(t) {
        return t.query.society.candidates.entries().pipe(ve((e)=>e.filter(([, n])=>n.isSome).map(([{ args: [n] }, r])=>[
                    n,
                    r.unwrap()
                ]).map(([n, { bid: r, kind: s }])=>({
                    accountId: n,
                    isSuspended: !1,
                    kind: s,
                    value: r
                }))));
    }
    function RQe(t, e) {
        return Be(t, ()=>e.query.society.suspendedCandidates && e.query.society.candidates.creator.meta.type.isPlain ? OQe(e) : MQe(e));
    }
    function NQe(t, e) {
        return Be(t, ()=>et([
                e.query.society.bids(),
                e.query.society.defender ? e.query.society.defender() : Te(void 0),
                e.query.society.founder(),
                e.query.society.head(),
                e.query.society.maxMembers ? e.query.society.maxMembers() : Te(void 0),
                e.query.society.pot()
            ]).pipe(ve(([n, r, s, i, o, a])=>({
                    bids: n,
                    defender: r?.unwrapOr(void 0),
                    founder: s.unwrapOr(void 0),
                    hasDefender: r?.isSome && i.isSome && !i.eq(r) || !1,
                    head: i.unwrapOr(void 0),
                    maxMembers: o,
                    pot: a
                }))));
    }
    function VQe(t, e) {
        return Be(t, (n)=>e.derive.society._members([
                n
            ]).pipe(ve(([r])=>r)));
    }
    function DQe(t, e) {
        return et([
            Te(e),
            t.query.society.payouts.multi(e),
            t.query.society.strikes.multi(e),
            t.query.society.defenderVotes.multi(e),
            t.query.society.suspendedMembers.multi(e),
            t.query.society.vouching.multi(e)
        ]).pipe(ve(([n, r, s, i, o, a])=>n.map((c, l)=>({
                    accountId: c,
                    isDefenderVoter: i[l].isSome,
                    isSuspended: o[l].isTrue,
                    payouts: r[l],
                    strikes: s[l],
                    vote: i[l].unwrapOr(void 0),
                    vouching: a[l].unwrapOr(void 0)
                }))));
    }
    function BQe(t, e) {
        return et([
            Te(e),
            t.query.society.members.multi(e),
            t.query.society.payouts.multi(e),
            t.query.society.challengeRoundCount().pipe(it((n)=>t.query.society.defenderVotes.multi(e.map((r)=>[
                        n,
                        r
                    ])))),
            t.query.society.suspendedMembers.multi(e)
        ]).pipe(ve(([n, r, s, i, o])=>n.map((a, c)=>r[c].isSome ? {
                    accountId: a,
                    isDefenderVoter: i[c].isSome,
                    isSuspended: o[c].isSome,
                    member: r[c].unwrap(),
                    payouts: s[c].payouts
                } : null).filter((a)=>!!a).map(({ accountId: a, isDefenderVoter: c, isSuspended: l, member: u, payouts: d })=>({
                    accountId: a,
                    isDefenderVoter: c,
                    isSuspended: l,
                    payouts: d,
                    strikes: u.strikes,
                    vouching: u.vouching.unwrapOr(void 0)
                }))));
    }
    function FQe(t, e) {
        return Be(t, (n)=>e.query.society.members.creator.meta.type.isMap ? BQe(e, n) : DQe(e, n));
    }
    function LQe(t, e) {
        return Be(t, ()=>e.query.society.members.creator.meta.type.isMap ? e.query.society.members.keys().pipe(it((n)=>e.derive.society._members(n.map(({ args: [r] })=>r)))) : e.query.society.members().pipe(it((n)=>e.derive.society._members(n))));
    }
    const zQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _members: FQe,
        candidates: RQe,
        info: NQe,
        member: VQe,
        members: LQe
    }, Symbol.toStringTag, {
        value: "Module"
    })), UQe = {
        withDestination: !0,
        withLedger: !0,
        withNominations: !0,
        withPrefs: !0
    };
    function HQe(t) {
        return t.reduce((e, { era: n, value: r })=>{
            const s = n.toString();
            return e[s] = (e[s] || ss).add(r.unwrap()), e;
        }, {});
    }
    function jQe(t, e, n) {
        const r = Object.entries(HQe((e?.unlocking || []).filter(({ era: s })=>s.unwrap().gt(n.activeEra)))).map(([s, i])=>({
                remainingEras: new ht(s).isub(n.activeEra),
                value: t.registry.createType("Balance", i)
            }));
        return r.length ? r : void 0;
    }
    function qQe(t, e, n) {
        return t.registry.createType("Balance", (e?.unlocking || []).reduce((r, { era: s, value: i })=>s.unwrap().gt(n.currentEra) ? r : r.iadd(i.unwrap()), new ht(0)));
    }
    function WQe(t, e, n, r) {
        return Ye({}, n, r, {
            redeemable: qQe(t, r.stakingLedger, e),
            unlocking: jQe(t, r.stakingLedger, e)
        });
    }
    function KQe(t, e) {
        return Be(t, (n, r = UQe)=>e.derive.session.info().pipe(it((s)=>et([
                    e.derive.staking.keysMulti(n),
                    e.derive.staking.queryMulti(n, r)
                ]).pipe(ve(([i, o])=>o.map((a, c)=>WQe(e, s, i[c], a)))))));
    }
    const $Qe = Cu((t, e, n)=>t.derive.staking.accounts([
            e
        ], n));
    function XQe(t, e) {
        return Be(t, ()=>e.derive.session.indexes().pipe(it(({ activeEra: n })=>e.query.staking.erasRewardPoints(n))));
    }
    const GQe = {
        withController: !0,
        withExposure: !0,
        withPrefs: !0
    };
    function ZQe(t, e) {
        return Qh([
            t,
            e.filter((n)=>!t.find((r)=>r.eq(n)))
        ]);
    }
    function JQe(t, e) {
        return Be(t, (n = GQe, r = 0)=>e.derive.staking.validators().pipe(it(({ nextElected: s, validators: i })=>e.derive.staking.queryMulti(ZQe(s, i), n, r).pipe(ve((o)=>({
                        info: o,
                        nextElected: s,
                        validators: i
                    }))))));
    }
    function iP(t, e, n) {
        const r = `${t}-${e.toString()}`;
        return [
            r,
            n ? void 0 : U1.get(r)
        ];
    }
    function nQ(t, e, n) {
        return n ? [] : e.map((s)=>U1.get(`${t}-${s.toString()}`)).filter((s)=>!!s);
    }
    function Mx(t, e, n) {
        return !e && U1.set(t, n), n;
    }
    function rQ(t, e, n) {
        return !e && n.forEach((r)=>U1.set(`${t}-${r.era.toString()}`, r)), n;
    }
    function sQ(t, e, n) {
        return t.map((r)=>e.find(({ era: s })=>r.eq(s)) || n.find(({ era: s })=>r.eq(s))).filter((r)=>!!r);
    }
    const YQe = 14;
    function QQe(t, e) {
        const n = Fk(t, YQe);
        let r = 0;
        const s = new Sy(n[r]);
        return s.pipe(it(e), Nd(()=>{
            kp(()=>{
                r++, r === n.length ? s.complete() : s.next(n[r]);
            });
        }), z3(), ve(Qh));
    }
    function iQ(t, e) {
        return t.filter((n)=>!e.some(({ era: r })=>n.eq(r)));
    }
    function j1(t) {
        return (e, n)=>Be(e, (r = !1)=>n.derive.staking.erasHistoric(r).pipe(it((s)=>n.derive.staking[t](s, r))));
    }
    function q1(t) {
        return (e, n)=>Be(e, (r, s = !1, i)=>n.derive.staking.erasHistoric(s).pipe(it((o)=>n.derive.staking[t](r, o, s, i || 0))));
    }
    function oP(t) {
        return (e, n)=>Be(e, (r)=>n.derive.staking[t](r, !0));
    }
    function aP(t) {
        return (e, n)=>Be(e, (r, s)=>r.length ? QQe(r, (i)=>et(i.map((o)=>n.derive.staking[t](o, s)))) : Te([]));
    }
    const eet = "eraExposure";
    function tet(t, e) {
        const n = {}, r = {};
        return e.forEach(([s, i])=>{
            const o = s.args[1].toString();
            r[o] = i, i.others.forEach(({ who: a }, c)=>{
                const l = a.toString();
                n[l] = n[l] || [], n[l].push({
                    validatorId: o,
                    validatorIndex: c
                });
            });
        }), {
            era: t,
            nominators: n,
            validators: r
        };
    }
    function net(t, e) {
        const n = {}, r = {};
        return e.forEach(([s, i])=>{
            if (i.isSome) {
                const o = s.args[1].toString(), a = i.unwrap();
                r[o] = a, a.others.forEach(({ who: c }, l)=>{
                    const u = c.toString();
                    n[u] = n[u] || [], n[u].push({
                        validatorId: o,
                        validatorIndex: l
                    });
                });
            }
        }), {
            era: t,
            nominators: n,
            validators: r
        };
    }
    function ret(t, e) {
        return Be(t, (n, r = !1)=>{
            const [s, i] = iP(eet, n, r);
            return i ? Te(i) : e.query.staking.erasStakersPaged ? e.query.staking.erasStakersPaged.entries(n).pipe(ve((o)=>Mx(s, r, net(n, o)))) : e.query.staking.erasStakersClipped.entries(n).pipe(ve((o)=>Mx(s, r, tet(n, o))));
        });
    }
    const set = oP("_eraExposure"), iet = aP("_eraExposure"), oet = j1("_erasExposure");
    function aet(t, e) {
        return Be(t, (n)=>et([
                e.query.staking.activeEra(),
                e.consts.staking.historyDepth ? Te(e.consts.staking.historyDepth) : e.query.staking.historyDepth()
            ]).pipe(ve(([r, s])=>{
                const i = [], o = s.toNumber(), a = r.unwrapOrDefault().index;
                let c = a;
                for(; c.gte(ss) && i.length < o;)(c !== a || n === !0) && i.push(e.registry.createType("EraIndex", c)), c = c.sub(Qg);
                return i.reverse();
            })));
    }
    const zB = "eraPoints";
    function cet({ individual: t }) {
        return [
            ...t.entries()
        ].filter(([, e])=>e.gt(ss)).reduce((e, [n, r])=>(e[n.toString()] = r, e), {});
    }
    function uet(t, e) {
        return t.map((n, r)=>({
                era: n,
                eraPoints: e[r].total,
                validators: cet(e[r])
            }));
    }
    function det(t, e) {
        return Be(t, (n, r)=>{
            if (!n.length) return Te([]);
            const s = nQ(zB, n, r), i = iQ(n, s);
            return i.length ? e.query.staking.erasRewardPoints.multi(i).pipe(ve((o)=>sQ(n, s, rQ(zB, r, uet(i, o))))) : Te(s);
        });
    }
    const fet = j1("_erasPoints"), pet = "eraPrefs";
    function het(t, e) {
        const n = {};
        return e.forEach(([r, s])=>{
            n[r.args[1].toString()] = s;
        }), {
            era: t,
            validators: n
        };
    }
    function get(t, e) {
        return Be(t, (n, r)=>{
            const [s, i] = iP(pet, n, r);
            return i ? Te(i) : e.query.staking.erasValidatorPrefs.entries(n).pipe(ve((o)=>Mx(s, r, het(n, o))));
        });
    }
    const bet = oP("_eraPrefs"), met = aP("_eraPrefs"), yet = j1("_erasPrefs"), UB = "eraRewards";
    function wet(t, e) {
        return t.map((n, r)=>({
                era: n,
                eraReward: e[r].unwrapOrDefault()
            }));
    }
    function _et(t, e) {
        return Be(t, (n, r)=>{
            if (!n.length) return Te([]);
            const s = nQ(UB, n, r), i = iQ(n, s);
            return i.length ? e.query.staking.erasValidatorReward.multi(i).pipe(ve((o)=>sQ(n, s, rQ(UB, r, wet(i, o))))) : Te(s);
        });
    }
    const xet = j1("_erasRewards"), vet = "eraSlashes";
    function ket(t, e, n) {
        const r = {}, s = {};
        return e.forEach(([i, o])=>{
            r[i.args[1].toString()] = o.unwrap();
        }), n.forEach(([i, o])=>{
            s[i.args[1].toString()] = o.unwrapOrDefault()[1];
        }), {
            era: t,
            nominators: r,
            validators: s
        };
    }
    function Tet(t, e) {
        return Be(t, (n, r)=>{
            const [s, i] = iP(vet, n, r);
            return i ? Te(i) : et([
                e.query.staking.nominatorSlashInEra.entries(n),
                e.query.staking.validatorSlashInEra.entries(n)
            ]).pipe(ve(([o, a])=>Mx(s, r, ket(n, o, a))));
        });
    }
    const Cet = oP("_eraSlashes"), Eet = aP("_eraSlashes"), Iet = j1("_erasSlashes");
    function Aet(t, e, n) {
        const r = (e.find(([i])=>i.eq(t)) || [
            void 0,
            []
        ])[1], s = n.unwrapOr([]);
        return {
            nextSessionIds: Array.isArray(s) ? s : [
                ...s.values()
            ],
            sessionIds: Array.isArray(r) ? r : [
                ...r.values()
            ]
        };
    }
    const Pet = Cu((t, e)=>t.derive.staking.keysMulti([
            e
        ]));
    function Oet(t, e) {
        return Be(t, (n)=>n.length ? e.query.session.queuedKeys().pipe(it((r)=>et([
                    Te(r),
                    e.consts.session?.dedupKeyPrefix ? e.query.session.nextKeys.multi(n.map((s)=>[
                            e.consts.session.dedupKeyPrefix,
                            s
                        ])) : et(n.map((s)=>e.query.session.nextKeys(s)))
                ])), ve(([r, s])=>n.map((i, o)=>Aet(i, r, s[o])))) : Te([]));
    }
    function Met(t, e) {
        return Be(t, ()=>et([
                e.derive.session.indexes(),
                e.derive.staking.validators()
            ]).pipe(ve(([n, { nextElected: r, validators: s }])=>Ye({}, n, {
                    nextElected: r,
                    validators: s
                }))));
    }
    function Ret(t, e) {
        return Be(t, (n, r, s, i)=>{
            const o = e.registry.createType("Exposure"), a = e.registry.createType("Option<Null>"), c = e.registry.createType("Option<Null>");
            return r.length ? et([
                e.query.staking.erasStakersClipped ? et(r.map((l)=>e.query.staking.erasStakersClipped(l, n))) : Te(r.map((l)=>o)),
                e.query.staking.erasStakers ? et(r.map((l)=>e.query.staking.erasStakers(l, n))) : Te(r.map((l)=>o)),
                e.query.staking.erasStakersPaged ? et(r.map((l)=>e.query.staking.erasStakersPaged(l, n, i))) : Te(r.map((l)=>a)),
                e.query.staking.erasStakersOverview ? et(r.map((l)=>e.query.staking.erasStakersOverview(l, n))) : Te(r.map((l)=>c))
            ]).pipe(ve(([l, u, d, f])=>r.map((p, h)=>({
                        clipped: l[h],
                        era: p,
                        exposure: u[h],
                        exposureMeta: f[h],
                        exposurePaged: d[h]
                    })))) : Te([]);
        });
    }
    const Net = Cu((t, e, n, r)=>t.derive.staking._ownExposures(e, [
            n
        ], !0, r || 0)), Vet = q1("_ownExposures");
    function Det(t, e) {
        return Be(t, (n, r, s)=>r.length ? et([
                et(r.map((i)=>e.query.staking.validatorSlashInEra(i, n))),
                et(r.map((i)=>e.query.staking.nominatorSlashInEra(i, n)))
            ]).pipe(ve(([i, o])=>r.map((a, c)=>({
                        era: a,
                        total: i[c].isSome ? i[c].unwrap()[1] : o[c].unwrapOrDefault()
                    })))) : Te([]));
    }
    const Bet = Cu((t, e, n)=>t.derive.staking._ownSlashes(e, [
            n
        ], !0)), Fet = q1("_ownSlashes");
    function Let(t) {
        return typeof t.isSome == "boolean" ? t.unwrapOr(null) : t;
    }
    function zet(t, e) {
        return t.registry.createType("Vec<u32>", e.filter((n)=>n !== -1));
    }
    function Uet(t, e, n, r) {
        const s = {}, i = {}, o = t.map((a)=>a.toString());
        return n.forEach(([a, c])=>{
            const l = a.args[1].toString(), u = a.args[0].toNumber();
            o.includes(l) && (s[l] || (s[l] = new Map), s[l].set(u, c.toArray()));
        }), r.forEach(([a, c])=>{
            const l = a.args[1].toString(), u = a.args[0].toNumber();
            o.includes(l) && c.isSome && (i[l] || (i[l] = new Map), i[l].set(u, c.unwrap().pageCount));
        }), t.map((a)=>{
            const c = s[a.toString()], l = i[a.toString()];
            return e.map((u)=>{
                if (c && c.has(u) && l && l.has(u)) {
                    const d = c.get(u), f = l.get(u);
                    return d.length === f.toNumber() ? u : -1;
                }
                return -1;
            });
        });
    }
    function Het(t, e, n, r, s, i, o, a, c, l, u) {
        return {
            accountId: e,
            claimedRewardsEras: zet(t, l),
            controllerId: n?.unwrapOr(null) || null,
            exposureEraStakers: u,
            exposureMeta: c,
            exposurePaged: o,
            nominators: r.isSome ? r.unwrap().targets : [],
            rewardDestination: Let(s),
            stakingLedger: a.unwrapOrDefault(),
            stashId: e,
            validatorPrefs: i
        };
    }
    function jet(t, e, { withLedger: n = !1 }) {
        const r = e.filter((i)=>n && !!i && i.isSome).map((i)=>i.unwrap()), s = t.registry.createType("Option<StakingLedger>");
        return (r.length ? et(r.map((i)=>t.query.staking.ledger(i))) : Te([])).pipe(ve((i)=>{
            let o = -1;
            return e.map((a)=>a && a.isSome && i[++o] || s);
        }));
    }
    function qet(t, e, n, { withClaimedRewardsEras: r, withController: s, withDestination: i, withExposure: o, withExposureErasStakersLegacy: a, withExposureMeta: c, withLedger: l, withNominations: u, withPrefs: d }, f) {
        const p = t.registry.createType("Option<Nominations>"), h = t.registry.createType("RewardDestination"), m = t.registry.createType("Exposure"), w = t.registry.createType("ValidatorPrefs"), v = t.registry.createType("Option<Null>"), k = t.registry.createType("Option<Null>"), _ = [
            -1
        ], A = Number(t.consts.staking.historyDepth.toNumber()), P = new Array(A).fill(0).map((U, K)=>K === 0 ? n.toNumber() - 1 : n.toNumber() - K - 1);
        return et([
            s || l ? et(e.map((U)=>t.query.staking.bonded(U))) : Te(e.map(()=>null)),
            u ? et(e.map((U)=>t.query.staking.nominators(U))) : Te(e.map(()=>p)),
            i ? et(e.map((U)=>t.query.staking.payee(U))) : Te(e.map(()=>h)),
            d ? et(e.map((U)=>t.query.staking.validators(U))) : Te(e.map(()=>w)),
            o && t.query.staking.erasStakersPaged ? et(e.map((U)=>t.query.staking.erasStakersPaged(n, U, f))) : Te(e.map(()=>v)),
            c && t.query.staking.erasStakersOverview ? et(e.map((U)=>t.query.staking.erasStakersOverview(n, U))) : Te(e.map(()=>k)),
            r && t.query.staking.claimedRewards ? et([
                t.query.staking.claimedRewards.entries(),
                t.query.staking.erasStakersOverview.entries()
            ]).pipe(ve(([U, K])=>Uet(e, P, U, K))) : Te(e.map(()=>_)),
            a && t.query.staking.erasStakers ? et(e.map((U)=>t.query.staking.erasStakers(n, U))) : Te(e.map(()=>m))
        ]);
    }
    function Wet(t, e, n, r, s) {
        return qet(t, n, e, r, s).pipe(it(([i, o, a, c, l, u, d, f])=>jet(t, i, r).pipe(ve((p)=>n.map((h, m)=>Het(t, h, i[m], o[m], a[m], c[m], l[m], p[m], u[m], d[m], f[m]))))));
    }
    const Ket = Cu((t, e, n, r)=>t.derive.staking.queryMulti([
            e
        ], n, r));
    function $et(t, e) {
        return Be(t, (n, r, s)=>e.derive.session.indexes().pipe(it(({ activeEra: i })=>{
                const o = n.map((c)=>e.registry.createType("AccountId", c)), a = s || 0;
                return o.length ? Wet(e, i, o, r, a) : Te([]);
            })));
    }
    function Xet(t, e) {
        return Be(t, (n, r, s = !1)=>{
            const i = n.map((o)=>e.registry.createType("AccountId", o).toString());
            return e.derive.staking._erasExposure(r, s).pipe(ve((o)=>i.map((a)=>o.map(({ era: c, nominators: l, validators: u })=>{
                        const d = !!u[a], f = {}, p = l[a] || [];
                        return d ? f[a] = u[a] : p && p.forEach(({ validatorId: h })=>{
                            f[h] = u[h];
                        }), {
                            era: c,
                            isEmpty: !Object.keys(f).length,
                            isValidator: d,
                            nominating: p,
                            validators: f
                        };
                    }))));
        });
    }
    function Get(t, e) {
        return Be(t, (n, r = !1)=>e.derive.staking.erasHistoric(r).pipe(it((s)=>e.derive.staking._stakerExposures(n, s, r))));
    }
    const Zet = Cu((t, e, n)=>t.derive.staking.stakerExposures([
            e
        ], n));
    function Jet(t, e) {
        return Be(t, (n, r, s)=>{
            const i = e.registry.createType("AccountId", n).toString();
            return e.derive.staking._erasPoints(r, s).pipe(ve((o)=>o.map(({ era: a, eraPoints: c, validators: l })=>({
                        era: a,
                        eraPoints: c,
                        points: l[i] || e.registry.createType("RewardPoint")
                    }))));
        });
    }
    const Yet = q1("_stakerPoints");
    function Qet(t, e) {
        return Be(t, (n, r, s)=>e.query.staking.erasValidatorPrefs.multi(r.map((i)=>[
                    i,
                    n
                ])).pipe(ve((i)=>i.map((o, a)=>({
                        era: r[a],
                        validatorPrefs: o
                    })))));
    }
    const ett = q1("_stakerPrefs");
    function oQ(t, e) {
        const n = e ? (e.legacyClaimedRewards || e.claimedRewards)?.toArray() : [];
        return (t.toArray() || []).concat(n);
    }
    function ttt(t, e, [n, r, s], i, o) {
        return i.map(({ era: a, isEmpty: c, isValidator: l, nominating: u, validators: d })=>{
            const { eraPoints: f, validators: p } = n.find((k)=>k.era.eq(a)) || {
                eraPoints: ss,
                validators: {}
            }, { eraReward: h } = s.find((k)=>k.era.eq(a)) || {
                eraReward: t.registry.createType("Balance")
            }, { validators: m } = r.find((k)=>k.era.eq(a)) || {
                validators: {}
            }, w = {}, v = e.toString();
            return Object.entries(d).forEach(([k, _])=>{
                const A = p[k] || ss, P = m[k]?.commission.unwrap() || ss, U = _.total ? _.total?.unwrap() : _.pageTotal ? _.pageTotal?.unwrap() : ss;
                let K = ss, X;
                if (!(U.isZero() || A.isZero() || f.isZero())) {
                    K = h.mul(A).div(f);
                    const G = P.mul(K).div(bx);
                    let ce;
                    if (k === v) if (_.own) ce = _.own.unwrap();
                    else {
                        const ie = _.others.find(({ who: Y })=>Y.eq(k));
                        ce = ie ? ie.value.unwrap() : ss;
                    }
                    else {
                        const ie = _.others.find(({ who: Y })=>Y.eq(v));
                        ce = ie ? ie.value.unwrap() : ss;
                    }
                    X = K.sub(G).imul(ce).div(U).iadd(k === v ? G : ss);
                }
                w[k] = {
                    total: t.registry.createType("Balance", K),
                    value: t.registry.createType("Balance", X)
                };
            }), {
                era: a,
                eraReward: h,
                isClaimed: o.some((k)=>k.eq(a)),
                isEmpty: c,
                isValidator: l,
                nominating: u,
                validators: w
            };
        });
    }
    function ntt(t) {
        return t.reduce(([e, n], r)=>{
            const s = [];
            return n.push(s), r.forEach(({ validators: i })=>Object.keys(i).forEach((o)=>{
                    s.includes(o) || (s.push(o), e.includes(o) || e.push(o));
                })), [
                e,
                n
            ];
        }, [
            [],
            []
        ]);
    }
    function rtt(t, e, n, r) {
        const s = [];
        Object.keys(n.validators).forEach((i)=>{
            const o = t.indexOf(i);
            if (o !== -1) {
                const a = e[o].stakingLedger;
                oQ(r, a).some((c)=>n.era?.eq(c)) && s.push(i);
            }
        }), s.forEach((i)=>{
            delete n.validators[i];
        });
    }
    function stt(t, e, { claimedRewardsEras: n, rewards: r, stakingLedger: s }) {
        const i = t.filter((c)=>!oQ(n, s).some((l)=>l?.eq(c))), o = e.map(([c])=>c), a = e.map(([, c])=>c);
        return r.filter(({ isEmpty: c })=>!c).filter((c)=>i.some((l)=>c.era.eq(l)) ? (rtt(o, a, c, n), !0) : !1).filter(({ validators: c })=>Object.keys(c).length !== 0).map((c)=>{
            let l = c.isClaimed;
            const u = Object.keys(c.validators);
            if (!c.isClaimed && u.length) for (const d of u){
                const f = a.find((p)=>p.accountId.toString() === d);
                if (f) {
                    l = f.claimedRewardsEras?.toArray().some((p)=>p.eq(c.era));
                    break;
                }
            }
            return Ye({}, c, {
                isClaimed: l,
                nominators: c.nominating.filter((d)=>c.validators[d.validatorId])
            });
        });
    }
    function itt(t, e) {
        return Be(t, (n, r = !1)=>et([
                e.derive.staking._erasPoints(n, r),
                e.derive.staking._erasPrefs(n, r),
                e.derive.staking._erasRewards(n, r)
            ]));
    }
    function ott(t, e) {
        return Be(t, (n, r, s = !1)=>{
            const i = r.map((o)=>typeof o == "number" || typeof o == "string" ? e.registry.createType("u32", o) : o);
            return et([
                e.derive.staking.queryMulti(n, {
                    withClaimedRewardsEras: !0,
                    withLedger: !0
                }),
                e.derive.staking._stakerExposures(n, i, s),
                e.derive.staking._stakerRewardsEras(i, s)
            ]).pipe(it(([o, a, c])=>{
                const l = o.map(({ claimedRewardsEras: f, stakingLedger: p, stashId: h }, m)=>!h || !p && !f ? [] : ttt(e, h, c, a[m], f));
                if (s) return Te(l);
                const [u, d] = ntt(l);
                return e.derive.staking.queryMulti(u, {
                    withClaimedRewardsEras: !0,
                    withLedger: !0
                }).pipe(ve((f)=>o.map(({ claimedRewardsEras: p, stakingLedger: h }, m)=>stt(r, d[m].map((w)=>[
                                w,
                                f.find((v)=>v.accountId.eq(w))
                            ]).filter((w)=>!!w[1]), {
                            claimedRewardsEras: p,
                            rewards: l[m],
                            stakingLedger: h
                        }))));
            }));
        });
    }
    const att = Cu((t, e, n)=>t.derive.staking.erasHistoric(n).pipe(it((r)=>t.derive.staking._stakerRewards([
                e
            ], r, n))));
    function ctt(t, e) {
        return Be(t, (n, r)=>n.length && r.length ? e.derive.staking._stakerRewards(n, r, !1) : Te([]));
    }
    function ltt(t, e) {
        return Be(t, (n, r = !1)=>e.derive.staking.erasHistoric(r).pipe(it((s)=>e.derive.staking.stakerRewardsMultiEras(n, s))));
    }
    function utt(t, e) {
        return Be(t, (n, r, s)=>{
            const i = e.registry.createType("AccountId", n).toString();
            return e.derive.staking._erasSlashes(r, s).pipe(ve((o)=>o.map(({ era: a, nominators: c, validators: l })=>({
                        era: a,
                        total: c[i] || l[i] || e.registry.createType("Balance")
                    }))));
        });
    }
    const dtt = q1("_stakerSlashes");
    function ftt(t) {
        let e = Date.now();
        return t.query.system.events().pipe(ve((n)=>(e = n.filter(({ event: r, phase: s })=>{
                try {
                    return s.isApplyExtrinsic && r.section === "staking" && r.method === "Bonded";
                } catch  {
                    return !1;
                }
            }) ? Date.now() : e, e)), V1(e), QA({
            skipTimeout: !0
        }));
    }
    function ptt(t, e) {
        return Be(t, ()=>ftt(e).pipe(it(()=>e.query.staking.validators.keys()), ve((n)=>n.map(({ args: [r] })=>r).filter((r)=>r))));
    }
    function htt(t, e) {
        return Be(t, ()=>e.query.staking.erasStakersOverview ? e.derive.session.indexes().pipe(it(({ currentEra: n })=>e.query.staking.erasStakersOverview.keys(n)), ve((n)=>[
                    ...new Set(n.map(({ args: [, r] })=>r.toString()))
                ].map((r)=>e.registry.createType("AccountId", r)))) : e.query.staking.erasStakers ? e.derive.session.indexes().pipe(it(({ currentEra: n })=>e.query.staking.erasStakers.keys(n)), ve((n)=>[
                    ...new Set(n.map(({ args: [, r] })=>r.toString()))
                ].map((r)=>e.registry.createType("AccountId", r)))) : e.query.staking.currentElected());
    }
    function gtt(t, e) {
        return Be(t, ()=>et([
                e.query.session ? e.query.session.validators() : Te([]),
                e.query.staking ? e.derive.staking.nextElected() : Te([])
            ]).pipe(ve(([n, r])=>({
                    nextElected: r.length ? r : n,
                    validators: n
                }))));
    }
    const btt = {
        withController: !0,
        withPrefs: !0
    };
    function mtt(t, e) {
        return Be(t, (n = btt)=>et([
                e.derive.staking.validators(),
                e.derive.staking.stashes()
            ]).pipe(it(([{ nextElected: r }, s])=>{
                const i = r.map((a)=>a.toString()), o = s.filter((a)=>!i.includes(a.toString()));
                return e.derive.staking.queryMulti(o, n).pipe(ve((a)=>({
                        info: a,
                        waiting: o
                    })));
            })));
    }
    const ytt = Object.freeze(Object.defineProperty({
        __proto__: null,
        _eraExposure: ret,
        _eraPrefs: get,
        _eraSlashes: Tet,
        _erasExposure: iet,
        _erasPoints: det,
        _erasPrefs: met,
        _erasRewards: _et,
        _erasSlashes: Eet,
        _ownExposures: Ret,
        _ownSlashes: Det,
        _stakerExposures: Xet,
        _stakerPoints: Jet,
        _stakerPrefs: Qet,
        _stakerRewards: ott,
        _stakerRewardsEras: itt,
        _stakerSlashes: utt,
        account: $Qe,
        accounts: KQe,
        currentPoints: XQe,
        electedInfo: JQe,
        eraExposure: set,
        eraPrefs: bet,
        eraSlashes: Cet,
        erasExposure: oet,
        erasHistoric: aet,
        erasPoints: fet,
        erasPrefs: yet,
        erasRewards: xet,
        erasSlashes: Iet,
        keys: Pet,
        keysMulti: Oet,
        nextElected: htt,
        overview: Met,
        ownExposure: Net,
        ownExposures: Vet,
        ownSlash: Bet,
        ownSlashes: Fet,
        query: Ket,
        queryMulti: $et,
        stakerExposure: Zet,
        stakerExposures: Get,
        stakerPoints: Yet,
        stakerPrefs: ett,
        stakerRewards: att,
        stakerRewardsMulti: ltt,
        stakerRewardsMultiEras: ctt,
        stakerSlashes: dtt,
        stashes: ptt,
        validators: gtt,
        waitingInfo: mtt
    }, Symbol.toStringTag, {
        value: "Module"
    })), wtt = s9("technicalCommittee"), _tt = o9("technicalCommittee"), xtt = c9("technicalCommittee"), vtt = l9("technicalCommittee"), Stt = u9("technicalCommittee"), ktt = a9("technicalCommittee"), Ttt = i9("technicalCommittee"), Ctt = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: _tt,
        members: wtt,
        prime: Ttt,
        proposal: xtt,
        proposalCount: vtt,
        proposalHashes: Stt,
        proposals: ktt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Ett(t, { allIds: e, allProposals: n, approvalIds: r, councilProposals: s, proposalCount: i }) {
        const o = [], a = [], c = s.filter(({ proposal: l })=>l && (t.tx.treasury.approveProposal && t.tx.treasury.approveProposal.is(l) || t.tx.treasury.rejectProposal && t.tx.treasury.rejectProposal.is(l)));
        return e.forEach((l, u)=>{
            if (n[u].isSome) {
                const d = c.filter(({ proposal: h })=>h && l.eq(h.args[0])).sort((h, m)=>h.proposal && m.proposal ? h.proposal.method.localeCompare(m.proposal.method) : h.proposal ? -1 : 1), f = r.some((h)=>h.eq(l)), p = {
                    council: d,
                    id: l,
                    proposal: n[u].unwrap()
                };
                f ? o.push(p) : a.push(p);
            }
        }), {
            approvals: o,
            proposalCount: i,
            proposals: a
        };
    }
    function Itt(t, e, n) {
        const r = [], s = e.toNumber();
        for(let o = 0; o < s; o++)n.some((a)=>a.eqn(o)) || r.push(t.registry.createType("ProposalIndex", o));
        const i = [
            ...r,
            ...n
        ];
        return et([
            t.query.treasury.proposals.multi(i),
            t.derive.council ? t.derive.council.proposals() : Te([])
        ]).pipe(ve(([o, a])=>Ett(t, {
                allIds: i,
                allProposals: o,
                approvalIds: n,
                councilProposals: a,
                proposalCount: e
            })));
    }
    function Att(t, e) {
        return Be(t, ()=>e.query.treasury ? et([
                e.query.treasury.proposalCount(),
                e.query.treasury.approvals()
            ]).pipe(it(([n, r])=>Itt(e, n, r))) : Te({
                approvals: [],
                proposalCount: e.registry.createType("ProposalIndex"),
                proposals: []
            }));
    }
    const Ptt = Object.freeze(Object.defineProperty({
        __proto__: null,
        proposals: Att
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Ott(t, e) {
        return Be(t, (n)=>et([
                e.rpc.chain.getBlock(n),
                e.queryAt(n).pipe(it((r)=>r.system.events()))
            ]).pipe(ve(([r, s])=>({
                    block: r,
                    events: s
                }))));
    }
    function Mtt(t, e) {
        return Be(t, (n, r)=>e.derive.tx.events(n).pipe(ve(({ block: s, events: i })=>{
                const o = s.block.extrinsics.findIndex((c)=>c.hash.toString() === r);
                if (o === -1) return null;
                const a = i.filter(({ phase: c })=>c.isApplyExtrinsic && c.asApplyExtrinsic.eq(o));
                return {
                    blockHash: s.hash.toHex(),
                    blockNumber: s.block.header.number.toNumber(),
                    events: a,
                    extrinsic: s.block.extrinsics[o],
                    success: a.findIndex((c)=>c.event.method === "ExtrinsicSuccess") !== -1
                };
            })));
    }
    function Rtt(t, e) {
        return Be(t, (n, r)=>e.derive.tx.events(n).pipe(ve(({ block: s, events: i })=>{
                const o = [];
                return {
                    blockHash: s.hash.toHex(),
                    blockNumber: s.block.header.number.toNumber(),
                    extrinsics: s.block.extrinsics.filter((a, c)=>a.signer.toString() === r ? (o.push(c), !0) : !1).map((a, c)=>{
                        const l = i.filter(({ phase: u })=>u.isApplyExtrinsic && u.asApplyExtrinsic.eq(o[c]));
                        return {
                            events: l,
                            extrinsic: a,
                            success: l.findIndex((u)=>u.event.method === "ExtrinsicSuccess") !== -1
                        };
                    })
                };
            })));
    }
    const Ntt = 250, Vtt = new ht(6 * 1e3), aQ = new ht(5), Dtt = new ht(300 * 1e3);
    function cQ(t, e) {
        return t.derive.balances.account(e).pipe(ve(({ accountNonce: n })=>n));
    }
    function Btt(t, e) {
        return t.call.accountNonceApi ? t.call.accountNonceApi.accountNonce(e) : t.rpc.system?.accountNextIndex ? t.rpc.system.accountNextIndex(e) : cQ(t, e);
    }
    function Ftt(t) {
        return et([
            t.rpc.chain.getHeader().pipe(it((e)=>e.parentHash.isEmpty ? Te(e) : t.rpc.chain.getHeader(e.parentHash).pipe(cu(()=>Te(e))))),
            t.rpc.chain.getFinalizedHead().pipe(it((e)=>t.rpc.chain.getHeader(e).pipe(cu(()=>Te(null)))))
        ]).pipe(ve(([e, n])=>!n || nT(e).sub(nT(n)).gt(aQ) ? e : n));
    }
    function Ltt(t) {
        const e = t.consts.babe?.expectedBlockTime || t.consts.aura?.slotDuration || t.consts.timestamp?.minimumPeriod.muln(2);
        return e && e.isZero && !e.isZero() ? e : void 0;
    }
    function ztt(t, e) {
        return (n, r, s)=>et([
                Rr(r) ? cQ(e, n) : r === -1 ? Btt(e, n) : Te(e.registry.createType("Index", r)),
                Rr(s) || Xn(s) && s > 0 ? Ftt(e) : Te(null)
            ]).pipe(ve(([i, o])=>({
                    header: o,
                    mortalLength: Math.min(e.consts.system?.blockHashCount?.toNumber() || Ntt, Dtt.div(Ltt(e) || Vtt).iadd(aQ).toNumber()),
                    nonce: i
                })));
    }
    const Utt = Object.freeze(Object.defineProperty({
        __proto__: null,
        accountExtrinsics: Rtt,
        events: Ott,
        extrinsicInfo: Mtt,
        signingInfo: ztt
    }, Symbol.toStringTag, {
        value: "Module"
    })), Htt = {
        accounts: kZe,
        alliance: NZe,
        bagsList: jZe,
        balances: rJe,
        bounties: oJe,
        chain: xJe,
        contracts: kJe,
        council: LJe,
        crowdloan: JJe,
        democracy: WYe,
        elections: eQe,
        imOnline: rQe,
        membership: dQe,
        parachains: mQe,
        session: PQe,
        society: zQe,
        staking: ytt,
        technicalCommittee: Ctt,
        treasury: Ptt,
        tx: Utt
    }, uf = {
        allianceMotion: {
            instances: [
                "allianceMotion"
            ],
            methods: []
        },
        bagsList: {
            instances: [
                "voterBagsList",
                "voterList",
                "bagsList"
            ],
            methods: [],
            withDetect: !0
        },
        contracts: {
            instances: [
                "contracts"
            ],
            methods: []
        },
        council: {
            instances: [
                "council"
            ],
            methods: [],
            withDetect: !0
        },
        crowdloan: {
            instances: [
                "crowdloan"
            ],
            methods: []
        },
        democracy: {
            instances: [
                "democracy"
            ],
            methods: []
        },
        elections: {
            instances: [
                "phragmenElection",
                "electionsPhragmen",
                "elections",
                "council"
            ],
            methods: [],
            withDetect: !0
        },
        imOnline: {
            instances: [
                "imOnline"
            ],
            methods: []
        },
        membership: {
            instances: [
                "membership"
            ],
            methods: []
        },
        parachains: {
            instances: [
                "parachains",
                "registrar"
            ],
            methods: []
        },
        session: {
            instances: [
                "session"
            ],
            methods: []
        },
        society: {
            instances: [
                "society"
            ],
            methods: []
        },
        staking: {
            instances: [
                "staking"
            ],
            methods: [
                "erasRewardPoints"
            ]
        },
        technicalCommittee: {
            instances: [
                "technicalCommittee"
            ],
            methods: [],
            withDetect: !0
        },
        treasury: {
            instances: [
                "treasury"
            ],
            methods: []
        }
    };
    function jtt(t, e, n) {
        return t.registry.getModuleInstances(e, n) || [];
    }
    function HB(t, e, n) {
        const r = {}, s = Object.keys(n), i = Object.keys(e.query), o = e.runtimeVersion.specName, a = (p)=>i.includes(p), c = (p)=>jtt(e, o, p).some(a), l = (p)=>(h)=>p.some((m)=>i.includes(m) && e.query[m][h]), u = (p)=>Object.keys(n[p]), d = (p, h)=>n[p][h](t, e), f = (p)=>!uf[p] || uf[p].instances.some(a) && (!uf[p].methods.length || uf[p].methods.every(l(uf[p].instances))) || uf[p].withDetect && uf[p].instances.some(c);
        for(let p = 0, h = s.length; p < h; p++){
            const m = s[p];
            f(m) && qY(r, m, u, d);
        }
        return r;
    }
    function qtt(t, e, n = {}) {
        return {
            ...HB(t, e, Htt),
            ...HB(t, e, n)
        };
    }
    function jB(t, e) {
        const n = (o)=>Object.keys(e[o]), r = (o, a)=>t(e[o][a]), s = {}, i = Object.keys(e);
        for(let o = 0, a = i.length; o < a; o++)qY(s, i[o], n, r);
        return s;
    }
    const Wtt = (t)=>t;
    function cP(t, e, n, r) {
        return t.filter(({ event: s })=>e === s.section && n.includes(s.method)).map((s)=>r(s));
    }
    function Ktt({ event: { data: [t] } }) {
        return t;
    }
    function $tt({ event: { data: t, method: e } }) {
        return e === "ExtrinsicSuccess" ? t[0] : t[1];
    }
    function Xtt(t = []) {
        return cP(t, "system", [
            "ExtrinsicFailed"
        ], Ktt)[0];
    }
    function Gtt(t = []) {
        return cP(t, "system", [
            "ExtrinsicFailed",
            "ExtrinsicSuccess"
        ], $tt)[0];
    }
    class BS {
        dispatchError;
        dispatchInfo;
        internalError;
        events;
        status;
        txHash;
        txIndex;
        blockNumber;
        constructor({ blockNumber: e, dispatchError: n, dispatchInfo: r, events: s, internalError: i, status: o, txHash: a, txIndex: c }){
            this.dispatchError = n || Xtt(s), this.dispatchInfo = r || Gtt(s), this.events = s || [], this.internalError = i, this.status = o, this.txHash = a, this.txIndex = c, this.blockNumber = e;
        }
        get isCompleted() {
            return this.isError || this.status.isInBlock || this.status.isFinalized;
        }
        get isError() {
            return this.status.isDropped || this.status.isFinalityTimeout || this.status.isInvalid || this.status.isUsurped;
        }
        get isFinalized() {
            return this.status.isFinalized;
        }
        get isInBlock() {
            return this.status.isInBlock;
        }
        get isWarning() {
            return this.status.isRetracted;
        }
        filterRecords(e, n) {
            return cP(this.events, e, Array.isArray(n) ? n : [
                n
            ], Wtt);
        }
        findRecord(e, n) {
            return this.filterRecords(e, n)[0];
        }
        toHuman(e) {
            return {
                dispatchError: this.dispatchError?.toHuman(),
                dispatchInfo: this.dispatchInfo?.toHuman(),
                events: this.events.map((n)=>n.toHuman(e)),
                internalError: this.internalError?.message.toString(),
                status: this.status.toHuman(e)
            };
        }
    }
    function qB(t, e, n, { header: r, mortalLength: s, nonce: i }) {
        if (!r) {
            if (n.era && !n.blockHash) throw new Error("Expected blockHash to be passed alongside non-immortal era options");
            return Xn(n.era) && (delete n.era, delete n.blockHash), rT(t, n, {
                nonce: i
            });
        }
        return rT(t, n, {
            blockHash: r.hash,
            era: e.createTypeUnsafe("ExtrinsicEra", [
                {
                    current: r.number,
                    period: n.era || s
                }
            ]),
            nonce: i
        });
    }
    function WB(t, e) {
        let n = {};
        return Mt(t) ? e = t : n = Ye({}, t), [
            n,
            e
        ];
    }
    function rT(t, e, n) {
        return Ye({
            blockHash: t.genesisHash,
            genesisHash: t.genesisHash
        }, e, n, {
            runtimeVersion: t.runtimeVersion,
            signedExtensions: t.registry.signedExtensions,
            version: t.extrinsicType
        });
    }
    function Ztt(t = {}) {
        return Ya(t) || Xn(t) ? {
            nonce: t
        } : t;
    }
    function Jtt({ api: t, apiType: e, blockHash: n, decorateMethod: r }) {
        const s = t.registry.createClass("Extrinsic"), i = new WeakMap;
        class o extends s {
            #e;
            #t = Jp;
            constructor(c, l){
                super(c, l, {
                    version: t.extrinsicType
                }), this.#e = e === "rxjs";
            }
            get hasDryRun() {
                return Mt(t.rpc.system?.dryRun);
            }
            get hasPaymentInfo() {
                return Mt(t.call.transactionPaymentApi?.queryInfo);
            }
            dryRun(c, l) {
                if (!this.hasDryRun) throw new Error("The system.dryRun RPC call is not available in your environment");
                return n || br(l) || Bt(l) ? r(()=>t.rpc.system.dryRun(this.toHex(), n || l)) : r(()=>this.#n(c, l).pipe(it(()=>t.rpc.system.dryRun(this.toHex()))))();
            }
            paymentInfo(c, l) {
                if (!this.hasPaymentInfo) throw new Error("The transactionPaymentApi.queryInfo runtime call is not available in your environment");
                if (n || br(l) || Bt(l)) return r(()=>t.callAt(n || l).pipe(it((f)=>{
                        const p = this.toU8a();
                        return f.transactionPaymentApi.queryInfo(p, p.length);
                    })));
                const [u] = WB(l), d = wS(c) ? c.address : c.toString();
                return r(()=>t.derive.tx.signingInfo(d, u.nonce, u.era).pipe(OV(), it((f)=>{
                        const p = qB(t, this.registry, u, f), h = rT(t, p, {}), m = t.tx(this.toU8a()).signFake(d, h).toU8a();
                        return t.call.transactionPaymentApi.queryInfo(m, m.length);
                    })))();
            }
            send(c) {
                const l = t.hasSubscriptions && (this.#e || !!c), u = i.get(this);
                return i.delete(this), r(l ? ()=>this.#i(u) : ()=>this.#s(u))(c);
            }
            signAsync(c, l) {
                return r(()=>this.#n(c, l).pipe(ve((u)=>{
                        if (u.signedTransaction) {
                            const d = new o(t.registry, u.signedTransaction);
                            return i.set(this, u), d;
                        }
                        return this;
                    })))();
            }
            signAndSend(c, l, u) {
                const [d, f] = WB(l, u), p = t.hasSubscriptions && (this.#e || !!f);
                return r(()=>this.#n(c, d).pipe(it((h)=>p ? this.#i(h) : this.#s(h))))(f);
            }
            withResultTransform(c) {
                return this.#t = c, this;
            }
            #n = (c, l)=>{
                const u = wS(c) ? c.address : c.toString(), d = Ztt(l);
                return t.derive.tx.signingInfo(u, d.nonce, d.era).pipe(OV(), Uc(async (f)=>{
                    const p = qB(t, this.registry, d, f);
                    let h = -1, m = null;
                    if (wS(c)) this.sign(c, p);
                    else {
                        const w = await this.#o(u, p, f.header);
                        h = w.id, w.signedTransaction && (m = w.signedTransaction);
                    }
                    return {
                        options: p,
                        signedTransaction: m,
                        updateId: h
                    };
                }));
            };
            #r = (c, l)=>{
                if (!l.isFinalized && !l.isInBlock) return Te(this.#t(new BS({
                    status: l,
                    txHash: c
                })));
                const u = l.isInBlock ? l.asInBlock : l.asFinalized;
                return t.derive.tx.events(u).pipe(ve(({ block: d, events: f })=>this.#t(new BS({
                        ...pHe(c, d, f, l),
                        status: l,
                        txHash: c
                    }))), cu((d)=>Te(this.#t(new BS({
                        internalError: d,
                        status: l,
                        txHash: c
                    })))));
            };
            #s = (c)=>t.rpc.author.submitExtrinsic(c?.signedTransaction || this).pipe(Nd((l)=>{
                    this.#a(l, c);
                }));
            #i = (c)=>{
                const l = this.hash;
                return t.rpc.author.submitAndWatchExtrinsic(c?.signedTransaction || this).pipe(it((u)=>this.#r(l, u)), Nd((u)=>{
                    this.#a(u, c);
                }));
            };
            #o = async (c, l, u)=>{
                const d = l.signer || t.signer, f = l.allowCallDataAlteration ?? !0;
                if (!d) throw new Error("No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.");
                const p = this.registry.createTypeUnsafe("SignerPayload", [
                    Ye({}, l, {
                        address: c,
                        blockNumber: u ? u.number : 0,
                        method: this.method
                    })
                ]);
                let h;
                if (Mt(d.signPayload)) {
                    if (h = await d.signPayload(p.toPayload()), h.signedTransaction && !l.withSignedTransaction) throw new Error("The `signedTransaction` field may not be submitted when `withSignedTransaction` is disabled");
                    if (h.signedTransaction && l.withSignedTransaction) {
                        const m = this.registry.createTypeUnsafe("Extrinsic", [
                            h.signedTransaction
                        ]), w = this.registry.createTypeUnsafe("SignerPayload", [
                            Ye({}, {
                                address: c,
                                assetId: m.assetId && m.assetId.isSome ? m.assetId.toHex() : null,
                                blockHash: p.blockHash,
                                blockNumber: u ? u.number : 0,
                                era: m.era.toHex(),
                                genesisHash: p.genesisHash,
                                metadataHash: m.metadataHash ? m.metadataHash.toHex() : null,
                                method: m.method.toHex(),
                                mode: m.mode ? m.mode.toHex() : null,
                                nonce: m.nonce.toHex(),
                                runtimeVersion: p.runtimeVersion,
                                signedExtensions: p.signedExtensions,
                                tip: m.tip ? m.tip.toHex() : null,
                                version: p.version
                            })
                        ]);
                        if (!m.isSigned) throw new Error(`When using the signedTransaction field, the transaction must be signed. Recieved isSigned: ${m.isSigned}`);
                        return f || this.#l(p, m), super.addSignature(c, h.signature, w.toPayload()), {
                            id: h.id,
                            signedTransaction: h.signedTransaction
                        };
                    }
                } else if (Mt(d.signRaw)) h = await d.signRaw(p.toRaw());
                else throw new Error("Invalid signer interface, it should implement either signPayload or signRaw (or both)");
                return super.addSignature(c, h.signature, p.toPayload()), {
                    id: h.id
                };
            };
            #a = (c, l)=>{
                if (l && l.updateId !== -1) {
                    const { options: u, updateId: d } = l, f = u.signer || t.signer;
                    f && Mt(f.update) && f.update(d, c);
                }
            };
            #l = (c, l)=>{
                const u = c.toPayload(), d = (f)=>`signAndSend: ${f} does not match the original payload`;
                if (u.method !== l.method.toHex()) throw new Error(d("call data"));
            };
        }
        return o;
    }
    function KB(t, e, n, r, s) {
        const i = Jtt({
            api: e,
            apiType: t,
            blockHash: s,
            decorateMethod: n
        });
        return (o)=>new i(r || e.registry, o);
    }
    function lQ(t, e) {
        return t.findMetaCall(Dt(e));
    }
    function uQ(t, e) {
        return t.findMetaError(Dt(e));
    }
    const Ytt = {}, dQ = {
        AnchorData: {
            anchoredBlock: "u64",
            docRoot: "H256",
            id: "H256"
        },
        DispatchErrorModule: "DispatchErrorModuleU8",
        PreCommitData: {
            expirationBlock: "u64",
            identity: "H256",
            signingRoot: "H256"
        },
        Fee: {
            key: "Hash",
            price: "Balance"
        },
        MultiAccountData: {
            deposit: "Balance",
            depositor: "AccountId",
            signatories: "Vec<AccountId>",
            threshold: "u16"
        },
        ChainId: "u8",
        DepositNonce: "u64",
        ResourceId: "[u8; 32]",
        "chainbridge::ChainId": "u8",
        RegistryId: "H160",
        TokenId: "U256",
        AssetId: {
            registryId: "RegistryId",
            tokenId: "TokenId"
        },
        AssetInfo: {
            metadata: "Bytes"
        },
        MintInfo: {
            anchorId: "Hash",
            proofs: "Vec<ProofMint>",
            staticHashes: "[Hash; 3]"
        },
        Proof: {
            leafHash: "H256",
            sortedHashes: "H256"
        },
        ProofMint: {
            hashes: "Vec<Hash>",
            property: "Bytes",
            salt: "[u8; 32]",
            value: "Bytes"
        },
        RegistryInfo: {
            fields: "Vec<Bytes>",
            ownerCanBurn: "bool"
        },
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "Governance",
                "Staking",
                "NonProxy"
            ]
        }
    }, $B = {
        ...dQ,
        AccountInfo: "AccountInfoWithRefCount",
        Address: "LookupSource",
        LookupSource: "IndicesLookupSource",
        Multiplier: "Fixed64",
        RefCount: "RefCountTo259"
    }, Qtt = [
        {
            minmax: [
                240,
                243
            ],
            types: {
                ...$B,
                ProxyType: {
                    _enum: [
                        "Any",
                        "NonTransfer",
                        "Governance",
                        "Staking",
                        "Vesting"
                    ]
                }
            }
        },
        {
            minmax: [
                244,
                999
            ],
            types: {
                ...$B
            }
        },
        {
            minmax: [
                1e3,
                void 0
            ],
            types: {
                ...dQ
            }
        }
    ], Fo = {
        CompactAssignments: "CompactAssignmentsWith24",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith24",
        Keys: "SessionKeys6",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "Governance",
                "Staking",
                "IdentityJudgement",
                "CancelProxy",
                "Auction"
            ]
        },
        Weight: "WeightV1"
    }, FS = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "LookupSource",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys5",
        LookupSource: "IndicesLookupSource",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, qu = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys5",
        LookupSource: "AccountId",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, ent = [
        {
            minmax: [
                1019,
                1031
            ],
            types: {
                ...FS,
                BalanceLock: "BalanceLockTo212",
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchError: "DispatchErrorTo198",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                IdentityInfo: "IdentityInfoTo198",
                Keys: "SessionKeys5",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                SlashingSpans: "SlashingSpansTo204",
                StakingLedger: "StakingLedgerTo223",
                Votes: "VotesTo230",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1032,
                1042
            ],
            types: {
                ...FS,
                BalanceLock: "BalanceLockTo212",
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Keys: "SessionKeys5",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                SlashingSpans: "SlashingSpansTo204",
                StakingLedger: "StakingLedgerTo223",
                Votes: "VotesTo230",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1043,
                1045
            ],
            types: {
                ...FS,
                BalanceLock: "BalanceLockTo212",
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Keys: "SessionKeys5",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo223",
                Votes: "VotesTo230",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1046,
                1049
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo223",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1050,
                1054
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo240",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1055,
                1056
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo240",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1057,
                1061
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Scheduled: "ScheduledTo254"
            }
        },
        {
            minmax: [
                1062,
                2012
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2013,
                2022
            ],
            types: {
                ...Fo,
                ...qu,
                CompactAssignments: "CompactAssignmentsTo257",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2023,
                2024
            ],
            types: {
                ...Fo,
                ...qu,
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2025,
                2027
            ],
            types: {
                ...Fo,
                ...qu
            }
        },
        {
            minmax: [
                2028,
                2029
            ],
            types: {
                ...Fo,
                AccountInfo: "AccountInfoWithDualRefCount",
                CompactAssignments: "CompactAssignmentsWith16",
                RawSolution: "RawSolutionWith16"
            }
        },
        {
            minmax: [
                2030,
                9e3
            ],
            types: {
                ...Fo,
                CompactAssignments: "CompactAssignmentsWith16",
                RawSolution: "RawSolutionWith16"
            }
        },
        {
            minmax: [
                9010,
                9099
            ],
            types: {
                ...Fo,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...Fo,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], tnt = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {
                Weight: "WeightV2"
            }
        }
    ], nnt = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {
                Weight: "WeightV2"
            }
        }
    ], df = {
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys6",
        ProxyType: {
            _enum: {
                Any: 0,
                NonTransfer: 1,
                Governance: 2,
                Staking: 3,
                UnusedSudoBalances: 4,
                IdentityJudgement: 5,
                CancelProxy: 6,
                Auction: 7
            }
        },
        Weight: "WeightV1"
    }, Bb = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        DispatchErrorModule: "DispatchErrorModuleU8",
        Keys: "SessionKeys5",
        LookupSource: "AccountId",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, rnt = [
        {
            minmax: [
                0,
                10
            ],
            types: {
                ...df,
                ...Bb,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ElectionResult: "ElectionResultToSpec10"
            }
        },
        {
            minmax: [
                11,
                12
            ],
            types: {
                ...df,
                ...Bb,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                13,
                22
            ],
            types: {
                ...df,
                ...Bb,
                CompactAssignments: "CompactAssignmentsTo257",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                23,
                24
            ],
            types: {
                ...df,
                ...Bb,
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                25,
                27
            ],
            types: {
                ...df,
                ...Bb
            }
        },
        {
            minmax: [
                28,
                29
            ],
            types: {
                ...df,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                30,
                9109
            ],
            types: {
                ...df
            }
        },
        {
            minmax: [
                9110,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], Fb = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        FullIdentification: "()",
        Keys: "SessionKeys7B",
        Weight: "WeightV1"
    }, snt = [
        {
            minmax: [
                0,
                200
            ],
            types: {
                ...Fb,
                AccountInfo: "AccountInfoWithDualRefCount",
                Address: "AccountId",
                LookupSource: "AccountId"
            }
        },
        {
            minmax: [
                201,
                214
            ],
            types: {
                ...Fb,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                215,
                228
            ],
            types: {
                ...Fb,
                Keys: "SessionKeys6"
            }
        },
        {
            minmax: [
                229,
                9099
            ],
            types: {
                ...Fb,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...Fb,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], int = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {}
        }
    ], XB = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, ont = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...XB,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...XB,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                500,
                9999
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                1e4,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], GB = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, ant = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...GB,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...GB,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                500,
                1001003
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                1002e3,
                void 0
            ],
            types: {
                Weight: "WeightV1",
                ...Zi("V4")
            }
        }
    ], Wu = {
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys6",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "Staking",
                "SudoBalances",
                "IdentityJudgement",
                "CancelProxy"
            ]
        },
        Weight: "WeightV1"
    }, Lb = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        LookupSource: "AccountId",
        Keys: "SessionKeys5",
        RawSolution: "RawSolutionWith16",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, cnt = [
        {
            minmax: [
                1,
                2
            ],
            types: {
                ...Wu,
                ...Lb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Weight: "u32"
            }
        },
        {
            minmax: [
                3,
                22
            ],
            types: {
                ...Wu,
                ...Lb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                23,
                42
            ],
            types: {
                ...Wu,
                ...Lb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                43,
                44
            ],
            types: {
                ...Wu,
                ...Lb,
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                45,
                47
            ],
            types: {
                ...Wu,
                ...Lb
            }
        },
        {
            minmax: [
                48,
                49
            ],
            types: {
                ...Wu,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                50,
                9099
            ],
            types: {
                ...Wu,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...Wu,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], ZB = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, lnt = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...ZB,
                ...Zi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...ZB,
                ...Zi("V1")
            }
        },
        {
            minmax: [
                500,
                9434
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                9435,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], unt = {
        "centrifuge-chain": Qtt,
        kusama: ent,
        node: tnt,
        "node-template": nnt,
        polkadot: rnt,
        rococo: snt,
        shell: int,
        statemine: ont,
        statemint: ant,
        westend: cnt,
        westmint: lnt
    }, dnt = [
        [
            0,
            1020,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            26669,
            1021,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            38245,
            1022,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            54248,
            1023,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            59659,
            1024,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            67651,
            1025,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            82191,
            1027,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            83238,
            1028,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            101503,
            1029,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            203466,
            1030,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            295787,
            1031,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            461692,
            1032,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            504329,
            1033,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            569327,
            1038,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    1
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            587687,
            1039,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            653183,
            1040,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            693488,
            1042,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            901442,
            1045,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1375086,
            1050,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1445458,
            1051,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1472960,
            1052,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1475648,
            1053,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1491596,
            1054,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1574408,
            1055,
            [
                [
                    "0xdf6acb689907609b",
                    2
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    1
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2064961,
            1058,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2201991,
            1062,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2671528,
            2005,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2704202,
            2007,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2728002,
            2008,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2832534,
            2011,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2962294,
            2012,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            324e4,
            2013,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3274408,
            2015,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3323565,
            2019,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3534175,
            2022,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3860281,
            2023,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4143129,
            2024,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4401242,
            2025,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4841367,
            2026,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5961600,
            2027,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6137912,
            2028,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6561855,
            2029,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7100891,
            2030,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7468792,
            9010,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7668600,
            9030,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7812476,
            9040,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8010981,
            9050,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8073833,
            9070,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8555825,
            9080,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8945245,
            9090,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9611377,
            9100,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9625129,
            9111,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9866422,
            9122,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10403784,
            9130,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10960765,
            9150,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11006614,
            9151,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11404482,
            9160,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11601803,
            9170,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            12008022,
            9180,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            12405451,
            9190,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            12665416,
            9200,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            12909508,
            9220,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            13109752,
            9230,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            13555777,
            9250,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            13727747,
            9260,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            14248044,
            9271,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            14433840,
            9280,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            14645900,
            9291,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            15048375,
            9300,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            15426015,
            9320,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            15680713,
            9340,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            15756296,
            9350,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            15912007,
            9360,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            16356547,
            9370,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            17335450,
            9381,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    3
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            18062739,
            9420,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            18625e3,
            9430,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            20465806,
            1e6,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    5
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            2157e4,
            1001e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    7
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21786291,
            1001002,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    7
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            22515962,
            1001003,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    7
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            2279e4,
            1002e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23176015,
            1002001,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23450253,
            1002004,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23565293,
            1002005,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23780224,
            1002006,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            24786390,
            1003e3,
            [
                [
                    "0xc51ff1fa3f5d0cca",
                    1
                ],
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ]
    ], fnt = [
        [
            0,
            0,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            29231,
            1,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            188836,
            5,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            199405,
            6,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            214264,
            7,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            244358,
            8,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            303079,
            9,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            314201,
            10,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            342400,
            11,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            443963,
            12,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            528470,
            13,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            687751,
            14,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            746085,
            15,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            787923,
            16,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            799302,
            17,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1205128,
            18,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1603423,
            23,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1733218,
            24,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2005673,
            25,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2436698,
            26,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3613564,
            27,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3899547,
            28,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4345767,
            29,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4876134,
            30,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5661442,
            9050,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6321619,
            9080,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6713249,
            9090,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7217907,
            9100,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7229126,
            9110,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7560558,
            9122,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8115869,
            9140,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8638103,
            9151,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9280179,
            9170,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9738717,
            9180,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10156856,
            9190,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10458576,
            9200,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10655116,
            9220,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10879371,
            9230,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11328884,
            9250,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11532856,
            9260,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11933818,
            9270,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            12217535,
            9280,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ]
            ]
        ],
        [
            12245277,
            9281,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ]
            ]
        ],
        [
            12532644,
            9291,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ]
            ]
        ],
        [
            12876189,
            9300,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ]
            ]
        ],
        [
            13800015,
            9340,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ]
            ]
        ],
        [
            14188833,
            9360,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ]
            ]
        ],
        [
            14543918,
            9370,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ]
            ]
        ],
        [
            15978362,
            9420,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ]
            ]
        ],
        [
            1645e4,
            9430,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ]
            ]
        ],
        [
            1784e4,
            9431,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ]
            ]
        ],
        [
            18407475,
            1000001,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    5
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ]
            ]
        ],
        [
            19551e3,
            1001002,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    5
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            20181758,
            1001003,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    5
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            20438530,
            1002e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21169168,
            1002004,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21455374,
            1002005,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21558004,
            1002006,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21800141,
            1002007,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ]
    ], pnt = [
        [
            214356,
            4,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    1
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            392764,
            7,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            409740,
            8,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            809976,
            20,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            877581,
            24,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            879238,
            25,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            889472,
            26,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            902937,
            27,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            932751,
            28,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            991142,
            29,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1030162,
            31,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1119657,
            32,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1199282,
            33,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1342534,
            34,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1392263,
            35,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1431703,
            36,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1433369,
            37,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            1490972,
            41,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2087397,
            43,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2316688,
            44,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            2549864,
            45,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3925782,
            46,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            3925843,
            47,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4207800,
            48,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            4627944,
            49,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5124076,
            50,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5478664,
            900,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5482450,
            9e3,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    4
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5584305,
            9010,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5784566,
            9030,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5879822,
            9031,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5896856,
            9032,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            5897316,
            9033,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6117927,
            9050,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6210274,
            9070,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    2
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6379314,
            9080,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    2
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            6979141,
            9090,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7568453,
            9100,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7766394,
            9111,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7911691,
            9120,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7968866,
            9121,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            7982889,
            9122,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            8514322,
            9130,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9091726,
            9140,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9091774,
            9150,
            [
                [
                    "0xdf6acb689907609b",
                    3
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    1
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9406726,
            9160,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            9921066,
            9170,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10007115,
            9180,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    5
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10480973,
            9190,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10578091,
            9200,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10678509,
            9210,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            10811001,
            9220,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11096116,
            9230,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11409279,
            9250,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11584820,
            9251,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11716837,
            9260,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11876919,
            9261,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ]
            ]
        ],
        [
            11987927,
            9270,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            12077324,
            9271,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            12301871,
            9280,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            12604343,
            9290,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    2
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            12841034,
            9300,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13128237,
            9310,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    1
                ],
                [
                    "0xf3ff14d5ab527059",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13272363,
            9320,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13483497,
            9330,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13649433,
            9340,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13761100,
            9350,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            13847400,
            9360,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            14249200,
            9370,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    2
                ],
                [
                    "0xf3ff14d5ab527059",
                    2
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            14576855,
            9380,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    3
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    3
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ]
            ]
        ],
        [
            14849830,
            9390,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    1
                ],
                [
                    "0x91d5df18b0d2cf58",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    3
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            15146832,
            9400,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    3
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            15332317,
            9401,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    1
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    3
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            15661793,
            9420,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            16165469,
            9430,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    4
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    2
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ]
            ]
        ],
        [
            18293984,
            102e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    7
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            18293991,
            103e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    8
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            18451783,
            104e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    9
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            18679741,
            1005e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    9
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            19166695,
            1006e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            19234157,
            1006001,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            19542944,
            1007e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            19621258,
            1007001,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            19761406,
            1008e3,
            [
                [
                    "0xdf6acb689907609b",
                    4
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            20056997,
            1009e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            20368318,
            101e4,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    10
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            20649086,
            1011e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21217837,
            1011001,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21300429,
            1013e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21460051,
            1014e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    3
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            21925427,
            1015e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    4
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            22500517,
            1016e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    5
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            22759684,
            1016001,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    5
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23056976,
            1016002,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    5
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ]
            ]
        ],
        [
            23544582,
            1017e3,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    5
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ],
                [
                    "0x2609be83ac4468dc",
                    1
                ]
            ]
        ],
        [
            24002343,
            1017001,
            [
                [
                    "0xdf6acb689907609b",
                    5
                ],
                [
                    "0x37e397fc7c91f5e4",
                    2
                ],
                [
                    "0x40fe3ad401f8959a",
                    6
                ],
                [
                    "0xd2bc9897eed08f15",
                    3
                ],
                [
                    "0xf78b278be53f454c",
                    2
                ],
                [
                    "0xaf2c0297a23e6d3d",
                    11
                ],
                [
                    "0x49eaaf1b548a0cb0",
                    5
                ],
                [
                    "0x91d5df18b0d2cf58",
                    2
                ],
                [
                    "0x2a5e924655399e60",
                    1
                ],
                [
                    "0xed99c5acb25eedf5",
                    3
                ],
                [
                    "0xcbca25e39f142387",
                    2
                ],
                [
                    "0x687ad44ad37f03c2",
                    1
                ],
                [
                    "0xab3c0572291feb8b",
                    1
                ],
                [
                    "0xbc9d89904f5b923f",
                    1
                ],
                [
                    "0x37c8bb1350a9a2a8",
                    4
                ],
                [
                    "0xf3ff14d5ab527059",
                    3
                ],
                [
                    "0x6ff52ee858e6c5bd",
                    1
                ],
                [
                    "0x91b1c8b16328eb92",
                    1
                ],
                [
                    "0x9ffb505aa738d69c",
                    1
                ],
                [
                    "0x17a6bc0d0062aeb3",
                    1
                ],
                [
                    "0x18ef58a3b67ba770",
                    1
                ],
                [
                    "0xfbc577b9d747efd6",
                    1
                ],
                [
                    "0x2609be83ac4468dc",
                    1
                ]
            ]
        ]
    ], hnt = Object.freeze(Object.defineProperty({
        __proto__: null,
        kusama: dnt,
        polkadot: fnt,
        westend: pnt
    }, Symbol.toStringTag, {
        value: "Module"
    })), gnt = {
        westend: {
            genesisHash: [
                "0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"
            ]
        }
    };
    function bnt([t, e]) {
        const n = aUe.find((r)=>r.network === t) || gnt[t];
        if (!n) throw new Error(`Unable to find info for chain ${t}`);
        return {
            genesisHash: Hc(n.genesisHash[0]),
            network: t,
            versions: e.map(([r, s, i])=>({
                    apis: i,
                    blockNumber: new ht(r),
                    specVersion: new ht(s)
                }))
        };
    }
    const mnt = Object.entries(hnt).map(bnt);
    function nb(t, e, n) {
        return n(t.toString(), e.toString());
    }
    function e_(t = [], e) {
        return t.filter(({ minmax: [n, r] })=>(n == null || e >= n) && (r == null || e <= r)).reduce((n, { types: r })=>({
                ...n,
                ...r
            }), {});
    }
    function ynt({ knownTypes: t }, e, n) {
        return nb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.signedExtensions ?? {},
                ...t.typesBundle?.chain?.[r]?.signedExtensions ?? {}
            }));
    }
    function wnt({ knownTypes: t }, e, n, r) {
        const s = Ms(r).toNumber();
        return nb(e, n, (i, o)=>({
                ...e_(unt[o], s),
                ...e_(Ytt[i], s),
                ...e_(t.typesBundle?.spec?.[o]?.types, s),
                ...e_(t.typesBundle?.chain?.[i]?.types, s),
                ...t.typesSpec?.[o] ?? {},
                ...t.typesChain?.[i] ?? {},
                ...t.types ?? {}
            }));
    }
    function _nt({ knownTypes: t }, e, n) {
        return nb(e, n, (r, s)=>t.hasher || t.typesBundle?.chain?.[r]?.hasher || t.typesBundle?.spec?.[s]?.hasher || null);
    }
    function JB({ knownTypes: t }, e, n) {
        return nb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.rpc ?? {},
                ...t.typesBundle?.chain?.[r]?.rpc ?? {}
            }));
    }
    function xnt({ knownTypes: t }, e, n) {
        return nb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.runtime ?? {},
                ...t.typesBundle?.chain?.[r]?.runtime ?? {}
            }));
    }
    function vnt({ knownTypes: t }, e, n) {
        return nb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.alias ?? {},
                ...t.typesBundle?.chain?.[r]?.alias ?? {},
                ...t.typesAlias ?? {}
            }));
    }
    function Snt(t, e) {
        const n = mnt.find((r)=>t.eq(r.genesisHash));
        return n ? [
            n.versions.reduce((r, s)=>e.gt(s.blockNumber) ? s : r, void 0),
            n.versions.find((r)=>e.lte(r.blockNumber))
        ] : [
            void 0,
            void 0
        ];
    }
    const knt = ma("api/augment");
    function YB(t, e, n = []) {
        return e.length ? ` ${e.length} ${t}${n.length ? " and" : ""}` : "";
    }
    function QB(t, e) {
        return e.length ? `
	${t.padStart(7)}: ${e.sort().join(", ")}` : "";
    }
    function eF(t, e, [n, r]) {
        (n.length || r.length) && knt.warn(`api.${t}: Found${YB("added", n, r)}${YB("removed", r)} ${e}:${QB("added", n)}${QB("removed", r)}`);
    }
    function tF(t, e) {
        return t.filter((n)=>!e.includes(n));
    }
    function Tnt(t, e) {
        return t.filter((n)=>e.includes(n));
    }
    function Cnt(t, e) {
        const n = Object.keys(t), r = Object.keys(e);
        return [
            tF(n, r),
            tF(r, n)
        ];
    }
    function nF(t, e) {
        const n = Object.keys(t), r = Tnt(Object.keys(e), n), s = [];
        for(let i = 0, o = r.length; i < o; i++){
            const a = r[i], c = Object.keys(t[a]), l = Object.keys(e[a]);
            for(let u = 0, d = l.length; u < d; u++){
                const f = l[u];
                c.includes(f) || s.push(`${a}.${f}`);
            }
        }
        return s;
    }
    function Ent(t, e) {
        return [
            nF(e, t),
            nF(t, e)
        ];
    }
    function dc(t, e, n, r = !1) {
        r && eze(n), t && Object.keys(n).length && (eF(t, "modules", Cnt(e, n)), eF(t, "calls", Ent(e, n)));
        const s = Object.keys(e);
        for(let i = 0, o = s.length; i < o; i++){
            const a = s[i], c = e[a];
            n[a] || (n[a] = {}), Zf(n[a], Object.keys(c), (l)=>c[l]);
        }
        return n;
    }
    function rF({ lookup: t }, { method: e, section: n }, r) {
        return `${n}.${e}(${r.map((s)=>t.getTypeDef(s).type).join(", ")})`;
    }
    function t_(t, e, n) {
        const r = n.filter((s)=>!Rr(s));
        if (e.meta.type.isPlain) {
            if (r.length !== 0) throw new Error(`${rF(t, e, [])} does not take any arguments, ${r.length} found`);
        } else {
            const { hashers: s, key: i } = e.meta.type.asMap, o = s.length === 1 ? [
                i
            ] : t.lookup.getSiType(i).def.asTuple.map((a)=>a);
            if (r.length !== o.length) throw new Error(`${rF(t, e, o)} is a map, requiring ${o.length} arguments, ${r.length} found`);
        }
        return [
            e,
            r
        ];
    }
    class Int {
        #e = new VJ;
        emit(e, ...n) {
            return this.#e.emit(e, ...n);
        }
        on(e, n) {
            return this.#e.on(e, n), this;
        }
        off(e, n) {
            return this.#e.removeListener(e, n), this;
        }
        once(e, n) {
            return this.#e.once(e, n), this;
        }
    }
    const n_ = 1e3, LS = 250, Ant = 50, zS = ma("api/init");
    let Pnt = 0;
    function US(t, { method: e, section: n }) {
        return Zu(t.rx.query[n] && t.rx.query[n][e], ()=>`query.${n}.${e} is not available in this version of the metadata`);
    }
    class Ont extends Int {
        #e;
        #t = {};
        #n;
        #r = [];
        #s = [];
        __phantom = new ht(0);
        _type;
        _call = {};
        _consts = {};
        _derive;
        _errors = {};
        _events = {};
        _extrinsics;
        _extrinsicType = $A.LATEST_EXTRINSIC_VERSION;
        _genesisHash;
        _isConnected;
        _isReady = !1;
        _query = {};
        _queryMulti;
        _rpc;
        _rpcCore;
        _runtimeMap = {};
        _runtimeChain;
        _runtimeMetadata;
        _runtimeVersion;
        _rx = {
            call: {},
            consts: {},
            query: {},
            tx: {}
        };
        _options;
        _decorateMethod;
        constructor(e, n, r){
            super(), this.#e = `${++Pnt}`, this.#n = e.source?.registry || e.registry || new UY, this._rx.callAt = (i, o)=>Tc(this.at(i, o)).pipe(ve((a)=>a.rx.call)), this._rx.queryAt = (i, o)=>Tc(this.at(i, o)).pipe(ve((a)=>a.rx.query)), this._rx.registry = this.#n, this._decorateMethod = r, this._options = e, this._type = n;
            const s = e.source ? e.source._rpcCore.provider.isClonable ? e.source._rpcCore.provider.clone() : e.source._rpcCore.provider : e.provider || new K3;
            this._rpcCore = new tZe(this.#e, this.#n, {
                isPedantic: this._options.isPedantic,
                provider: s,
                rpcCacheCapacity: this._options.rpcCacheCapacity,
                ttl: this._options.provider?.ttl,
                userRpc: this._options.rpc
            }), this._isConnected = new Sy(this._rpcCore.provider.isConnected), this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
        }
        get registry() {
            return this.#n;
        }
        createType(e, ...n) {
            return this.#n.createType(e, ...n);
        }
        registerTypes(e) {
            e && this.#n.register(e);
        }
        get hasSubscriptions() {
            return this._rpcCore.provider.hasSubscriptions;
        }
        get supportMulti() {
            return this._rpcCore.provider.hasSubscriptions || !!this._rpcCore.state.queryStorageAt;
        }
        _emptyDecorated(e, n) {
            return {
                call: {},
                consts: {},
                errors: {},
                events: {},
                query: {},
                registry: e,
                rx: {
                    call: {},
                    query: {}
                },
                tx: KB(this._type, this._rx, this._decorateMethod, e, n)
            };
        }
        _createDecorated(e, n, r, s) {
            r || (r = this._emptyDecorated(e.registry, s)), (n || !e.decoratedMeta) && (e.decoratedMeta = jGe(e.registry, e.metadata));
            const i = this._decorateCalls(e, this._decorateMethod, s), o = this._decorateCalls(e, this._rxDecorateMethod, s), a = this._decorateStorage(e.decoratedMeta, this._decorateMethod, s), c = this._decorateStorage(e.decoratedMeta, this._rxDecorateMethod, s);
            return dc("consts", e.decoratedMeta.consts, r.consts, n), dc("errors", e.decoratedMeta.errors, r.errors, n), dc("events", e.decoratedMeta.events, r.events, n), dc("query", a, r.query, n), dc("query", c, r.rx.query, n), dc("call", i, r.call, n), dc("call", o, r.rx.call, n), r.findCall = (l)=>lQ(e.registry, l), r.findError = (l)=>uQ(e.registry, l), r.queryMulti = s ? this._decorateMultiAt(r, this._decorateMethod, s) : this._decorateMulti(this._decorateMethod), r.runtimeVersion = e.runtimeVersion, {
                createdAt: s,
                decoratedApi: r,
                decoratedMeta: e.decoratedMeta
            };
        }
        _injectMetadata(e, n = !1) {
            (n || !e.decoratedApi) && (e.decoratedApi = this._emptyDecorated(e.registry));
            const { decoratedApi: r, decoratedMeta: s } = this._createDecorated(e, n, e.decoratedApi);
            this._call = r.call, this._consts = r.consts, this._errors = r.errors, this._events = r.events, this._query = r.query, this._rx.call = r.rx.call, this._rx.query = r.rx.query;
            const i = this._decorateExtrinsics(s, this._decorateMethod), o = this._decorateExtrinsics(s, this._rxDecorateMethod);
            n || !this._extrinsics ? (this._extrinsics = i, this._rx.tx = o) : (dc("tx", i, this._extrinsics, !1), dc(null, o, this._rx.tx, !1)), dc(null, s.consts, this._rx.consts, n), this.emit("decorated");
        }
        injectMetadata(e, n, r) {
            this._injectMetadata({
                counter: 0,
                metadata: e,
                registry: r || this.#n,
                runtimeVersion: this.#n.createType("RuntimeVersionPartial")
            }, n);
        }
        _decorateFunctionMeta(e, n) {
            return n.meta = e.meta, n.method = e.method, n.section = e.section, n.toJSON = e.toJSON, e.callIndex && (n.callIndex = e.callIndex), n;
        }
        _filterRpc(e, n) {
            Object.keys(n).length !== 0 && (this._rpcCore.addUserInterfaces(n), this._decorateRpc(this._rpcCore, this._decorateMethod, this._rpc), this._decorateRpc(this._rpcCore, this._rxDecorateMethod, this._rx.rpc));
            const r = {};
            for(let i = 0, o = e.length; i < o; i++){
                const [a] = e[i].split("_");
                r[a] = !0;
            }
            const s = Object.keys(r);
            for(let i = 0, o = s.length; i < o; i++){
                const a = rze(s[i]), c = `${a}Api`;
                this._runtimeMap[cm(a, 64)] = a, this._runtimeMap[cm(c, 64)] = c;
            }
            this._filterRpcMethods(e);
        }
        _filterRpcMethods(e) {
            const n = e.length !== 0, r = [
                ...this._rpcCore.mapping.entries()
            ], s = [], i = r.length;
            for(let a = 0; a < i; a++){
                const [, { alias: c, endpoint: l, method: u, pubsub: d, section: f }] = r[a];
                s.push(`${f}_${u}`), d && (s.push(`${f}_${d[1]}`), s.push(`${f}_${d[2]}`)), c && s.push(...c), l && s.push(l);
            }
            const o = e.filter((a)=>!s.includes(a) && !a.includes("_unstable_"));
            o.length && !this._options.noInitWarn && zS.warn(`RPC methods not decorated: ${o.join(", ")}`);
            for(let a = 0; a < i; a++){
                const [c, { method: l, section: u }] = r[a];
                n && !e.includes(c) && c !== "rpc_methods" && this._rpc[u] && (delete this._rpc[u][l], delete this._rx.rpc[u][l]);
            }
        }
        _rpcSubmitter(e) {
            return e((r, ...s)=>Tc(this._rpcCore.provider.send(r, s)));
        }
        _decorateRpc(e, n, r = this._rpcSubmitter(n)) {
            const s = r, i = (o, a)=>{
                const c = e[o][a], l = n(c, {
                    methodName: a
                });
                return l.meta = c.meta, l.raw = n(c.raw, {
                    methodName: a
                }), l;
            };
            for(let o = 0, a = e.sections.length; o < a; o++){
                const c = e.sections[o];
                if (!Object.prototype.hasOwnProperty.call(s, c)) {
                    const l = Object.keys(e[c]), u = (d)=>i(c, d);
                    for(let d = 0, f = l.length; d < f; d++){
                        const p = l[d];
                        (this.hasSubscriptions || !(p.startsWith("subscribe") || p.startsWith("unsubscribe"))) && (Object.prototype.hasOwnProperty.call(s, c) || (s[c] = {}), ni(s[c], p, u));
                    }
                }
            }
            return s;
        }
        _addRuntimeDef(e, n) {
            if (!n) return;
            const r = Object.entries(n);
            for(let s = 0, i = r.length; s < i; s++){
                const [o, a] = r[s];
                if (e[o]) for(let c = 0, l = a.length; c < l; c++){
                    const u = a[c], d = e[o].find(({ version: f })=>u.version === f);
                    d ? Ye(d.methods, u.methods) : e[o].push(u);
                }
                else e[o] = a;
            }
        }
        _getRuntimeDefs(e, n, r = "") {
            const s = {}, i = Object.values(vx);
            for(let o = 0, a = i.length; o < a; o++)this._addRuntimeDef(s, i[o].runtime);
            return this._addRuntimeDef(s, xnt(e, r, n)), this._addRuntimeDef(s, this._options.runtime), Object.entries(s);
        }
        _getMethods(e, n) {
            const r = {};
            return n.forEach((s)=>{
                const { docs: i, inputs: o, name: a, output: c } = s;
                r[a.toString()] = {
                    description: i.map((l)=>l.toString()).join(),
                    params: o.map(({ name: l, type: u })=>({
                            name: l.toString(),
                            type: e.lookup.getName(u) || e.lookup.getTypeDef(u).type
                        })),
                    type: e.lookup.getName(c) || e.lookup.getTypeDef(c).type
                };
            }), r;
        }
        _getRuntimeDefsViaMetadata(e) {
            const n = {}, { apis: r } = e.metadata;
            for(let s = 0, i = r.length; s < i; s++){
                const { methods: o, name: a } = r[s];
                n[a.toString()] = [
                    {
                        methods: this._getMethods(e, o),
                        version: 0
                    }
                ];
            }
            return Object.entries(n);
        }
        _decorateCalls({ registry: e, runtimeVersion: { apis: n, specName: r, specVersion: s } }, i, o) {
            const a = {}, c = {}, l = {}, u = e.metadata.apis.length > 0, d = u ? this._getRuntimeDefsViaMetadata(e) : this._getRuntimeDefs(e, r, this._runtimeChain), f = [], p = `${r.toString()}/${s.toString()}`, h = this.#t[p] || !1;
            if (this.#t[p] = !0, u) for(let k = 0, _ = d.length; k < _; k++){
                const [A, P] = d[k], U = P[0], K = cm(A, 64), X = tr(A), G = Object.entries(U.methods);
                c[X] || (c[X] = {});
                for(let ce = 0, ie = G.length; ce < ie; ce++){
                    const [Y, M] = G[ce], g = tr(Y);
                    c[X][g] = Ye({
                        method: g,
                        name: `${A}_${Y}`,
                        section: X,
                        sectionHash: K
                    }, M);
                }
            }
            else {
                for(let _ = 0, A = d.length; _ < A; _++){
                    const [P, U] = d[_], K = cm(P, 64), X = n.find(([G])=>G.eq(K));
                    if (l[K] = !0, X) {
                        const G = U.map(({ version: ie })=>ie).sort(), ce = U.find(({ version: ie })=>X[1].eq(ie));
                        if (ce) {
                            const ie = tr(P), Y = Object.entries(ce.methods);
                            if (Y.length) {
                                c[ie] || (c[ie] = {});
                                for(let M = 0, g = Y.length; M < g; M++){
                                    const [y, C] = Y[M], R = tr(y);
                                    c[ie][R] = Ye({
                                        method: R,
                                        name: `${P}_${y}`,
                                        section: ie,
                                        sectionHash: K
                                    }, C);
                                }
                            }
                        } else f.push(`${P}/${X[1].toString()} (${G.join("/")} known)`);
                    }
                }
                const k = n.map(([_, A])=>[
                        _.toHex(),
                        A.toString()
                    ]).filter(([_])=>!l[_]).map(([_, A])=>`${this._runtimeMap[_] || _}/${A}`);
                !this._options.noInitWarn && !h && (f.length && zS.warn(`${p}: Not decorating runtime apis without matching versions: ${f.join(", ")}`), k.length && zS.warn(`${p}: Not decorating unknown runtime apis: ${k.join(", ")}`));
            }
            const m = o ? (k, _)=>this._rpcCore.state.call(k, _, o) : (k, _)=>this._rpcCore.state.call(k, _), w = (k)=>Zf({}, Object.keys(c[k]), (_)=>this._decorateCall(e, c[k][_], m, i)), v = Object.keys(c);
            for(let k = 0, _ = v.length; k < _; k++)ni(a, v[k], w);
            return a;
        }
        _decorateCall(e, n, r, s) {
            const i = s((...o)=>{
                if (o.length !== n.params.length) throw new Error(`${n.name}:: Expected ${n.params.length} arguments, found ${o.length}`);
                const a = e.createType("Raw", Po(o.map((c, l)=>e.createTypeUnsafe(n.params[l].type, [
                        c
                    ]).toU8a())));
                return r(n.name, a).pipe(ve((c)=>e.createTypeUnsafe(n.type, [
                        c
                    ])));
            });
            return i.meta = n, i;
        }
        _decorateMulti(e) {
            return e((n)=>n.length ? (this.hasSubscriptions ? this._rpcCore.state.subscribeStorage : this._rpcCore.state.queryStorageAt)(n.map((r)=>Array.isArray(r) ? r[0].creator.meta.type.isPlain ? [
                        r[0].creator
                    ] : r[0].creator.meta.type.asMap.hashers.length === 1 ? [
                        r[0].creator,
                        r.slice(1)
                    ] : [
                        r[0].creator,
                        ...r.slice(1)
                    ] : [
                        r.creator
                    ])) : Te([]));
        }
        _decorateMultiAt(e, n, r) {
            return n((s)=>s.length ? this._rpcCore.state.queryStorageAt(s.map((i)=>{
                    if (Array.isArray(i)) {
                        const { creator: o } = US(e, i[0].creator);
                        return o.meta.type.isPlain ? [
                            o
                        ] : o.meta.type.asMap.hashers.length === 1 ? [
                            o,
                            i.slice(1)
                        ] : [
                            o,
                            ...i.slice(1)
                        ];
                    }
                    return [
                        US(e, i.creator).creator
                    ];
                }), r) : Te([]));
        }
        _decorateExtrinsics({ tx: e }, n) {
            const r = KB(this._type, this._rx, n), s = (o)=>Zf({}, Object.keys(e[o]), (a)=>a.startsWith("$") ? e[o][a] : this._decorateExtrinsicEntry(e[o][a], r)), i = Object.keys(e);
            for(let o = 0, a = i.length; o < a; o++)ni(r, i[o], s);
            return r;
        }
        _decorateExtrinsicEntry(e, n) {
            const r = (...s)=>n(e(...s));
            return r.is = (s)=>e.is(s), this._decorateFunctionMeta(e, r);
        }
        _decorateStorage({ query: e, registry: n }, r, s) {
            const i = {}, o = (c)=>Zf({}, Object.keys(e[c]), (l)=>s ? this._decorateStorageEntryAt(n, e[c][l], r, s) : this._decorateStorageEntry(e[c][l], r)), a = Object.keys(e);
            for(let c = 0, l = a.length; c < l; c++)ni(i, a[c], o);
            return i;
        }
        _decorateStorageEntry(e, n) {
            const r = (o, a)=>t_(a || this.#n, e, o), s = (o)=>Tc(this.at(o)).pipe(ve((a)=>US(a, e))), i = this._decorateStorageCall(e, n);
            return i.creator = e, i.at = n((o, ...a)=>s(o).pipe(it((c)=>c(...a)))), i.hash = n((...o)=>this._rpcCore.state.getStorageHash(r(o))), i.is = (o)=>o.section === e.section && o.method === e.method, i.key = (...o)=>nn(mx(e(...o))[1]), i.keyPrefix = (...o)=>nn(e.keyPrefix(...o)), i.size = n((...o)=>this._rpcCore.state.getStorageSize(r(o))), i.sizeAt = n((o, ...a)=>s(o).pipe(it((c)=>this._rpcCore.state.getStorageSize(r(a, c.creator.meta.registry), o)))), e.iterKey && e.meta.type.isMap && (i.entries = n(Be(this.#e, (...o)=>this._retrieveMapEntries(e, null, o))), i.entriesAt = n(Be(this.#e, (o, ...a)=>s(o).pipe(it((c)=>this._retrieveMapEntries(c.creator, o, a))))), i.entriesPaged = n(Be(this.#e, (o)=>this._retrieveMapEntriesPaged(e, void 0, o))), i.keys = n(Be(this.#e, (...o)=>this._retrieveMapKeys(e, null, o))), i.keysAt = n(Be(this.#e, (o, ...a)=>s(o).pipe(it((c)=>this._retrieveMapKeys(c.creator, o, a))))), i.keysPaged = n(Be(this.#e, (o)=>this._retrieveMapKeysPaged(e, void 0, o)))), this.supportMulti && e.meta.type.isMap && (i.multi = n((o)=>e.meta.type.asMap.hashers.length === 1 ? this._retrieveMulti(o.map((a)=>[
                        e,
                        [
                            a
                        ]
                    ])) : this._retrieveMulti(o.map((a)=>[
                        e,
                        a
                    ])))), this._decorateFunctionMeta(e, i);
        }
        _decorateStorageEntryAt(e, n, r, s) {
            const i = (a)=>t_(e, n, a), o = r((...a)=>this._rpcCore.state.getStorage(i(a), s));
            return o.creator = n, o.hash = r((...a)=>this._rpcCore.state.getStorageHash(i(a), s)), o.is = (a)=>a.section === n.section && a.method === n.method, o.key = (...a)=>nn(mx(n(...a))[1]), o.keyPrefix = (...a)=>nn(n.keyPrefix(...a)), o.size = r((...a)=>this._rpcCore.state.getStorageSize(i(a), s)), n.iterKey && n.meta.type.isMap && (o.entries = r(Be(this.#e, (...a)=>this._retrieveMapEntries(n, s, a))), o.entriesPaged = r(Be(this.#e, (a)=>this._retrieveMapEntriesPaged(n, s, a))), o.keys = r(Be(this.#e, (...a)=>this._retrieveMapKeys(n, s, a))), o.keysPaged = r(Be(this.#e, (a)=>this._retrieveMapKeysPaged(n, s, a)))), this.supportMulti && n.meta.type.isMap && (o.multi = r((a)=>n.meta.type.asMap.hashers.length === 1 ? this._retrieveMulti(a.map((c)=>[
                        n,
                        [
                            c
                        ]
                    ]), s) : this._retrieveMulti(a.map((c)=>[
                        n,
                        c
                    ]), s))), this._decorateFunctionMeta(n, o);
        }
        _queueStorage(e, n) {
            const r = n === this.#s ? this._rpcCore.state.subscribeStorage : this._rpcCore.state.queryStorageAt;
            let s = n.length - 1, i = 0, o;
            return s === -1 || !n[s] || n[s][1].length === Ant ? (s++, o = Tc(new Promise((a)=>{
                kp(()=>{
                    const c = n[s][1];
                    delete n[s], a(c);
                });
            })).pipe(it((a)=>r(a))), n.push([
                o,
                [
                    e
                ]
            ])) : (o = n[s][0], i = n[s][1].length, n[s][1].push(e)), o.pipe(ve((a)=>a[i]));
        }
        _decorateStorageCall(e, n) {
            const r = Be(this.#e, (...s)=>{
                const i = t_(this.#n, e, s);
                return this.hasSubscriptions ? this._queueStorage(i, this.#s) : this._rpcCore.state.getStorage(i);
            });
            return n(r, {
                methodName: e.method,
                overrideNoSub: (...s)=>this._queueStorage(t_(this.#n, e, s), this.#r)
            });
        }
        _retrieveMulti(e, n) {
            if (!e.length) return Te([]);
            const r = this.hasSubscriptions && !n ? this._rpcCore.state.subscribeStorage : this._rpcCore.state.queryStorageAt;
            return e.length <= LS ? n ? r(e, n) : r(e) : et(Fk(e, LS).map((s)=>n ? r(s, n) : r(s))).pipe(ve(Qh));
        }
        _retrieveMapKeys({ iterKey: e, meta: n, method: r, section: s }, i, o) {
            if (!e || !n.type.isMap) throw new Error("keys can only be retrieved on maps");
            const a = e(...o).toHex(), c = new Sy(a), l = i ? (d)=>this._rpcCore.state.getKeysPaged(a, n_, d, i) : (d)=>this._rpcCore.state.getKeysPaged(a, n_, d), u = (d)=>d.setMeta(n, s, r);
            return c.pipe(it(l), ve((d)=>d.map(u)), Nd((d)=>kp(()=>{
                    d.length === n_ ? c.next(d[n_ - 1].toHex()) : c.complete();
                })), z3(), ve(Qh));
        }
        _retrieveMapKeysPaged({ iterKey: e, meta: n, method: r, section: s }, i, o) {
            if (!e || !n.type.isMap) throw new Error("keys can only be retrieved on maps");
            const a = (l)=>l.setMeta(n, s, r);
            return (i ? (l)=>this._rpcCore.state.getKeysPaged(l, o.pageSize, o.startKey || l, i) : (l)=>this._rpcCore.state.getKeysPaged(l, o.pageSize, o.startKey || l))(e(...o.args).toHex()).pipe(ve((l)=>l.map(a)));
        }
        _retrieveMapEntries(e, n, r) {
            const s = n ? (i)=>this._rpcCore.state.queryStorageAt(i, n) : (i)=>this._rpcCore.state.queryStorageAt(i);
            return this._retrieveMapKeys(e, n, r).pipe(it((i)=>i.length ? et(Fk(i, LS).map(s)).pipe(ve((o)=>Qh(o).map((a, c)=>[
                            i[c],
                            a
                        ]))) : Te([])));
        }
        _retrieveMapEntriesPaged(e, n, r) {
            const s = n ? (i)=>this._rpcCore.state.queryStorageAt(i, n) : (i)=>this._rpcCore.state.queryStorageAt(i);
            return this._retrieveMapKeysPaged(e, n, r).pipe(it((i)=>i.length ? s(i).pipe(ve((o)=>o.map((a, c)=>[
                            i[c],
                            a
                        ]))) : Te([])));
        }
        _decorateDeriveRx(e) {
            const n = this._runtimeVersion?.specName.toString(), r = qtt(this.#e, this._rx, Ye({}, this._options.derives, this._options.typesBundle?.spec?.[n || ""]?.derives));
            return jB(e, r);
        }
        _decorateDerive(e) {
            return jB(e, this._rx.derive);
        }
        _rxDecorateMethod = (e)=>e;
    }
    const Mnt = 1e4, sF = [
        16,
        15,
        14
    ], pl = ma("api/init");
    function Rnt(t) {
        return t.toString();
    }
    class Nnt extends Ont {
        #e = null;
        #t = null;
        #n = [];
        #r = null;
        #s = {};
        constructor(e, n, r){
            super(e, n, r), this.registry.setKnownTypes(e), e.source ? this.#n = e.source.#n : this.registerTypes(e.types), this._rpc = this._decorateRpc(this._rpcCore, this._decorateMethod), this._rx.rpc = this._decorateRpc(this._rpcCore, this._rxDecorateMethod), this.supportMulti && (this._queryMulti = this._decorateMulti(this._decorateMethod), this._rx.queryMulti = this._decorateMulti(this._rxDecorateMethod)), this._rx.signer = e.signer, this._rpcCore.setRegistrySwap((s)=>this.getBlockRegistry(s)), this._rpcCore.setResolveBlockHash((s)=>Dn(this._rpcCore.chain.getBlockHash(s))), this.hasSubscriptions ? (this._rpcCore.provider.on("disconnected", ()=>this.#o()), this._rpcCore.provider.on("error", (s)=>this.#a(s)), this._rpcCore.provider.on("connected", ()=>this.#i())) : this._options.noInitWarn || pl.warn("Api will be available in a limited mode since the provider does not support subscriptions"), this._rpcCore.provider.isConnected && this.#i().catch(Xl);
        }
        _initRegistry(e, n, r, s, i) {
            e.clearCache(), e.setChainProperties(i || this.registry.getChainProperties()), e.setKnownTypes(this._options), e.register(wnt(e, n, r.specName, r.specVersion)), e.setHasher(_nt(e, n, r.specName)), e.knownTypes.typesBundle && (e.knownTypes.typesAlias = vnt(e, n, r.specName)), e.setMetadata(s, void 0, Ye({}, ynt(e, n, r.specName), this._options.signedExtensions), this._options.noInitWarn);
        }
        _getDefaultRegistry() {
            return Zu(this.#n.find(({ isDefault: e })=>e), "Initialization error, cannot find the default registry");
        }
        async at(e, n) {
            const r = Dt(e), s = nn(r), i = await this.getBlockRegistry(r, n);
            return (!this.#e || this.#e[0] !== s) && (this.#e = [
                s,
                this._createDecorated(i, !0, null, r).decoratedApi
            ]), this.#e[1];
        }
        async _createBlockRegistry(e, n, r) {
            const s = new UY(e), i = await this._retrieveMetadata(r.apis, n.parentHash, s), o = this._runtimeChain;
            if (!o) throw new Error("Invalid initializion order, runtimeChain is not available");
            this._initRegistry(s, o, r, i);
            const a = {
                counter: 0,
                lastBlockHash: e,
                metadata: i,
                registry: s,
                runtimeVersion: r
            };
            return this.#n.push(a), a;
        }
        _cacheBlockRegistryProgress(e, n) {
            let r = this.#s[e];
            return Rr(r) && (r = this.#s[e] = new Promise((s, i)=>{
                n().then((o)=>{
                    delete this.#s[e], s(o);
                }).catch((o)=>{
                    delete this.#s[e], i(o);
                });
            })), r;
        }
        _getBlockRegistryViaVersion(e, n) {
            if (n) {
                const r = this.#n.find(({ runtimeVersion: { specName: s, specVersion: i } })=>s.eq(n.specName) && i.eq(n.specVersion));
                if (r) return r.counter++, r.lastBlockHash = e, r;
            }
            return null;
        }
        async _getBlockRegistryViaHash(e) {
            if (!this._genesisHash || !this._runtimeVersion) throw new Error("Cannot retrieve data on an uninitialized chain");
            const n = this.registry.createType("HeaderPartial", this._genesisHash.eq(e) ? {
                number: ss,
                parentHash: this._genesisHash
            } : await Dn(this._rpcCore.chain.getHeader.raw(e)));
            if (n.parentHash.isEmpty) throw pl.warn(`Unable to retrieve header ${e.toString()} and parent ${n.parentHash.toString()} from supplied hash`), new Error("Unable to retrieve header and parent from supplied hash");
            Snt(this._genesisHash, n.number);
            const r = this.registry.createType("RuntimeVersionPartial", await Dn(this._rpcCore.state.getRuntimeVersion.raw(n.parentHash)));
            return this._getBlockRegistryViaVersion(e, r) || await this._cacheBlockRegistryProgress(r.toHex(), ()=>this._createBlockRegistry(e, n, r));
        }
        async getBlockRegistry(e, n) {
            return this.#n.find(({ lastBlockHash: r })=>r && tJ(r, e)) || this._getBlockRegistryViaVersion(e, n) || await this._cacheBlockRegistryProgress(nn(e), ()=>this._getBlockRegistryViaHash(e));
        }
        async _loadMeta() {
            return this._isReady ? (this._options.source || this._subscribeUpdates(), !0) : (this._unsubscribeUpdates(), [this._genesisHash, this._runtimeMetadata] = this._options.source?._isReady ? await this._metaFromSource(this._options.source) : await this._metaFromChain(this._options.metadata), this._initFromMeta(this._runtimeMetadata));
        }
        async _metaFromSource(e) {
            this._extrinsicType = e.extrinsicVersion, this._runtimeChain = e.runtimeChain, this._runtimeVersion = e.runtimeVersion;
            const n = Object.keys(e.rpc), r = [];
            for(let s = 0, i = n.length; s < i; s++){
                const o = n[s], a = Object.keys(e.rpc[o]);
                for(let c = 0, l = a.length; c < l; c++)r.push(`${o}_${a[c]}`);
            }
            return this._filterRpc(r, JB(this.registry, e.runtimeChain, e.runtimeVersion.specName)), [
                e.genesisHash,
                e.runtimeMetadata
            ];
        }
        _subscribeUpdates() {
            this.#r || !this.hasSubscriptions || (this.#r = this._rpcCore.state.subscribeRuntimeVersion().pipe(it((e)=>this._runtimeVersion?.specVersion.eq(e.specVersion) ? Te(!1) : this._rpcCore.state.getMetadata().pipe(ve((n)=>{
                    pl.log(`Runtime version updated to spec=${e.specVersion.toString()}, tx=${e.transactionVersion.toString()}`), this._runtimeMetadata = n, this._runtimeVersion = e, this._rx.runtimeVersion = e;
                    const r = this._getDefaultRegistry(), s = this._runtimeChain;
                    if (!s) throw new Error("Invalid initializion order, runtimeChain is not available");
                    return r.metadata = n, r.runtimeVersion = e, this._initRegistry(this.registry, s, e, n), this._injectMetadata(r, !0), !0;
                })))).subscribe());
        }
        async _metaFromChain(e) {
            const [n, r, s, i, o] = await Promise.all([
                Dn(this._rpcCore.chain.getBlockHash(0)),
                Dn(this._rpcCore.state.getRuntimeVersion()),
                Dn(this._rpcCore.system.chain()),
                Dn(this._rpcCore.system.properties()),
                Dn(this._rpcCore.rpc.methods())
            ]);
            this._runtimeChain = s, this._runtimeVersion = r, this._rx.runtimeVersion = r;
            const a = `${n.toHex() || "0x"}-${r.specVersion.toString()}`, c = e?.[a] ? new zh(this.registry, e[a]) : await this._retrieveMetadata(r.apis);
            return this._initRegistry(this.registry, s, r, c, i), this._filterRpc(o.methods.map(Rnt), JB(this.registry, s, r.specName)), this._subscribeUpdates(), this.#n.length || this.#n.push({
                counter: 0,
                isDefault: !0,
                metadata: c,
                registry: this.registry,
                runtimeVersion: r
            }), c.getUniqTypes(this._options.throwOnUnknown || !1), [
                n,
                c
            ];
        }
        _initFromMeta(e) {
            const n = this._runtimeVersion;
            if (!n) throw new Error("Invalid initializion order, runtimeVersion is not available");
            return this._extrinsicType = e.asLatest.extrinsic.versions.at(0) || KA, this._rx.extrinsicType = this._extrinsicType, this._rx.genesisHash = this._genesisHash, this._rx.runtimeVersion = n, this._injectMetadata(this._getDefaultRegistry(), !0), this._rx.derive = this._decorateDeriveRx(this._rxDecorateMethod), this._derive = this._decorateDerive(this._decorateMethod), !0;
        }
        async _retrieveMetadata(e, n, r) {
            let s = null;
            const i = e.find(([a])=>a.eq(cm("Metadata", 64))), o = r || this.registry;
            if (!i || i[1].toNumber() < 2) return pl.warn("MetadataApi not available, rpc::state::get_metadata will be used."), n ? new zh(o, await Dn(this._rpcCore.state.getMetadata.raw(n))) : await Dn(this._rpcCore.state.getMetadata());
            try {
                const a = n ? await Dn(this._rpcCore.state.call.raw("Metadata_metadata_versions", "0x", n)) : await Dn(this._rpcCore.state.call("Metadata_metadata_versions", "0x"));
                s = o.createType("Vec<u32>", a).filter((l)=>sF.includes(l.toNumber())).reduce((l, u)=>u.gt(l) ? u : l);
            } catch (a) {
                pl.debug(a.message), pl.warn("error with state_call::Metadata_metadata_versions, rpc::state::get_metadata will be used");
            }
            if (s && !sF.includes(s.toNumber()) && (s = null), s) try {
                const a = n ? await Dn(this._rpcCore.state.call.raw("Metadata_metadata_at_version", nn(s.toU8a()), n)) : await Dn(this._rpcCore.state.call("Metadata_metadata_at_version", nn(s.toU8a()))), c = n ? o.createType("Raw", a).toU8a() : a, l = o.createType("Option<OpaqueMetadata>", c).unwrapOr(null);
                if (l) return new zh(o, l.toHex());
            } catch (a) {
                pl.debug(a.message), pl.warn("error with state_call::Metadata_metadata_at_version, rpc::state::get_metadata will be used");
            }
            return n ? new zh(o, await Dn(this._rpcCore.state.getMetadata.raw(n))) : await Dn(this._rpcCore.state.getMetadata());
        }
        _subscribeHealth() {
            this._unsubscribeHealth(), this.#t = this.hasSubscriptions ? setInterval(()=>{
                Dn(this._rpcCore.system.health.raw()).catch(Xl);
            }, Mnt) : null;
        }
        _unsubscribeHealth() {
            this.#t && (clearInterval(this.#t), this.#t = null);
        }
        _unsubscribeUpdates() {
            this.#r && (this.#r.unsubscribe(), this.#r = null);
        }
        _unsubscribe() {
            this._unsubscribeHealth(), this._unsubscribeUpdates();
        }
        async #i() {
            this._isConnected.next(!0), this.emit("connected");
            try {
                const e = this._options.initWasm === !1 ? !0 : await Oze(), n = await this._loadMeta();
                this._subscribeHealth(), n && !this._isReady && e && (this._isReady = !0, this.emit("ready", this));
            } catch (e) {
                const n = new Error(`FATAL: Unable to initialize the API: ${e.message}`);
                pl.error(n), this.emit("error", n);
            }
        }
        #o() {
            this._isConnected.next(!1), this._unsubscribe(), this.emit("disconnected");
        }
        #a(e) {
            this.emit("error", e);
        }
    }
    function Fi(t) {
        if (t === void 0) throw new Error("Api interfaces needs to be initialized before using, wait for 'isReady'");
        return t;
    }
    class Vnt extends Nnt {
        get call() {
            return Fi(this._call);
        }
        get consts() {
            return Fi(this._consts);
        }
        get derive() {
            return Fi(this._derive);
        }
        get errors() {
            return Fi(this._errors);
        }
        get events() {
            return Fi(this._events);
        }
        get extrinsicVersion() {
            return this._extrinsicType;
        }
        get genesisHash() {
            return Fi(this._genesisHash);
        }
        get isConnected() {
            return this._isConnected.getValue();
        }
        get libraryInfo() {
            return `${WV.name} v${WV.version}`;
        }
        get query() {
            return Fi(this._query);
        }
        get queryMulti() {
            return Fi(this._queryMulti);
        }
        get rpc() {
            return Fi(this._rpc);
        }
        get runtimeChain() {
            return Fi(this._runtimeChain);
        }
        get runtimeMetadata() {
            return Fi(this._runtimeMetadata);
        }
        get runtimeVersion() {
            return Fi(this._runtimeVersion);
        }
        get rx() {
            return Fi(this._rx);
        }
        get stats() {
            return this._rpcCore.stats;
        }
        get type() {
            return this._type;
        }
        get tx() {
            return Fi(this._extrinsics);
        }
        findCall(e) {
            return lQ(this.registry, e);
        }
        findError(e) {
            return uQ(this.registry, e);
        }
    }
    class Dnt extends Vnt {
        constructor(e = {}, n, r){
            super(e, n, r);
        }
        connect() {
            return this._rpcCore.connect();
        }
        disconnect() {
            return this._unsubscribe(), this._rpcCore.disconnect();
        }
        setSigner(e) {
            this._rx.signer = e;
        }
        async sign(e, n, { signer: r } = {}) {
            if (br(e)) {
                const s = r || this._rx.signer;
                if (!s?.signRaw) throw new Error("No signer exists with a signRaw interface. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.");
                return (await s.signRaw(Ye({
                    type: "bytes"
                }, n, {
                    address: e
                }))).signature;
            }
            return nn(e.sign(Dt(n.data)));
        }
    }
    class Bnt {
        #e = !1;
        #t;
        #n = [];
        #r = [];
        #s = !0;
        #i = [];
        #o = [];
        constructor(e, n){
            this.#t = n, this.#o = e.map(async (r, s)=>{
                const [i, ...o] = Array.isArray(r) ? r : [
                    r
                ];
                return this.#n.push(!1), this.#r.push(i), i(...o, this._createCallback(s));
            });
        }
        _allHasFired() {
            return this.#e ||= this.#n.filter((e)=>!e).length === 0, this.#e;
        }
        _createCallback(e) {
            return (n)=>{
                this.#n[e] = !0, this.#i[e] = n, this._triggerUpdate();
            };
        }
        _triggerUpdate() {
            if (!(!this.#s || !Mt(this.#t) || !this._allHasFired())) try {
                Promise.resolve(this.#t(this.#i)).catch(Xl);
            } catch  {}
        }
        unsubscribe() {
            this.#s && (this.#s = !1, Promise.all(this.#o.map(async (e)=>{
                try {
                    const n = await e;
                    Mt(n) && n();
                } catch  {}
            })).catch(()=>{}));
        }
    }
    function lP(t, e) {
        let n = !1;
        return {
            reject: (r)=>(n || (n = !0, e(r)), N1),
            resolve: (r)=>{
                n || (n = !0, t(r));
            }
        };
    }
    function Fnt(t, e) {
        const n = t.slice(), r = t.length && Mt(t[t.length - 1]) ? n.pop() : void 0;
        if (e && !Mt(r)) throw new Error("Expected a callback to be passed with subscriptions");
        return [
            n,
            r
        ];
    }
    function Lnt(t, e) {
        return new Promise((n, r)=>{
            const s = lP(n, r), i = t(...e).pipe(cu((o)=>s.reject(o))).subscribe((o)=>{
                s.resolve(o), kp(()=>i.unsubscribe());
            });
        });
    }
    function znt(t, e, n) {
        return new Promise((r, s)=>{
            const i = lP(r, s), o = t(...e).pipe(cu((a)=>i.reject(a)), Nd(()=>i.resolve(()=>o.unsubscribe()))).subscribe((a)=>{
                kp(()=>n(a));
            });
        });
    }
    function Unt(t, e) {
        const n = !!(e?.methodName && e.methodName.includes("subscribe"));
        return function(...r) {
            const [s, i] = Fnt(r, n);
            return i ? znt(t, s, i) : Lnt(e?.overrideNoSub || t, s);
        };
    }
    class Rx extends Dnt {
        #e;
        #t;
        constructor(e){
            super(e, "promise", Unt), this.#e = new Promise((n)=>{
                super.once("ready", ()=>n(this));
            }), this.#t = new Promise((n, r)=>{
                const s = lP(n, r);
                super.once("ready", ()=>s.resolve(this)), super.once("error", (i)=>s.reject(i));
            });
        }
        static create(e) {
            const n = new Rx(e);
            return e && e.throwOnConnect ? n.isReadyOrError : (n.isReadyOrError.catch(Xl), n.isReady);
        }
        get isReady() {
            return this.#e;
        }
        get isReadyOrError() {
            return this.#t;
        }
        clone() {
            return new Rx(Ye({}, this._options, {
                source: this
            }));
        }
        async combineLatest(e, n) {
            const r = new Bnt(e, n);
            return ()=>{
                r.unsubscribe();
            };
        }
    }
    const fQ = bv(), Hnt = fd.pipe(HI(fQ));
    LI(Hnt);
    const pQ = (t)=>fQ(Buffer.from(t, "hex")), jnt = bv(), qnt = en.pipe(HI(jnt));
    LI(qnt);
    const hQ = bv(), Wnt = (t)=>hQ(t), Knt = (t)=>{
        const e = t.serialize();
        return hQ(e);
    }, Wa = bv(), $nt = (t, e)=>{
        if (e - t < 1) throw new TypeError("Invalid protocol version range.");
        return [
            t,
            e
        ];
    }, Xnt = (t, e)=>{
        const [n, r] = e;
        return t >= n && t < r;
    }, Gnt = Wl.pipe(HI(Wa));
    LI(Gnt);
    const Tp = Wa(0n), Znt = Wa(BigInt(Number.MAX_SAFE_INTEGER)), iF = {
        isCompleteWithin (t, e = 50n) {
            const n = BigInt(Math.abs(Number(t.highestRelevantWalletIndex - t.appliedIndex)));
            return t.isConnected && n <= e;
        }
    }, Ju = (t = {})=>{
        const { appliedIndex: e = 0n, highestRelevantWalletIndex: n = 0n, highestIndex: r = 0n, highestRelevantIndex: s = 0n, isConnected: i = !1 } = t;
        return {
            ...{
                appliedIndex: e,
                highestRelevantWalletIndex: n,
                highestIndex: r,
                highestRelevantIndex: s,
                isConnected: i
            },
            isStrictlyComplete () {
                return iF.isCompleteWithin(this, 0n);
            },
            isCompleteWithin (a) {
                return iF.isCompleteWithin(this, a);
            }
        };
    }, Jnt = {
        reconnectionTimeout: eq,
        reconnectionDelay: yu(1)
    }, Ynt = (t)=>({
            ...Jnt,
            ...t
        });
    class Nx {
        static make(e) {
            const n = Ynt(e);
            return jp(wl(async ()=>{
                const r = await Rx.create({
                    provider: new K3(n.nodeURL.toString()),
                    throwOnConnect: !1,
                    noInitWarn: !0
                });
                return await r.disconnect(), r;
            }), (r)=>wl(()=>r.disconnect())).pipe(wt((r)=>new Nx(n, r)));
        }
        static layer(e) {
            return L$(gA, Nx.make(e));
        }
        config;
        api;
        constructor(e, n){
            this.config = e, this.api = n;
        }
        ensureConnection() {
            return V(wl(async ()=>{
                if (!this.api.isConnected) try {
                    await this.api.connect();
                } catch (e) {
                    if (!(e instanceof Error && e.message === "WebSocket is already connected")) throw e;
                }
            }), Y2(Kn(()=>this.api.isConnected)), mk({
                until: (e)=>e,
                schedule: I1(this.config.reconnectionDelay)
            }), nIe(this.config.reconnectionTimeout), Zg, Ad((e)=>new LV({
                    message: "Could not connect within specified time range (5s)",
                    cause: e
                })));
        }
        sendMidnightTransaction(e) {
            const n = qG((r)=>{
                const s = ()=>i.then((o)=>o()), i = this.api.tx.midnight.sendMnTransaction(nn(e)).send(this.#e(e, r, s)).catch((o)=>r.fail(new KFe({
                        message: "Transaction submission failed",
                        txData: e,
                        cause: o
                    })).then(()=>()=>{}));
                return wl(s);
            });
            return V(ou(this.ensureConnection()), zc(()=>n), WG(wl(()=>this.api.disconnect())));
        }
        getGenesis() {
            return V(this.ensureConnection(), Y2(()=>wl(()=>this.api.rpc.chain.getBlock(this.api.genesisHash))), wt(({ block: e })=>({
                    transactions: e.extrinsics.filter(({ method: n })=>n.section === "midnight" && n.method === "sendMnTransaction").map(({ method: n })=>n.args[0].toU8a()).map(Wnt)
                })), Ad((e)=>new LV({
                    message: "Failed to retrieve genesis transactions",
                    cause: e
                })), Mf(wl(()=>this.api.disconnect())));
        }
        #e = (e, n, r)=>{
            const s = tn({
                blockNumber: bRe(ht)
            }), i = (a)=>n.fail(new $Fe({
                    message: "Failed to parse result provided by node",
                    cause: a
                })), o = Xc(s, {
                errors: "all",
                onExcessProperty: "ignore"
            });
            return async (a)=>{
                const c = a.status;
                c.isReady || c.isFuture || c.isBroadcast || c.isRetracted ? await n.single(HFe({
                    tx: e,
                    txHash: a.txHash.toString()
                })) : c.isInBlock ? await V(o(a), xr({
                    onLeft: i,
                    onRight: (l)=>n.single(jFe({
                            tx: e,
                            blockHash: c.asInBlock.toString(),
                            blockHeight: BigInt(l.blockNumber.toString(10)),
                            txHash: a.txHash.toString()
                        }))
                })) : c.isFinalized ? (await V(o(a), xr({
                    onLeft: i,
                    onRight: (l)=>n.single(qFe({
                            tx: e,
                            blockHash: c.asFinalized.toString(),
                            blockHeight: BigInt(l.blockNumber.toString(10)),
                            txHash: a.txHash.toString()
                        }))
                })), await n.end(), await r()) : c.isFinalityTimeout ? (await n.fail(new GZ({
                    message: "Transaction did not reach finality within expected time, likely consensus issues arised",
                    desiredStage: "Finalized",
                    txData: e
                })), await r()) : c.isUsurped ? (await n.fail(new XFe({
                    message: "Transaction got usurped (replaced by another one matching its discriminators like sender or nonce)",
                    txData: e
                })), await r()) : c.isDropped ? (await n.fail(new GFe({
                    message: "Transaction got dropped, the mempool likely is full and network congested",
                    txData: e
                })), await r()) : c.isInvalid && (await n.fail(new ZFe({
                    message: "Transaction is invalid and was rejected by the node",
                    txData: e
                })), await r());
            };
        };
    }
    let Qnt = class extends wn("SubmissionError") {
    };
    const ert = (t)=>{
        const e = ti().pipe(Xi), n = or(function*() {
            const s = yield* Y0(), i = yield* Nx.make({
                nodeURL: t.relayURL
            }).pipe(Od(Ha, s));
            return {
                scope: s,
                client: i
            };
        });
        return V(e, C8e(n), Cn), {
            submitTransaction: (s, i = "InBlock")=>V(YFe(Knt(s), i), O$(gA, V(e, Vr, wt(({ client: o })=>o))), Ad((o)=>new Qnt({
                        message: "Transaction submission error",
                        cause: o
                    }))),
            close () {
                return V(e, Vr, nt(({ scope: s })=>Id(s, Xv)), GEe);
            }
        };
    }, trt = (t)=>{
        const e = ert(t);
        return {
            submitTransaction: (r, s = "InBlock")=>e.submitTransaction(r, s).pipe(Cn),
            close: ()=>e.close().pipe(Cn)
        };
    }, nrt = {
        areAllTxIdsIncluded (t, e) {
            const n = Jb(t.identifiers()), r = Jb(e);
            return i3e(n, r);
        },
        deserialize (t) {
            return _n.deserialize("signature", "proof", "binding", t);
        },
        firstId (t) {
            return t.identifiers()[0];
        },
        hasTTLExpired (t, e, n) {
            const r = wi.initialParameters().dust.dustGracePeriodSeconds, s = V(t.intents?.values().toArray() ?? [], Ps((c)=>c.ttl), dv(vMe)), i = V(t.intents?.values().toArray() ?? [], vg((c)=>c.dustActions?.spends ?? []), ym), o = t.guaranteedOffer != null || (t.fallibleOffer?.size ?? 0) == 0, a = i || o ? V(e, TMe(yu(Number(r))), qo) : tu();
            return V(s, uv(a), (c)=>Fr(c) ? ze(t2e(c, ip(p_e, kMe))) : Fe(), dn({
                onNone: ()=>!1,
                onSome: (c)=>SMe(c, n) > 0
            }));
        },
        ids (t) {
            return t.identifiers();
        },
        isOneIncludedInOther (t, e) {
            const n = Jb(t.identifiers()), r = Jb(e.identifiers()), s = ej(cv)(Kh(n), Kh(r)), i = o3e(n, r);
            return Kh(i) == s;
        },
        isTx (t) {
            return t instanceof _n;
        },
        serialize (t) {
            return t.serialize();
        }
    }, HS = new class {
        allTokenKinds = [
            "shielded",
            "unshielded",
            "dust"
        ];
        toFlags = (t)=>V(t, (e)=>e === "all" ? this.allTokenKinds : e, (e)=>({
                    shouldBalanceUnshielded: e.includes("unshielded"),
                    shouldBalanceShielded: e.includes("shielded"),
                    shouldBalanceDust: e.includes("dust")
                }));
    }, oF = {
        isRecipe: (t)=>typeof t == "object" && t !== null && "type" in t && typeof t.type == "string" && [
                "FINALIZED_TRANSACTION",
                "UNBOUND_TRANSACTION",
                "UNPROVEN_TRANSACTION"
            ].includes(t.type),
        getTransactions: (t)=>{
            switch(t.type){
                case "FINALIZED_TRANSACTION":
                    return [
                        t.originalTransaction,
                        t.balancingTransaction
                    ];
                case "UNBOUND_TRANSACTION":
                    {
                        const e = t.balancingTransaction ? [
                            t.balancingTransaction
                        ] : [];
                        return [
                            t.baseTransaction,
                            ...e
                        ];
                    }
                case "UNPROVEN_TRANSACTION":
                    return [
                        t.transaction
                    ];
            }
        }
    };
    class aF {
        shielded;
        unshielded;
        dust;
        pending;
        get isSynced() {
            return this.shielded.state.progress.isStrictlyComplete() && this.dust.state.progress.isStrictlyComplete() && this.unshielded.progress.isStrictlyComplete();
        }
        constructor(e, n, r, s){
            this.shielded = e, this.unshielded = n, this.dust = r, this.pending = s;
        }
    }
    const rrt = 3600 * 1e3;
    class Bl {
        static makeDefaultSubmissionService(e) {
            return trt(e);
        }
        static makeDefaultPendingTransactionsService(e) {
            return km.init({
                configuration: e,
                txTrait: nrt
            });
        }
        static makeDefaultProvingService(e) {
            if (e.provingServerUrl) return LFe({
                provingServerUrl: e.provingServerUrl
            });
            throw new Error("Missing required configuration: 'provingServerUrl' must be set in config, or provide a custom provingService in init parameters.");
        }
        static async fetchTermsAndConditions(e) {
            const r = (await yVe(PVe, {}, {
                url: e.indexerClientConnection.indexerHttpUrl
            })).block?.systemParameters?.termsAndConditions;
            if (!r) throw new Error("Terms and Conditions are not currently set on the network.");
            return r;
        }
        static async init(e) {
            const n = await Promise.resolve(e.submissionService ? e.submissionService(e.configuration) : Bl.makeDefaultSubmissionService(e.configuration)), r = await Promise.resolve(e.pendingTransactionsService ? e.pendingTransactionsService(e.configuration) : Bl.makeDefaultPendingTransactionsService(e.configuration)), s = await Promise.resolve(e.provingService ? e.provingService(e.configuration) : Bl.makeDefaultProvingService(e.configuration)), i = await Promise.resolve(e.shielded(e.configuration)), o = await Promise.resolve(e.unshielded(e.configuration)), a = await Promise.resolve(e.dust(e.configuration));
            return new Bl(i, o, a, n, r, s);
        }
        shielded;
        unshielded;
        dust;
        submissionService;
        pendingTransactionsService;
        provingService;
        #e;
        constructor(e, n, r, s, i, o){
            this.shielded = e, this.unshielded = n, this.dust = r, this.submissionService = s, this.pendingTransactionsService = i, this.provingService = o, this.#e = this.pendingTransactionsService.state().pipe(PV((a)=>ANe(a)), PV((a)=>this.revert(a.tx))).subscribe();
        }
        defaultTtl() {
            return new Date(Date.now() + rrt);
        }
        mergeUnprovenTransactions(e, n) {
            return e && n ? e.merge(n) : e ?? n;
        }
        async createDustActionTransaction(e, n, r, s) {
            const i = this.defaultTtl(), o = await this.dust.createDustGenerationTransaction(void 0, i, n.map(({ utxo: u, meta: d })=>({
                    ...u,
                    ctime: d.ctime,
                    registeredForDustGeneration: d.registeredForDustGeneration
                })), r, e.type === "registration" ? e.dustReceiverAddress : void 0), a = o.intents?.get(1);
            if (!a) throw Error("Dust generation transaction is missing intent segment 1.");
            const c = a.signatureData(1), l = await Promise.resolve(s(c));
            return await this.dust.addDustGenerationSignature(o, l);
        }
        state() {
            return et([
                this.shielded.state,
                this.unshielded.state,
                this.dust.state,
                this.pendingTransactionsService.state()
            ]).pipe(ve(([e, n, r, s])=>new aF(e, n, r, s)));
        }
        async waitForSyncedState() {
            const [e, n, r, s] = await Promise.all([
                this.shielded.waitForSyncedState(),
                this.unshielded.waitForSyncedState(),
                this.dust.waitForSyncedState(),
                Dn(this.pendingTransactionsService.state())
            ]);
            return new aF(e, n, r, s);
        }
        async submitTransaction(e) {
            try {
                return await this.pendingTransactionsService.addPendingTransaction(e), await this.submissionService.submitTransaction(e, "Finalized"), e.identifiers().at(-1);
            } catch (n) {
                throw await this.revert(e), n;
            }
        }
        async balanceFinalizedTransaction(e, n, r) {
            const { shieldedSecretKeys: s, dustSecretKey: i } = n, { ttl: o, tokenKindsToBalance: a = "all" } = r, { shouldBalanceDust: c, shouldBalanceShielded: l, shouldBalanceUnshielded: u } = HS.toFlags(a), d = u ? await this.unshielded.balanceFinalizedTransaction(e) : void 0, f = l ? await this.shielded.balanceTransaction(s, e) : void 0, p = this.mergeUnprovenTransactions(f, d), h = c ? await this.dust.balanceTransactions(i, p ? [
                e,
                p
            ] : [
                e
            ], o) : void 0, m = this.mergeUnprovenTransactions(p, h);
            if (!m) throw new Error("No balancing transaction was created. Please check your transaction.");
            return {
                type: "FINALIZED_TRANSACTION",
                originalTransaction: e,
                balancingTransaction: m
            };
        }
        async balanceUnboundTransaction(e, n, r) {
            const { shieldedSecretKeys: s, dustSecretKey: i } = n, { ttl: o, tokenKindsToBalance: a = "all" } = r, { shouldBalanceDust: c, shouldBalanceShielded: l, shouldBalanceUnshielded: u } = HS.toFlags(a), d = l ? await this.shielded.balanceTransaction(s, e) : void 0, f = u ? await this.unshielded.balanceUnboundTransaction(e) : void 0, p = f ?? e, h = c ? await this.dust.balanceTransactions(i, d ? [
                p,
                d
            ] : [
                p
            ], o) : void 0, m = this.mergeUnprovenTransactions(d, h);
            if (!m && !f) throw new Error("No balancing transaction was created. Please check your transaction.");
            return {
                type: "UNBOUND_TRANSACTION",
                baseTransaction: p,
                balancingTransaction: m ?? void 0
            };
        }
        async balanceUnprovenTransaction(e, n, r) {
            const { shieldedSecretKeys: s, dustSecretKey: i } = n, { ttl: o, tokenKindsToBalance: a = "all" } = r, { shouldBalanceDust: c, shouldBalanceShielded: l, shouldBalanceUnshielded: u } = HS.toFlags(a), d = l ? await this.shielded.balanceTransaction(s, e) : void 0, p = (u ? await this.unshielded.balanceUnprovenTransaction(e) : void 0) ?? e, h = this.mergeUnprovenTransactions(p, d), m = c ? await this.dust.balanceTransactions(i, [
                h
            ], o) : void 0;
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: this.mergeUnprovenTransactions(h, m)
            };
        }
        async finalizeRecipe(e) {
            return Promise.resolve(e).then(async (n)=>{
                switch(n.type){
                    case "FINALIZED_TRANSACTION":
                        {
                            const r = await this.finalizeTransaction(n.balancingTransaction);
                            return n.originalTransaction.merge(r);
                        }
                    case "UNBOUND_TRANSACTION":
                        {
                            const r = n.balancingTransaction ? await this.finalizeTransaction(n.balancingTransaction) : void 0, s = n.baseTransaction.bind();
                            return r ? s.merge(r) : s;
                        }
                    case "UNPROVEN_TRANSACTION":
                        return await this.finalizeTransaction(n.transaction);
                }
            }).then(async (n)=>(await this.pendingTransactionsService.addPendingTransaction(n), n));
        }
        async signRecipe(e, n) {
            switch(e.type){
                case "FINALIZED_TRANSACTION":
                    {
                        const r = await this.signUnprovenTransaction(e.balancingTransaction, n);
                        return {
                            type: "FINALIZED_TRANSACTION",
                            originalTransaction: e.originalTransaction,
                            balancingTransaction: r
                        };
                    }
                case "UNBOUND_TRANSACTION":
                    {
                        const r = e.balancingTransaction ? await this.signUnprovenTransaction(e.balancingTransaction, n) : void 0;
                        return {
                            type: "UNBOUND_TRANSACTION",
                            baseTransaction: await this.signUnboundTransaction(e.baseTransaction, n),
                            balancingTransaction: r
                        };
                    }
                case "UNPROVEN_TRANSACTION":
                    return {
                        type: "UNPROVEN_TRANSACTION",
                        transaction: await this.signUnprovenTransaction(e.transaction, n)
                    };
            }
        }
        async signUnprovenTransaction(e, n) {
            return await this.unshielded.signUnprovenTransaction(e, n);
        }
        async signUnboundTransaction(e, n) {
            return await this.unshielded.signUnboundTransaction(e, n);
        }
        async finalizeTransaction(e) {
            try {
                const r = (await this.provingService.prove(e)).bind();
                return await this.pendingTransactionsService.addPendingTransaction(r), r;
            } catch (n) {
                throw await Promise.allSettled([
                    this.shielded.revertTransaction(e),
                    this.unshielded.revertTransaction(e),
                    this.dust.revertTransaction(e)
                ]), n;
            }
        }
        async calculateTransactionFee(e) {
            return await this.dust.calculateFee([
                e
            ]);
        }
        async estimateTransactionFee(e, n, r) {
            const s = r?.ttl ?? this.defaultTtl();
            return await this.dust.estimateFee(n, [
                e
            ], s, r?.currentTime);
        }
        async transferTransaction(e, n, r) {
            const { shieldedSecretKeys: s, dustSecretKey: i } = n, { ttl: o, payFees: a = !0 } = r, c = e.filter((m)=>m.type === "unshielded").flatMap((m)=>m.outputs), l = e.filter((m)=>m.type === "shielded").flatMap((m)=>m.outputs);
            if (c.length === 0 && l.length === 0) throw Error("At least one shielded or unshielded output is required.");
            const u = l.length > 0 ? await this.shielded.transferTransaction(s, l) : void 0, d = c.length > 0 ? await this.unshielded.transferTransaction(c, o) : void 0, f = this.mergeUnprovenTransactions(u, d), p = a ? await this.dust.balanceTransactions(i, [
                f
            ], o) : void 0;
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: this.mergeUnprovenTransactions(f, p)
            };
        }
        async estimateRegistration(e) {
            const n = new Date, r = await this.dust.waitForSyncedState(), s = V(e, Ps(({ utxo: u, meta: d })=>({
                    ...u,
                    ctime: d.ctime,
                    registeredForDustGeneration: d.registeredForDustGeneration
                })), (u)=>r.estimateDustGeneration(u, n), (u)=>r.capabilities.coinsAndBalances.splitNightUtxos(u), (u)=>u.guaranteed), i = Uie(), o = xH(i), c = (await this.registerNightUtxosForDustGeneration(e, o, (u)=>vH(i, u), r.address)).transaction.mockProve().bind();
            return {
                fee: await this.calculateTransactionFee(c),
                dustGenerationEstimations: s
            };
        }
        async initSwap(e, n, r, s) {
            const { shieldedSecretKeys: i, dustSecretKey: o } = r, { ttl: a, payFees: c = !1 } = s, { shielded: l, unshielded: u } = e, d = n.filter((A)=>A.type === "shielded").flatMap((A)=>A.outputs), f = n.filter((A)=>A.type === "unshielded").flatMap((A)=>A.outputs), p = l && Object.keys(l).length > 0 || d.length > 0, h = u && Object.keys(u).length > 0 || f.length > 0;
            if (!p && !h) throw Error("At least one shielded or unshielded swap is required.");
            const m = p && l !== void 0 ? await this.shielded.initSwap(i, l, d) : void 0, w = h && u !== void 0 ? await this.unshielded.initSwap(u, f, a) : void 0, v = this.mergeUnprovenTransactions(m, w);
            if (!v) throw Error("Unexpected transaction state.");
            const k = c ? await this.dust.balanceTransactions(o, [
                v
            ], a) : void 0;
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: this.mergeUnprovenTransactions(v, k)
            };
        }
        async registerNightUtxosForDustGeneration(e, n, r, s) {
            if (e.length === 0) throw Error("At least one Night UTXO is required.");
            const i = s ?? await this.dust.getAddress();
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: await this.createDustActionTransaction({
                    type: "registration",
                    dustReceiverAddress: i
                }, e, n, r)
            };
        }
        async deregisterFromDustGeneration(e, n, r) {
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: await this.createDustActionTransaction({
                    type: "deregistration"
                }, e, n, r)
            };
        }
        async revert(e) {
            const n = oF.isRecipe(e) ? oF.getTransactions(e) : [
                e
            ];
            await Promise.all(n.map((r)=>this.revertTransaction(r)));
        }
        async revertTransaction(e) {
            await Promise.all([
                this.shielded.revertTransaction(e),
                this.unshielded.revertTransaction(e),
                this.dust.revertTransaction(e)
            ]).then(()=>this.pendingTransactionsService.clear(e));
        }
        async start(e, n) {
            await Promise.all([
                this.shielded.start(e),
                this.unshielded.start(),
                this.dust.start(n),
                this.pendingTransactionsService.start()
            ]);
        }
        async stop() {
            await Promise.all([
                this.shielded.stop(),
                this.unshielded.stop(),
                this.dust.stop(),
                this.submissionService.close(),
                this.pendingTransactionsService.stop(),
                Promise.resolve(this.#e?.unsubscribe())
            ]);
        }
    }
    const srt = (t)=>rA(t.variant), irt = (t)=>t.reduce((e, n)=>({
                ...e,
                [srt(n)]: n
            }), {});
    class uP extends wn("WalletRuntimeError") {
    }
    const d9 = $E();
    d9.$is("State");
    d9.$is("ProgressUpdate");
    d9.$is("VersionChange");
    const { $match: ort, State: dP, ProgressUpdate: fP, VersionChange: pP } = d9, hP = $E();
    hP.$is("Version");
    hP.$is("Next");
    const { $match: art, Version: gP, Next: Y_t } = hP, crt = (t)=>{
        const e = t.progress?.appliedId ?? 0n, r = (t.progress?.highestTransactionId ?? 0n) - e, s = e - e;
        return [
            fP({
                sourceGap: r,
                applyGap: s
            })
        ];
    }, lrt = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            pP({
                change: gP({
                    version: Wa(e.protocolVersion)
                })
            })
        ] : [], co = Symbol("V1");
    let urt = class {
        __polyTag__ = co;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = ou(n.stateRef.get).pipe(zc((s)=>n.stateRef.changes.pipe(GI(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), N3(([s, i])=>[
                    dP({
                        state: i
                    }),
                    ...crt(i),
                    ...lrt(s, i)
                ]));
        }
        startSyncInBackground() {
            return this.startSync().pipe(JI(XI), x1, Od(Ha, this.#e));
        }
        startSync() {
            return V(Xf(this.#t.stateRef), ou, zc((e)=>this.#n.syncService.updates(e)), $d((e)=>xp(this.#t.stateRef, (n)=>V(this.#n.syncCapability.applyUpdate(n, e), Br))), YI((e)=>RI(e)), V3(V(E1(yu(1), 2), TI((e)=>{
                const n = Yy(2), r = ls(Math.floor(Math.random() * 1e3)), s = ki(e) + ki(r);
                return ls(Math.min(s, ki(n)));
            }))));
        }
        balanceFinalizedTransaction(e) {
            return Il(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceFinalizedTransaction(n, e), Br));
        }
        balanceUnboundTransaction(e) {
            return Il(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceUnboundTransaction(n, e), Br));
        }
        balanceUnprovenTransaction(e) {
            return Il(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceUnprovenTransaction(n, e), Br));
        }
        transferTransaction(e, n) {
            return Il(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.makeTransfer(r, e, n), Br, wt(({ transaction: s, newState: i })=>[
                        s,
                        i
                    ])));
        }
        initSwap(e, n, r) {
            return Il(this.#t.stateRef, (s)=>V(this.#n.transactingCapability.initSwap(s, e, n, r), wt(({ transaction: i, newState: o })=>[
                        i,
                        o
                    ])));
        }
        signUnprovenTransaction(e, n) {
            return this.#n.transactingCapability.signUnprovenTransaction(e, n);
        }
        signUnboundTransaction(e, n) {
            return this.#n.transactingCapability.signUnboundTransaction(e, n);
        }
        revertTransaction(e) {
            return xp(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Br));
        }
        serializeState(e) {
            return this.#n.serializationCapability.serialize(e);
        }
    }, gQ = class extends wn("Wallet.Other") {
    }, r_ = class extends wn("Wallet.Sync") {
    }, drt = class extends wn("Wallet.InsufficientFunds") {
    }, r2t = class extends wn("Wallet.Address") {
    }, mi = class extends wn("Wallet.Transacting") {
    };
    class frt extends wn("Wallet.Sign") {
    }
    class Vx extends wn("Wallet.ApplyTransaction") {
    }
    class prt extends wn("Wallet.RollbackUtxo") {
    }
    class cF extends wn("Wallet.SpendUtxo") {
    }
    class lF extends wn("UtxoNotFoundError") {
    }
    const uF = {
        isCompleteWithin (t, e = 50n) {
            const n = BigInt(Math.abs(Number(t.highestTransactionId - t.appliedId)));
            return t.isConnected && n <= e;
        }
    }, jS = (t = {})=>{
        const { appliedId: e = 0n, highestTransactionId: n = 0n, isConnected: r = !1 } = t;
        return {
            ...{
                appliedId: e,
                highestTransactionId: n,
                isConnected: r
            },
            isStrictlyComplete () {
                return uF.isCompleteWithin(this, 0n);
            },
            isCompleteWithin (i) {
                return uF.isCompleteWithin(this, i);
            }
        };
    }, ka = (t)=>`${t.intentHash}#${t.outputNo}`, Xo = {
        empty: ()=>({
                availableUtxos: F0(),
                pendingUtxos: F0()
            }),
        restore: (t, e)=>({
                availableUtxos: Yb(t.map((n)=>[
                        ka(n.utxo),
                        n
                    ])),
                pendingUtxos: Yb(e.map((n)=>[
                        ka(n.utxo),
                        n
                    ]))
            }),
        spend: (t, e)=>qs(function*() {
                const n = ka(e.utxo);
                return pR(t.availableUtxos, n) ? {
                    availableUtxos: bR(t.availableUtxos, n),
                    pendingUtxos: M2(t.pendingUtxos, n, e)
                } : yield* st(new lF({
                    utxo: e.utxo
                }));
            }),
        rollbackSpend: (t, e)=>{
            const n = ka(e.utxo);
            return pR(t.pendingUtxos, n) ? mt({
                availableUtxos: M2(t.availableUtxos, n, e),
                pendingUtxos: bR(t.pendingUtxos, n)
            }) : mt(t);
        },
        spendByUtxo: (t, e)=>qs(function*() {
                const n = ka(e), r = yield* aC(O2(t.availableUtxos, n), ()=>new lF({
                        utxo: e
                    }));
                return yield* Xo.spend(t, r);
            }),
        rollbackSpendByUtxo: (t, e)=>V(O2(t.pendingUtxos, ka(e)), dn({
                onNone: ()=>mt(t),
                onSome: (n)=>Xo.rollbackSpend(t, n)
            })),
        applyUpdate: (t, e)=>qs(function*() {
                return [
                    "SUCCESS",
                    "PARTIAL_SUCCESS"
                ].includes(e.status) ? {
                    availableUtxos: gR(A8(t.availableUtxos, e.spentUtxos.map((n)=>ka(n.utxo))), Yb(e.createdUtxos.map((n)=>[
                            ka(n.utxo),
                            n
                        ]))),
                    pendingUtxos: A8(t.pendingUtxos, e.spentUtxos.map((n)=>ka(n.utxo)))
                } : yield* st(new Vx({
                    message: `Invalid status: ${e.status}`
                }));
            }),
        applyFailedUpdate: (t, e)=>qs(function*() {
                return e.status !== "FAILURE" ? yield* st(new Vx({
                    message: `Invalid status: ${e.status}`
                })) : {
                    availableUtxos: gR(t.availableUtxos, Yb(e.spentUtxos.map((n)=>[
                            ka(n.utxo),
                            n
                        ]))),
                    pendingUtxos: A8(t.pendingUtxos, e.spentUtxos.map((n)=>ka(n.utxo)))
                };
            }),
        toArrays: (t)=>({
                availableUtxos: hR(t.availableUtxos),
                pendingUtxos: hR(t.pendingUtxos)
            })
    }, Fl = {
        init (t, e) {
            return {
                state: Xo.empty(),
                publicKey: t,
                protocolVersion: Tp,
                progress: jS(),
                networkId: e
            };
        },
        restore (t, e, n, r, s) {
            return {
                state: t,
                publicKey: e,
                protocolVersion: r,
                progress: jS(n),
                networkId: s
            };
        },
        updateProgress (t, { appliedId: e, highestTransactionId: n, isConnected: r }) {
            const s = jS({
                appliedId: e ?? t.progress.appliedId,
                highestTransactionId: n ?? t.progress.highestTransactionId,
                isConnected: r ?? t.progress.isConnected
            });
            return {
                ...t,
                progress: s
            };
        },
        applyUpdate (t, e) {
            return Xo.applyUpdate(t.state, e).pipe(Qs((n)=>({
                    ...t,
                    state: n
                })), Ks((n)=>new Vx(n)));
        },
        applyFailedUpdate (t, e) {
            return Xo.applyFailedUpdate(t.state, e).pipe(Qs((n)=>({
                    ...t,
                    state: n
                })), Ks((n)=>new Vx(n)));
        },
        rollbackUtxo (t, e) {
            return Xo.rollbackSpendByUtxo(t.state, e).pipe(Qs((n)=>({
                    ...t,
                    state: n
                })), Ks((n)=>new prt(n)));
        },
        spend (t, e) {
            return Xo.spendByUtxo(t.state, e).pipe(Qs((n)=>({
                    ...t,
                    state: n
                })), Ks((n)=>new cF(n)));
        },
        spendUtxos (t, e) {
            return V(e, nu(mt([
                [],
                t.state
            ]), (n, r)=>n.pipe(_g(([s, i])=>Xo.spendByUtxo(i, r).pipe(Qs((o)=>[
                            s.concat([
                                r
                            ]),
                            o
                        ]), Ks((o)=>new cF(o)))))), Qs(([n, r])=>[
                    n,
                    {
                        ...t,
                        state: r
                    }
                ]));
        }
    }, hrt = ()=>{
        const t = tn({
            utxo: tn({
                value: Wl,
                owner: en,
                type: en,
                intentHash: en,
                outputNo: Or
            }),
            meta: tn({
                ctime: jG,
                registeredForDustGeneration: A3
            })
        }), e = tn({
            publicKey: tn({
                publicKey: en,
                addressHex: en,
                address: en
            }),
            state: tn({
                availableUtxos: Os(t),
                pendingUtxos: Os(t)
            }),
            protocolVersion: Wl,
            appliedId: $f(Wl),
            networkId: en
        });
        return {
            serialize: (n)=>V(n, (s)=>({
                        publicKey: s.publicKey,
                        state: Xo.toArrays(s.state),
                        protocolVersion: s.protocolVersion,
                        networkId: s.networkId,
                        appliedId: s.progress?.appliedId
                    }), sd(e), JSON.stringify),
            deserialize: (n)=>V(n, Xc(P1(e)), Ks((r)=>new gQ(r)), Qs((r)=>Fl.restore(Xo.restore(r.state.availableUtxos, r.state.pendingUtxos), r.publicKey, {
                        highestTransactionId: r.appliedId ?? 0n,
                        appliedId: r.appliedId ?? 0n
                    }, Wa(r.protocolVersion), r.networkId)))
        };
    }, grt = _u(Or, WI, {
        strict: !0,
        decode: (t)=>new Date(t),
        encode: (t)=>t.getTime()
    }), brt = tn({
        value: ky,
        owner: en,
        tokenType: en,
        intentHash: en,
        outputIndex: Or,
        ctime: Or,
        registeredForDustGeneration: A3
    }), Dx = _u(brt, Kf(tn({
        utxo: tn({
            value: NZ,
            owner: en,
            type: en,
            intentHash: en,
            outputNo: Or
        }),
        meta: tn({
            ctime: WI,
            registeredForDustGeneration: A3
        })
    })), {
        strict: !0,
        decode: (t)=>({
                utxo: {
                    value: t.value,
                    owner: t.owner,
                    type: t.tokenType,
                    intentHash: t.intentHash,
                    outputNo: t.outputIndex
                },
                meta: {
                    ctime: new Date(t.ctime * 1e3),
                    registeredForDustGeneration: t.registeredForDustGeneration
                }
            }),
        encode: (t)=>({
                value: t.utxo.value,
                owner: t.utxo.owner,
                tokenType: t.utxo.type,
                intentHash: t.utxo.intentHash,
                outputIndex: t.utxo.outputNo,
                ctime: Math.floor(t.meta.ctime.getTime() / 1e3),
                registeredForDustGeneration: t.meta.registeredForDustGeneration
            })
    }), bQ = tNe(tn({
        id: Or,
        hash: en,
        type: ri("RegularTransaction", "SystemTransaction"),
        protocolVersion: Or,
        identifiers: $f(Os(en)),
        block: tn({
            timestamp: grt
        }),
        fees: $f(tn({
            paidFees: ky,
            estimatedFees: ky
        })),
        transactionResult: $f(tn({
            status: ri("SUCCESS", "FAILURE", "PARTIAL_SUCCESS"),
            segments: OG(Os(tn({
                id: Or,
                success: A3
            })))
        }))
    })), mrt = tn({
        type: ri("UnshieldedTransaction"),
        transaction: bQ,
        createdUtxos: Os(Dx),
        spentUtxos: Os(Dx)
    }), yrt = _u(mrt, Kf(tn({
        type: ri("UnshieldedTransaction"),
        transaction: bQ,
        createdUtxos: Os(Kf(Dx)),
        spentUtxos: Os(Kf(Dx)),
        status: ri("SUCCESS", "FAILURE", "PARTIAL_SUCCESS")
    })), {
        strict: !0,
        decode: (t)=>{
            const e = t.transaction.type === "SystemTransaction";
            return {
                ...t,
                status: e ? "SUCCESS" : t.transaction.transactionResult.status
            };
        },
        encode: ({ status: t, ...e })=>e
    }), wrt = tn({
        type: ri("UnshieldedTransactionsProgress"),
        highestTransactionId: Or
    }), _rt = Rd(yrt, wrt), xrt = (t)=>({
            updates: (e)=>{
                const { indexerClientConnection: n } = t, r = nA(n.indexerHttpUrl, n.indexerWsUrl);
                if (pr(r)) return xy(new r_(new Error(`Could not derive WebSocket URL from indexer HTTP URL: ${r.left.message}`)));
                const s = F3(r.right);
                if (pr(s)) return xy(new r_(new Error(`Invalid indexer WS URL: ${s.left.message}`)));
                const i = s.right, { appliedId: o } = e.progress, { address: a } = e.publicKey;
                return V(RVe.run({
                    address: a,
                    transactionId: Number(o)
                }), $G(tA({
                    url: i,
                    keepAlive: n.keepAlive
                })), ZI((c)=>new r_(c)), $d((c)=>{
                    const { unshieldedTransactions: l } = c;
                    return V(Xc(_rt)(l), Ks((u)=>new r_(u)), Br);
                }));
            }
        }), vrt = (t, e)=>({
            applyUpdate: (n, r)=>{
                if (r.type === "UnshieldedTransactionsProgress") return mt(Fl.updateProgress(n, {
                    highestTransactionId: BigInt(r.highestTransactionId),
                    isConnected: !0
                }));
                {
                    const s = {
                        createdUtxos: r.createdUtxos,
                        spentUtxos: r.spentUtxos,
                        status: r.status
                    };
                    return (r.status === "FAILURE" ? Fl.applyFailedUpdate(n, s) : Fl.applyUpdate(n, s)).pipe(Qs((o)=>{
                        const a = Fl.updateProgress(o, {
                            appliedId: BigInt(r.transaction.id)
                        }), { transactionHistoryService: c } = e();
                        return c.create(r), a;
                    }));
                }
            }
        }), dm = {
        getSignatureData (t, e) {
            if (!t.intents) return st(new mi({
                message: "Transaction has no intents"
            }));
            const n = t.intents.get(e);
            return n ? yo({
                try: ()=>n.signatureData(e),
                catch: (r)=>new mi({
                        message: "Failed to get offer signature data",
                        cause: r
                    })
            }) : st(new mi({
                message: `Intent with segment ${e} was not found`
            }));
        },
        getSegments (t) {
            return t.intents?.keys().toArray() ?? [];
        },
        addSignature (t, e, n) {
            return qs(function*() {
                if (!t.intents || t.intents.size === 0) return yield* st(new mi({
                    message: "No intents found in the transaction"
                }));
                const r = t.intents?.get(n);
                return r ? dm.isIntentBound(r) ? yield* st(new mi({
                    message: `Intent at segment ${n} is already bound`
                })) : (r.fallibleUnshieldedOffer && (r.fallibleUnshieldedOffer = yield* dm.addSignaturesToOffer(r.fallibleUnshieldedOffer, e, n, "fallible")), r.guaranteedUnshieldedOffer && (r.guaranteedUnshieldedOffer = yield* dm.addSignaturesToOffer(r.guaranteedUnshieldedOffer, e, n, "guaranteed")), t.intents = t.intents.set(n, r), t) : yield* st(new mi({
                    message: `Intent with id ${n} was not found`
                }));
            });
        },
        getImbalances (t, e) {
            const n = t.imbalances(e).entries().filter(([r, s])=>r.tag === "unshielded" && s !== 0n).map(([r, s])=>[
                    r.raw.toString(),
                    s
                ]).toArray();
            return Es.fromEntries(n);
        },
        addSignaturesToOffer (t, e, n, r) {
            return V(t.inputs, Ps((s, i)=>t.signatures.at(i) ?? e), (s)=>yo({
                    try: ()=>t.addSignatures(s),
                    catch: (i)=>new mi({
                            message: `Failed to add ${r} signature at segment ${n}`,
                            cause: i
                        })
                }));
        },
        isIntentBound (t) {
            return t.binding.instance === "binding";
        },
        extractOwnInputs (t, e) {
            const n = dm.getSegments(t);
            return V(n, vg((r)=>{
                const s = t.intents?.get(r);
                if (!s) return [];
                const { guaranteedUnshieldedOffer: i, fallibleUnshieldedOffer: o } = s, a = i?.inputs ? i.inputs.filter((l)=>l.owner === e) : [], c = o ? o.inputs.filter((l)=>l.owner === e) : [];
                return [
                    ...a,
                    ...c
                ];
            }));
        }
    }, zb = 0, Srt = (t, e)=>new krt(t.networkId, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability, dm);
    let krt = class {
        networkId;
        getCoinSelection;
        txOps;
        getCoins;
        getKeys;
        constructor(e, n, r, s, i){
            this.getCoins = r, this.networkId = e, this.getCoinSelection = n, this.getKeys = s, this.txOps = i;
        }
        balanceUnboundTransaction(e, n) {
            return this.#s(e, n);
        }
        balanceUnprovenTransaction(e, n) {
            return this.#s(e, n);
        }
        balanceFinalizedTransaction(e, n) {
            return qs(this, function*() {
                const r = this.txOps.getSegments(n);
                for (const u of r){
                    const d = n.intents?.get(u);
                    if (!this.txOps.isIntentBound(d)) return yield* st(new mi({
                        message: `Intent with id ${u} is not bound`
                    }));
                }
                const s = n.intents?.get(r[0]), i = this.txOps.getImbalances(n, zb);
                if (i.size === 0) return [
                    void 0,
                    e
                ];
                const o = yield* this.#t(e, i, Es.empty(), this.getCoinSelection()), { newState: a, offer: c } = yield* this.#n(e, o), l = Zr.new(s.ttl);
                return l.guaranteedUnshieldedOffer = c, [
                    _n.fromPartsRandomized(this.networkId, void 0, void 0, l),
                    a
                ];
            });
        }
        makeTransfer(e, n, r) {
            return qs(this, function*() {
                const { networkId: s } = this;
                if (!n.every((f)=>f.amount > 0n)) return yield* st(new mi({
                    message: "The amount of all inputs needs to be positive"
                }));
                const o = n.map((f)=>({
                        value: f.amount,
                        owner: f.receiverAddress.data.toString("hex"),
                        type: f.type
                    })), a = yield* this.#t(e, Es.empty(), Es.fromEntries(o.map((f)=>[
                        f.type,
                        f.value
                    ])), this.getCoinSelection()), { newState: c, offer: l } = yield* this.#n(e, {
                    inputs: a.inputs,
                    outputs: [
                        ...a.outputs,
                        ...o
                    ]
                }), u = Zr.new(r);
                return o.some((f)=>f.type === Yx().raw) ? u.fallibleUnshieldedOffer = l : u.guaranteedUnshieldedOffer = l, {
                    newState: c,
                    transaction: _n.fromParts(s, void 0, void 0, u)
                };
            });
        }
        initSwap(e, n, r, s) {
            return qs(this, function*() {
                const { networkId: i } = this;
                if (!r.every((m)=>m.amount > 0n)) return yield* st(new mi({
                    message: "The amount of all outputs needs to be positive"
                }));
                if (!Object.entries(n).every(([, m])=>m > 0n)) return yield* st(new mi({
                    message: "The amount of all inputs needs to be positive"
                }));
                const c = r.map((m)=>({
                        value: m.amount,
                        owner: m.receiverAddress.data.toString("hex"),
                        type: m.type
                    })), l = Es.fromEntries(Object.entries(n)), u = yield* this.#t(e, Es.empty(), l, this.getCoinSelection()), { newState: d, offer: f } = yield* this.#n(e, {
                    inputs: u.inputs,
                    outputs: [
                        ...u.outputs,
                        ...c
                    ]
                }), p = Zr.new(s);
                p.guaranteedUnshieldedOffer = f;
                const h = _n.fromParts(i, void 0, void 0, p);
                return {
                    newState: d,
                    transaction: h
                };
            });
        }
        signUnprovenTransaction(e, n) {
            return this.#e(e, n);
        }
        signUnboundTransaction(e, n) {
            return this.#e(e, n);
        }
        #e(e, n) {
            return qs(this, function*() {
                const r = this.txOps.getSegments(e);
                if (!r.length) throw new frt({
                    message: "No segments found in the provided transaction"
                });
                for (const s of r){
                    const i = yield* this.txOps.getSignatureData(e, s), o = n(i);
                    e = yield* this.txOps.addSignature(e, o, s);
                }
                return e;
            });
        }
        revertTransaction(e, n) {
            return V(this.txOps.extractOwnInputs(n, e.publicKey.publicKey), nu(mt(e), (r, s)=>V(r, _g((i)=>Fl.rollbackUtxo(i, s)))));
        }
        #t(e, n, r, s) {
            return yo({
                try: ()=>b2({
                        coins: this.getCoins().getAvailableCoins(e).map(({ utxo: i })=>i),
                        initialImbalances: n,
                        feeTokenType: "",
                        transactionCostModel: {
                            inputFeeOverhead: 0n,
                            outputFeeOverhead: 0n
                        },
                        coinSelection: s,
                        createOutput: (i)=>({
                                ...i,
                                owner: e.publicKey.addressHex
                            }),
                        isCoinEqual: (i, o)=>i.intentHash === o.intentHash && i.outputNo === o.outputNo,
                        targetImbalances: r
                    }),
                catch: (i)=>i instanceof jm ? new drt({
                        message: "Insufficient funds",
                        tokenType: i.tokenType,
                        amount: n.get(i.tokenType) ?? 0n
                    }) : new gQ({
                        message: "Balancing unshielded segment failed",
                        cause: i
                    })
            });
        }
        #n(e, n) {
            return qs(function*() {
                const [r, s] = yield* Fl.spendUtxos(e, n.inputs), { publicKey: i } = e.publicKey, o = r.map((c)=>({
                        ...c,
                        intentHash: c.intentHash,
                        owner: i
                    })), a = yield* yo({
                    try: ()=>mo.new(o, [
                            ...n.outputs
                        ], []),
                    catch: (c)=>new mi({
                            message: "Failed to create counter offer",
                            cause: c
                        })
                });
                return {
                    newState: s,
                    offer: a
                };
            });
        }
        #r(e, n) {
            return V(Mp(n), dn({
                onNone: ()=>mt(e),
                onSome: (r)=>yo({
                        try: ()=>mo.new([
                                ...r.inputs,
                                ...e.inputs
                            ], [
                                ...r.outputs,
                                ...e.outputs
                            ], [
                                ...r.signatures,
                                ...e.signatures
                            ]),
                        catch: (s)=>new mi({
                                message: "Failed to merge offers",
                                cause: s
                            })
                    })
            }));
        }
        #s(e, n) {
            return qs(this, function*() {
                const r = this.txOps.getSegments(n);
                if (r.length === 0) return [
                    void 0,
                    e
                ];
                for (const s of [
                    ...r,
                    zb
                ]){
                    const i = this.txOps.getImbalances(n, s);
                    if (i.size === 0) continue;
                    const o = s === zb ? r[0] : s, a = n.intents?.get(o);
                    if (!a) return yield* st(new mi({
                        message: `Intent with id ${s} was not found`
                    }));
                    if (this.txOps.isIntentBound(a)) return yield* st(new mi({
                        message: `Intent with id ${s} is already bound`
                    }));
                    const l = yield* this.#t(e, i, Es.empty(), this.getCoinSelection()), { offer: u } = yield* this.#n(e, l), d = s !== zb ? a.fallibleUnshieldedOffer : a.guaranteedUnshieldedOffer, f = yield* this.#r(u, d);
                    s !== zb ? a.fallibleUnshieldedOffer = f : a.guaranteedUnshieldedOffer = f, n.intents = n.intents.set(o, a);
                }
                return [
                    n,
                    e
                ];
            });
        }
    };
    const dF = (t)=>t.reduce((e, { utxo: n })=>({
                ...e,
                [n.type]: e[n.type] === void 0 ? n.value : e[n.type] + n.value
            }), {}), Trt = ()=>{
        const t = (o)=>{
            const a = r(o);
            return dF(a);
        }, e = (o)=>{
            const a = s(o);
            return dF(a);
        }, n = (o)=>{
            const a = t(o), c = e(o);
            return V([
                a,
                c
            ], RZ(0n, (l, u)=>l + u));
        }, r = (o)=>Xo.toArrays(o.state).availableUtxos, s = (o)=>Xo.toArrays(o.state).pendingUtxos;
        return {
            getAvailableBalances: t,
            getPendingBalances: e,
            getTotalBalances: n,
            getAvailableCoins: r,
            getPendingCoins: s,
            getTotalCoins: (o)=>[
                    ...r(o),
                    ...s(o)
                ]
        };
    };
    var ff = {}, Ub = {}, fF;
    function f9() {
        if (fF) return Ub;
        fF = 1, Object.defineProperty(Ub, "__esModule", {
            value: !0
        }), Ub.TypeKind = void 0;
        var t;
        return (function(e) {
            e[e.Primitive = 0] = "Primitive", e[e.Compact = 1] = "Compact", e[e.Sequence = 2] = "Sequence", e[e.BitSequence = 3] = "BitSequence", e[e.Array = 4] = "Array", e[e.Tuple = 5] = "Tuple", e[e.Composite = 6] = "Composite", e[e.Variant = 7] = "Variant", e[e.Option = 8] = "Option", e[e.DoNotConstruct = 9] = "DoNotConstruct", e[e.BooleanOption = 10] = "BooleanOption", e[e.Bytes = 11] = "Bytes", e[e.BytesArray = 12] = "BytesArray", e[e.HexBytes = 13] = "HexBytes", e[e.HexBytesArray = 14] = "HexBytesArray", e[e.Struct = 15] = "Struct";
        })(t || (Ub.TypeKind = t = {})), Ub;
    }
    var pf = {}, Ta = {}, qS = {
        exports: {}
    }, WS = {}, KS = {}, $S = {}, XS, pF;
    function bP() {
        return pF || (pF = 1, XS = function() {
            if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1;
            if (typeof Symbol.iterator == "symbol") return !0;
            var e = {}, n = Symbol("test"), r = Object(n);
            if (typeof n == "string" || Object.prototype.toString.call(n) !== "[object Symbol]" || Object.prototype.toString.call(r) !== "[object Symbol]") return !1;
            var s = 42;
            e[n] = s;
            for(var i in e)return !1;
            if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) return !1;
            var o = Object.getOwnPropertySymbols(e);
            if (o.length !== 1 || o[0] !== n || !Object.prototype.propertyIsEnumerable.call(e, n)) return !1;
            if (typeof Object.getOwnPropertyDescriptor == "function") {
                var a = Object.getOwnPropertyDescriptor(e, n);
                if (a.value !== s || a.enumerable !== !0) return !1;
            }
            return !0;
        }), XS;
    }
    var GS, hF;
    function p9() {
        if (hF) return GS;
        hF = 1;
        var t = bP();
        return GS = function() {
            return t() && !!Symbol.toStringTag;
        }, GS;
    }
    var ZS, gF;
    function mP() {
        return gF || (gF = 1, ZS = Object), ZS;
    }
    var JS, bF;
    function Crt() {
        return bF || (bF = 1, JS = Error), JS;
    }
    var YS, mF;
    function Ert() {
        return mF || (mF = 1, YS = EvalError), YS;
    }
    var QS, yF;
    function Irt() {
        return yF || (yF = 1, QS = RangeError), QS;
    }
    var e4, wF;
    function Art() {
        return wF || (wF = 1, e4 = ReferenceError), e4;
    }
    var t4, _F;
    function mQ() {
        return _F || (_F = 1, t4 = SyntaxError), t4;
    }
    var n4, xF;
    function W1() {
        return xF || (xF = 1, n4 = TypeError), n4;
    }
    var r4, vF;
    function Prt() {
        return vF || (vF = 1, r4 = URIError), r4;
    }
    var s4, SF;
    function Ort() {
        return SF || (SF = 1, s4 = Math.abs), s4;
    }
    var i4, kF;
    function Mrt() {
        return kF || (kF = 1, i4 = Math.floor), i4;
    }
    var o4, TF;
    function Rrt() {
        return TF || (TF = 1, o4 = Math.max), o4;
    }
    var a4, CF;
    function Nrt() {
        return CF || (CF = 1, a4 = Math.min), a4;
    }
    var c4, EF;
    function Vrt() {
        return EF || (EF = 1, c4 = Math.pow), c4;
    }
    var l4, IF;
    function Drt() {
        return IF || (IF = 1, l4 = Math.round), l4;
    }
    var u4, AF;
    function Brt() {
        return AF || (AF = 1, u4 = Number.isNaN || function(e) {
            return e !== e;
        }), u4;
    }
    var d4, PF;
    function Frt() {
        if (PF) return d4;
        PF = 1;
        var t = Brt();
        return d4 = function(n) {
            return t(n) || n === 0 ? n : n < 0 ? -1 : 1;
        }, d4;
    }
    var f4, OF;
    function Lrt() {
        return OF || (OF = 1, f4 = Object.getOwnPropertyDescriptor), f4;
    }
    var p4, MF;
    function rb() {
        if (MF) return p4;
        MF = 1;
        var t = Lrt();
        if (t) try {
            t([], "length");
        } catch  {
            t = null;
        }
        return p4 = t, p4;
    }
    var h4, RF;
    function h9() {
        if (RF) return h4;
        RF = 1;
        var t = Object.defineProperty || !1;
        if (t) try {
            t({}, "a", {
                value: 1
            });
        } catch  {
            t = !1;
        }
        return h4 = t, h4;
    }
    var g4, NF;
    function zrt() {
        if (NF) return g4;
        NF = 1;
        var t = typeof Symbol < "u" && Symbol, e = bP();
        return g4 = function() {
            return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
        }, g4;
    }
    var b4, VF;
    function yQ() {
        return VF || (VF = 1, b4 = typeof Reflect < "u" && Reflect.getPrototypeOf || null), b4;
    }
    var m4, DF;
    function wQ() {
        if (DF) return m4;
        DF = 1;
        var t = mP();
        return m4 = t.getPrototypeOf || null, m4;
    }
    var y4, BF;
    function Urt() {
        if (BF) return y4;
        BF = 1;
        var t = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, n = Math.max, r = "[object Function]", s = function(c, l) {
            for(var u = [], d = 0; d < c.length; d += 1)u[d] = c[d];
            for(var f = 0; f < l.length; f += 1)u[f + c.length] = l[f];
            return u;
        }, i = function(c, l) {
            for(var u = [], d = l, f = 0; d < c.length; d += 1, f += 1)u[f] = c[d];
            return u;
        }, o = function(a, c) {
            for(var l = "", u = 0; u < a.length; u += 1)l += a[u], u + 1 < a.length && (l += c);
            return l;
        };
        return y4 = function(c) {
            var l = this;
            if (typeof l != "function" || e.apply(l) !== r) throw new TypeError(t + l);
            for(var u = i(arguments, 1), d, f = function() {
                if (this instanceof d) {
                    var v = l.apply(this, s(u, arguments));
                    return Object(v) === v ? v : this;
                }
                return l.apply(c, s(u, arguments));
            }, p = n(0, l.length - u.length), h = [], m = 0; m < p; m++)h[m] = "$" + m;
            if (d = Function("binder", "return function (" + o(h, ",") + "){ return binder.apply(this,arguments); }")(f), l.prototype) {
                var w = function() {};
                w.prototype = l.prototype, d.prototype = new w, w.prototype = null;
            }
            return d;
        }, y4;
    }
    var w4, FF;
    function K1() {
        if (FF) return w4;
        FF = 1;
        var t = Urt();
        return w4 = Function.prototype.bind || t, w4;
    }
    var _4, LF;
    function yP() {
        return LF || (LF = 1, _4 = Function.prototype.call), _4;
    }
    var x4, zF;
    function wP() {
        return zF || (zF = 1, x4 = Function.prototype.apply), x4;
    }
    var v4, UF;
    function Hrt() {
        return UF || (UF = 1, v4 = typeof Reflect < "u" && Reflect && Reflect.apply), v4;
    }
    var S4, HF;
    function _Q() {
        if (HF) return S4;
        HF = 1;
        var t = K1(), e = wP(), n = yP(), r = Hrt();
        return S4 = r || t.call(n, e), S4;
    }
    var k4, jF;
    function _P() {
        if (jF) return k4;
        jF = 1;
        var t = K1(), e = W1(), n = yP(), r = _Q();
        return k4 = function(i) {
            if (i.length < 1 || typeof i[0] != "function") throw new e("a function is required");
            return r(t, n, i);
        }, k4;
    }
    var T4, qF;
    function jrt() {
        if (qF) return T4;
        qF = 1;
        var t = _P(), e = rb(), n;
        try {
            n = [].__proto__ === Array.prototype;
        } catch (o) {
            if (!o || typeof o != "object" || !("code" in o) || o.code !== "ERR_PROTO_ACCESS") throw o;
        }
        var r = !!n && e && e(Object.prototype, "__proto__"), s = Object, i = s.getPrototypeOf;
        return T4 = r && typeof r.get == "function" ? t([
            r.get
        ]) : typeof i == "function" ? function(a) {
            return i(a == null ? a : s(a));
        } : !1, T4;
    }
    var C4, WF;
    function xP() {
        if (WF) return C4;
        WF = 1;
        var t = yQ(), e = wQ(), n = jrt();
        return C4 = t ? function(s) {
            return t(s);
        } : e ? function(s) {
            if (!s || typeof s != "object" && typeof s != "function") throw new TypeError("getProto: not an object");
            return e(s);
        } : n ? function(s) {
            return n(s);
        } : null, C4;
    }
    var E4, KF;
    function xQ() {
        if (KF) return E4;
        KF = 1;
        var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, n = K1();
        return E4 = n.call(t, e), E4;
    }
    var I4, $F;
    function vP() {
        if ($F) return I4;
        $F = 1;
        var t, e = mP(), n = Crt(), r = Ert(), s = Irt(), i = Art(), o = mQ(), a = W1(), c = Prt(), l = Ort(), u = Mrt(), d = Rrt(), f = Nrt(), p = Vrt(), h = Drt(), m = Frt(), w = Function, v = function(se) {
            try {
                return w('"use strict"; return (' + se + ").constructor;")();
            } catch  {}
        }, k = rb(), _ = h9(), A = function() {
            throw new a;
        }, P = k ? (function() {
            try {
                return arguments.callee, A;
            } catch  {
                try {
                    return k(arguments, "callee").get;
                } catch  {
                    return A;
                }
            }
        })() : A, U = zrt()(), K = xP(), X = wQ(), G = yQ(), ce = wP(), ie = yP(), Y = {}, M = typeof Uint8Array > "u" || !K ? t : K(Uint8Array), g = {
            __proto__: null,
            "%AggregateError%": typeof AggregateError > "u" ? t : AggregateError,
            "%Array%": Array,
            "%ArrayBuffer%": typeof ArrayBuffer > "u" ? t : ArrayBuffer,
            "%ArrayIteratorPrototype%": U && K ? K([][Symbol.iterator]()) : t,
            "%AsyncFromSyncIteratorPrototype%": t,
            "%AsyncFunction%": Y,
            "%AsyncGenerator%": Y,
            "%AsyncGeneratorFunction%": Y,
            "%AsyncIteratorPrototype%": Y,
            "%Atomics%": typeof Atomics > "u" ? t : Atomics,
            "%BigInt%": typeof BigInt > "u" ? t : BigInt,
            "%BigInt64Array%": typeof BigInt64Array > "u" ? t : BigInt64Array,
            "%BigUint64Array%": typeof BigUint64Array > "u" ? t : BigUint64Array,
            "%Boolean%": Boolean,
            "%DataView%": typeof DataView > "u" ? t : DataView,
            "%Date%": Date,
            "%decodeURI%": decodeURI,
            "%decodeURIComponent%": decodeURIComponent,
            "%encodeURI%": encodeURI,
            "%encodeURIComponent%": encodeURIComponent,
            "%Error%": n,
            "%eval%": eval,
            "%EvalError%": r,
            "%Float16Array%": typeof Float16Array > "u" ? t : Float16Array,
            "%Float32Array%": typeof Float32Array > "u" ? t : Float32Array,
            "%Float64Array%": typeof Float64Array > "u" ? t : Float64Array,
            "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? t : FinalizationRegistry,
            "%Function%": w,
            "%GeneratorFunction%": Y,
            "%Int8Array%": typeof Int8Array > "u" ? t : Int8Array,
            "%Int16Array%": typeof Int16Array > "u" ? t : Int16Array,
            "%Int32Array%": typeof Int32Array > "u" ? t : Int32Array,
            "%isFinite%": isFinite,
            "%isNaN%": isNaN,
            "%IteratorPrototype%": U && K ? K(K([][Symbol.iterator]())) : t,
            "%JSON%": typeof JSON == "object" ? JSON : t,
            "%Map%": typeof Map > "u" ? t : Map,
            "%MapIteratorPrototype%": typeof Map > "u" || !U || !K ? t : K(new Map()[Symbol.iterator]()),
            "%Math%": Math,
            "%Number%": Number,
            "%Object%": e,
            "%Object.getOwnPropertyDescriptor%": k,
            "%parseFloat%": parseFloat,
            "%parseInt%": parseInt,
            "%Promise%": typeof Promise > "u" ? t : Promise,
            "%Proxy%": typeof Proxy > "u" ? t : Proxy,
            "%RangeError%": s,
            "%ReferenceError%": i,
            "%Reflect%": typeof Reflect > "u" ? t : Reflect,
            "%RegExp%": RegExp,
            "%Set%": typeof Set > "u" ? t : Set,
            "%SetIteratorPrototype%": typeof Set > "u" || !U || !K ? t : K(new Set()[Symbol.iterator]()),
            "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? t : SharedArrayBuffer,
            "%String%": String,
            "%StringIteratorPrototype%": U && K ? K(""[Symbol.iterator]()) : t,
            "%Symbol%": U ? Symbol : t,
            "%SyntaxError%": o,
            "%ThrowTypeError%": P,
            "%TypedArray%": M,
            "%TypeError%": a,
            "%Uint8Array%": typeof Uint8Array > "u" ? t : Uint8Array,
            "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? t : Uint8ClampedArray,
            "%Uint16Array%": typeof Uint16Array > "u" ? t : Uint16Array,
            "%Uint32Array%": typeof Uint32Array > "u" ? t : Uint32Array,
            "%URIError%": c,
            "%WeakMap%": typeof WeakMap > "u" ? t : WeakMap,
            "%WeakRef%": typeof WeakRef > "u" ? t : WeakRef,
            "%WeakSet%": typeof WeakSet > "u" ? t : WeakSet,
            "%Function.prototype.call%": ie,
            "%Function.prototype.apply%": ce,
            "%Object.defineProperty%": _,
            "%Object.getPrototypeOf%": X,
            "%Math.abs%": l,
            "%Math.floor%": u,
            "%Math.max%": d,
            "%Math.min%": f,
            "%Math.pow%": p,
            "%Math.round%": h,
            "%Math.sign%": m,
            "%Reflect.getPrototypeOf%": G
        };
        if (K) try {
            null.error;
        } catch (se) {
            var y = K(K(se));
            g["%Error.prototype%"] = y;
        }
        var C = function se(fe) {
            var ge;
            if (fe === "%AsyncFunction%") ge = v("async function () {}");
            else if (fe === "%GeneratorFunction%") ge = v("function* () {}");
            else if (fe === "%AsyncGeneratorFunction%") ge = v("async function* () {}");
            else if (fe === "%AsyncGenerator%") {
                var Ce = se("%AsyncGeneratorFunction%");
                Ce && (ge = Ce.prototype);
            } else if (fe === "%AsyncIteratorPrototype%") {
                var Ue = se("%AsyncGenerator%");
                Ue && K && (ge = K(Ue.prototype));
            }
            return g[fe] = ge, ge;
        }, R = {
            __proto__: null,
            "%ArrayBufferPrototype%": [
                "ArrayBuffer",
                "prototype"
            ],
            "%ArrayPrototype%": [
                "Array",
                "prototype"
            ],
            "%ArrayProto_entries%": [
                "Array",
                "prototype",
                "entries"
            ],
            "%ArrayProto_forEach%": [
                "Array",
                "prototype",
                "forEach"
            ],
            "%ArrayProto_keys%": [
                "Array",
                "prototype",
                "keys"
            ],
            "%ArrayProto_values%": [
                "Array",
                "prototype",
                "values"
            ],
            "%AsyncFunctionPrototype%": [
                "AsyncFunction",
                "prototype"
            ],
            "%AsyncGenerator%": [
                "AsyncGeneratorFunction",
                "prototype"
            ],
            "%AsyncGeneratorPrototype%": [
                "AsyncGeneratorFunction",
                "prototype",
                "prototype"
            ],
            "%BooleanPrototype%": [
                "Boolean",
                "prototype"
            ],
            "%DataViewPrototype%": [
                "DataView",
                "prototype"
            ],
            "%DatePrototype%": [
                "Date",
                "prototype"
            ],
            "%ErrorPrototype%": [
                "Error",
                "prototype"
            ],
            "%EvalErrorPrototype%": [
                "EvalError",
                "prototype"
            ],
            "%Float32ArrayPrototype%": [
                "Float32Array",
                "prototype"
            ],
            "%Float64ArrayPrototype%": [
                "Float64Array",
                "prototype"
            ],
            "%FunctionPrototype%": [
                "Function",
                "prototype"
            ],
            "%Generator%": [
                "GeneratorFunction",
                "prototype"
            ],
            "%GeneratorPrototype%": [
                "GeneratorFunction",
                "prototype",
                "prototype"
            ],
            "%Int8ArrayPrototype%": [
                "Int8Array",
                "prototype"
            ],
            "%Int16ArrayPrototype%": [
                "Int16Array",
                "prototype"
            ],
            "%Int32ArrayPrototype%": [
                "Int32Array",
                "prototype"
            ],
            "%JSONParse%": [
                "JSON",
                "parse"
            ],
            "%JSONStringify%": [
                "JSON",
                "stringify"
            ],
            "%MapPrototype%": [
                "Map",
                "prototype"
            ],
            "%NumberPrototype%": [
                "Number",
                "prototype"
            ],
            "%ObjectPrototype%": [
                "Object",
                "prototype"
            ],
            "%ObjProto_toString%": [
                "Object",
                "prototype",
                "toString"
            ],
            "%ObjProto_valueOf%": [
                "Object",
                "prototype",
                "valueOf"
            ],
            "%PromisePrototype%": [
                "Promise",
                "prototype"
            ],
            "%PromiseProto_then%": [
                "Promise",
                "prototype",
                "then"
            ],
            "%Promise_all%": [
                "Promise",
                "all"
            ],
            "%Promise_reject%": [
                "Promise",
                "reject"
            ],
            "%Promise_resolve%": [
                "Promise",
                "resolve"
            ],
            "%RangeErrorPrototype%": [
                "RangeError",
                "prototype"
            ],
            "%ReferenceErrorPrototype%": [
                "ReferenceError",
                "prototype"
            ],
            "%RegExpPrototype%": [
                "RegExp",
                "prototype"
            ],
            "%SetPrototype%": [
                "Set",
                "prototype"
            ],
            "%SharedArrayBufferPrototype%": [
                "SharedArrayBuffer",
                "prototype"
            ],
            "%StringPrototype%": [
                "String",
                "prototype"
            ],
            "%SymbolPrototype%": [
                "Symbol",
                "prototype"
            ],
            "%SyntaxErrorPrototype%": [
                "SyntaxError",
                "prototype"
            ],
            "%TypedArrayPrototype%": [
                "TypedArray",
                "prototype"
            ],
            "%TypeErrorPrototype%": [
                "TypeError",
                "prototype"
            ],
            "%Uint8ArrayPrototype%": [
                "Uint8Array",
                "prototype"
            ],
            "%Uint8ClampedArrayPrototype%": [
                "Uint8ClampedArray",
                "prototype"
            ],
            "%Uint16ArrayPrototype%": [
                "Uint16Array",
                "prototype"
            ],
            "%Uint32ArrayPrototype%": [
                "Uint32Array",
                "prototype"
            ],
            "%URIErrorPrototype%": [
                "URIError",
                "prototype"
            ],
            "%WeakMapPrototype%": [
                "WeakMap",
                "prototype"
            ],
            "%WeakSetPrototype%": [
                "WeakSet",
                "prototype"
            ]
        }, N = K1(), L = xQ(), z = N.call(ie, Array.prototype.concat), B = N.call(ce, Array.prototype.splice), x = N.call(ie, String.prototype.replace), O = N.call(ie, String.prototype.slice), q = N.call(ie, RegExp.prototype.exec), H = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Z = /\\(\\)?/g, te = function(fe) {
            var ge = O(fe, 0, 1), Ce = O(fe, -1);
            if (ge === "%" && Ce !== "%") throw new o("invalid intrinsic syntax, expected closing `%`");
            if (Ce === "%" && ge !== "%") throw new o("invalid intrinsic syntax, expected opening `%`");
            var Ue = [];
            return x(fe, H, function(Ie, Le, Ge, Ve) {
                Ue[Ue.length] = Ge ? x(Ve, Z, "$1") : Le || Ie;
            }), Ue;
        }, J = function(fe, ge) {
            var Ce = fe, Ue;
            if (L(R, Ce) && (Ue = R[Ce], Ce = "%" + Ue[0] + "%"), L(g, Ce)) {
                var Ie = g[Ce];
                if (Ie === Y && (Ie = C(Ce)), typeof Ie > "u" && !ge) throw new a("intrinsic " + fe + " exists, but is not available. Please file an issue!");
                return {
                    alias: Ue,
                    name: Ce,
                    value: Ie
                };
            }
            throw new o("intrinsic " + fe + " does not exist!");
        };
        return I4 = function(fe, ge) {
            if (typeof fe != "string" || fe.length === 0) throw new a("intrinsic name must be a non-empty string");
            if (arguments.length > 1 && typeof ge != "boolean") throw new a('"allowMissing" argument must be a boolean');
            if (q(/^%?[^%]*%?$/, fe) === null) throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
            var Ce = te(fe), Ue = Ce.length > 0 ? Ce[0] : "", Ie = J("%" + Ue + "%", ge), Le = Ie.name, Ge = Ie.value, Ve = !1, Ne = Ie.alias;
            Ne && (Ue = Ne[0], B(Ce, z([
                0,
                1
            ], Ne)));
            for(var be = 1, Qe = !0; be < Ce.length; be += 1){
                var le = Ce[be], De = O(le, 0, 1), Re = O(le, -1);
                if ((De === '"' || De === "'" || De === "`" || Re === '"' || Re === "'" || Re === "`") && De !== Re) throw new o("property names with quotes must have matching quotes");
                if ((le === "constructor" || !Qe) && (Ve = !0), Ue += "." + le, Le = "%" + Ue + "%", L(g, Le)) Ge = g[Le];
                else if (Ge != null) {
                    if (!(le in Ge)) {
                        if (!ge) throw new a("base intrinsic for " + fe + " exists, but the property is not available.");
                        return;
                    }
                    if (k && be + 1 >= Ce.length) {
                        var ee = k(Ge, le);
                        Qe = !!ee, Qe && "get" in ee && !("originalValue" in ee.get) ? Ge = ee.get : Ge = Ge[le];
                    } else Qe = L(Ge, le), Ge = Ge[le];
                    Qe && !Ve && (g[Le] = Ge);
                }
            }
            return Ge;
        }, I4;
    }
    var A4, XF;
    sb = function() {
        if (XF) return A4;
        XF = 1;
        var t = vP(), e = _P(), n = e([
            t("%String.prototype.indexOf%")
        ]);
        return A4 = function(s, i) {
            var o = t(s, !!i);
            return typeof o == "function" && n(s, ".prototype.") > -1 ? e([
                o
            ]) : o;
        }, A4;
    };
    var P4, GF;
    function qrt() {
        if (GF) return P4;
        GF = 1;
        var t = p9()(), e = sb(), n = e("Object.prototype.toString"), r = function(a) {
            return t && a && typeof a == "object" && Symbol.toStringTag in a ? !1 : n(a) === "[object Arguments]";
        }, s = function(a) {
            return r(a) ? !0 : a !== null && typeof a == "object" && "length" in a && typeof a.length == "number" && a.length >= 0 && n(a) !== "[object Array]" && "callee" in a && n(a.callee) === "[object Function]";
        }, i = (function() {
            return r(arguments);
        })();
        return r.isLegacyArguments = s, P4 = i ? r : s, P4;
    }
    var O4, ZF;
    function Wrt() {
        if (ZF) return O4;
        ZF = 1;
        var t = sb(), e = p9()(), n = xQ(), r = rb(), s;
        if (e) {
            var i = t("RegExp.prototype.exec"), o = {}, a = function() {
                throw o;
            }, c = {
                toString: a,
                valueOf: a
            };
            typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = a), s = function(f) {
                if (!f || typeof f != "object") return !1;
                var p = r(f, "lastIndex"), h = p && n(p, "value");
                if (!h) return !1;
                try {
                    i(f, c);
                } catch (m) {
                    return m === o;
                }
            };
        } else {
            var l = t("Object.prototype.toString"), u = "[object RegExp]";
            s = function(f) {
                return !f || typeof f != "object" && typeof f != "function" ? !1 : l(f) === u;
            };
        }
        return O4 = s, O4;
    }
    var M4, JF;
    function Krt() {
        if (JF) return M4;
        JF = 1;
        var t = sb(), e = Wrt(), n = t("RegExp.prototype.exec"), r = W1();
        return M4 = function(i) {
            if (!e(i)) throw new r("`regex` must be a RegExp");
            return function(a) {
                return n(i, a) !== null;
            };
        }, M4;
    }
    var R4, YF;
    function $rt() {
        if (YF) return R4;
        YF = 1;
        const t = function*() {}.constructor;
        return R4 = ()=>t, R4;
    }
    var N4, QF;
    function Xrt() {
        if (QF) return N4;
        QF = 1;
        var t = sb(), e = Krt(), n = e(/^\s*(?:function)?\*/), r = p9()(), s = xP(), i = t("Object.prototype.toString"), o = t("Function.prototype.toString"), a = $rt();
        return N4 = function(l) {
            if (typeof l != "function") return !1;
            if (n(o(l))) return !0;
            if (!r) {
                var u = i(l);
                return u === "[object GeneratorFunction]";
            }
            if (!s) return !1;
            var d = a();
            return d && s(l) === d.prototype;
        }, N4;
    }
    var V4, eL;
    function Grt() {
        if (eL) return V4;
        eL = 1;
        var t = Function.prototype.toString, e = typeof Reflect == "object" && Reflect !== null && Reflect.apply, n, r;
        if (typeof e == "function" && typeof Object.defineProperty == "function") try {
            n = Object.defineProperty({}, "length", {
                get: function() {
                    throw r;
                }
            }), r = {}, e(function() {
                throw 42;
            }, null, n);
        } catch (k) {
            k !== r && (e = null);
        }
        else e = null;
        var s = /^\s*class\b/, i = function(_) {
            try {
                var A = t.call(_);
                return s.test(A);
            } catch  {
                return !1;
            }
        }, o = function(_) {
            try {
                return i(_) ? !1 : (t.call(_), !0);
            } catch  {
                return !1;
            }
        }, a = Object.prototype.toString, c = "[object Object]", l = "[object Function]", u = "[object GeneratorFunction]", d = "[object HTMLAllCollection]", f = "[object HTML document.all class]", p = "[object HTMLCollection]", h = typeof Symbol == "function" && !!Symbol.toStringTag, m = !(0 in [
            , 
        ]), w = function() {
            return !1;
        };
        if (typeof document == "object") {
            var v = document.all;
            a.call(v) === a.call(document.all) && (w = function(_) {
                if ((m || !_) && (typeof _ > "u" || typeof _ == "object")) try {
                    var A = a.call(_);
                    return (A === d || A === f || A === p || A === c) && _("") == null;
                } catch  {}
                return !1;
            });
        }
        return V4 = e ? function(_) {
            if (w(_)) return !0;
            if (!_ || typeof _ != "function" && typeof _ != "object") return !1;
            try {
                e(_, null, n);
            } catch (A) {
                if (A !== r) return !1;
            }
            return !i(_) && o(_);
        } : function(_) {
            if (w(_)) return !0;
            if (!_ || typeof _ != "function" && typeof _ != "object") return !1;
            if (h) return o(_);
            if (i(_)) return !1;
            var A = a.call(_);
            return A !== l && A !== u && !/^\[object HTML/.test(A) ? !1 : o(_);
        }, V4;
    }
    var D4, tL;
    function Zrt() {
        if (tL) return D4;
        tL = 1;
        var t = Grt(), e = Object.prototype.toString, n = Object.prototype.hasOwnProperty, r = function(c, l, u) {
            for(var d = 0, f = c.length; d < f; d++)n.call(c, d) && (u == null ? l(c[d], d, c) : l.call(u, c[d], d, c));
        }, s = function(c, l, u) {
            for(var d = 0, f = c.length; d < f; d++)u == null ? l(c.charAt(d), d, c) : l.call(u, c.charAt(d), d, c);
        }, i = function(c, l, u) {
            for(var d in c)n.call(c, d) && (u == null ? l(c[d], d, c) : l.call(u, c[d], d, c));
        };
        function o(a) {
            return e.call(a) === "[object Array]";
        }
        return D4 = function(c, l, u) {
            if (!t(l)) throw new TypeError("iterator must be a function");
            var d;
            arguments.length >= 3 && (d = u), o(c) ? r(c, l, d) : typeof c == "string" ? s(c, l, d) : i(c, l, d);
        }, D4;
    }
    var B4, nL;
    function Jrt() {
        return nL || (nL = 1, B4 = [
            "Float16Array",
            "Float32Array",
            "Float64Array",
            "Int8Array",
            "Int16Array",
            "Int32Array",
            "Uint8Array",
            "Uint8ClampedArray",
            "Uint16Array",
            "Uint32Array",
            "BigInt64Array",
            "BigUint64Array"
        ]), B4;
    }
    var F4, rL;
    function Yrt() {
        if (rL) return F4;
        rL = 1;
        var t = Jrt(), e = globalThis;
        return F4 = function() {
            for(var r = [], s = 0; s < t.length; s++)typeof e[t[s]] == "function" && (r[r.length] = t[s]);
            return r;
        }, F4;
    }
    var L4 = {
        exports: {}
    }, z4, sL;
    function vQ() {
        if (sL) return z4;
        sL = 1;
        var t = h9(), e = mQ(), n = W1(), r = rb();
        return z4 = function(i, o, a) {
            if (!i || typeof i != "object" && typeof i != "function") throw new n("`obj` must be an object or a function`");
            if (typeof o != "string" && typeof o != "symbol") throw new n("`property` must be a string or a symbol`");
            if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) throw new n("`nonEnumerable`, if provided, must be a boolean or null");
            if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) throw new n("`nonWritable`, if provided, must be a boolean or null");
            if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) throw new n("`nonConfigurable`, if provided, must be a boolean or null");
            if (arguments.length > 6 && typeof arguments[6] != "boolean") throw new n("`loose`, if provided, must be a boolean");
            var c = arguments.length > 3 ? arguments[3] : null, l = arguments.length > 4 ? arguments[4] : null, u = arguments.length > 5 ? arguments[5] : null, d = arguments.length > 6 ? arguments[6] : !1, f = !!r && r(i, o);
            if (t) t(i, o, {
                configurable: u === null && f ? f.configurable : !u,
                enumerable: c === null && f ? f.enumerable : !c,
                value: a,
                writable: l === null && f ? f.writable : !l
            });
            else if (d || !c && !l && !u) i[o] = a;
            else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
        }, z4;
    }
    var U4, iL;
    function SQ() {
        if (iL) return U4;
        iL = 1;
        var t = h9(), e = function() {
            return !!t;
        };
        return e.hasArrayLengthDefineBug = function() {
            if (!t) return null;
            try {
                return t([], "length", {
                    value: 1
                }).length !== 1;
            } catch  {
                return !0;
            }
        }, U4 = e, U4;
    }
    var H4, oL;
    function Qrt() {
        if (oL) return H4;
        oL = 1;
        var t = vP(), e = vQ(), n = SQ()(), r = rb(), s = W1(), i = t("%Math.floor%");
        return H4 = function(a, c) {
            if (typeof a != "function") throw new s("`fn` is not a function");
            if (typeof c != "number" || c < 0 || c > 4294967295 || i(c) !== c) throw new s("`length` must be a positive 32-bit integer");
            var l = arguments.length > 2 && !!arguments[2], u = !0, d = !0;
            if ("length" in a && r) {
                var f = r(a, "length");
                f && !f.configurable && (u = !1), f && !f.writable && (d = !1);
            }
            return (u || d || !l) && (n ? e(a, "length", c, !0, !0) : e(a, "length", c)), a;
        }, H4;
    }
    var j4, aL;
    function est() {
        if (aL) return j4;
        aL = 1;
        var t = K1(), e = wP(), n = _Q();
        return j4 = function() {
            return n(t, e, arguments);
        }, j4;
    }
    var cL;
    g9 = function() {
        return cL || (cL = 1, (function(t) {
            var e = Qrt(), n = h9(), r = _P(), s = est();
            t.exports = function(o) {
                var a = r(arguments), c = o.length - (arguments.length - 1);
                return e(a, 1 + (c > 0 ? c : 0), !0);
            }, n ? n(t.exports, "apply", {
                value: s
            }) : t.exports.apply = s;
        })(L4)), L4.exports;
    };
    var q4, lL;
    function kQ() {
        if (lL) return q4;
        lL = 1;
        var t = Zrt(), e = Yrt(), n = g9(), r = sb(), s = rb(), i = xP(), o = r("Object.prototype.toString"), a = p9()(), c = globalThis, l = e(), u = r("String.prototype.slice"), d = r("Array.prototype.indexOf", !0) || function(w, v) {
            for(var k = 0; k < w.length; k += 1)if (w[k] === v) return k;
            return -1;
        }, f = {
            __proto__: null
        };
        a && s && i ? t(l, function(m) {
            var w = new c[m];
            if (Symbol.toStringTag in w && i) {
                var v = i(w), k = s(v, Symbol.toStringTag);
                if (!k && v) {
                    var _ = i(v);
                    k = s(_, Symbol.toStringTag);
                }
                if (k && k.get) {
                    var A = n(k.get);
                    f["$" + m] = A;
                }
            }
        }) : t(l, function(m) {
            var w = new c[m], v = w.slice || w.set;
            if (v) {
                var k = n(v);
                f["$" + m] = k;
            }
        });
        var p = function(w) {
            var v = !1;
            return t(f, function(k, _) {
                if (!v) try {
                    "$" + k(w) === _ && (v = u(_, 1));
                } catch  {}
            }), v;
        }, h = function(w) {
            var v = !1;
            return t(f, function(k, _) {
                if (!v) try {
                    k(w), v = u(_, 1);
                } catch  {}
            }), v;
        };
        return q4 = function(w) {
            if (!w || typeof w != "object") return !1;
            if (!a) {
                var v = u(o(w), 8, -1);
                return d(l, v) > -1 ? v : v !== "Object" ? !1 : h(w);
            }
            return s ? p(w) : null;
        }, q4;
    }
    var W4, uL;
    function tst() {
        if (uL) return W4;
        uL = 1;
        var t = kQ();
        return W4 = function(n) {
            return !!t(n);
        }, W4;
    }
    var dL;
    function nst() {
        return dL || (dL = 1, (function(t) {
            var e = qrt(), n = Xrt(), r = kQ(), s = tst();
            function i(be) {
                return be.call.bind(be);
            }
            var o = typeof BigInt < "u", a = typeof Symbol < "u", c = i(Object.prototype.toString), l = i(Number.prototype.valueOf), u = i(String.prototype.valueOf), d = i(Boolean.prototype.valueOf);
            if (o) var f = i(BigInt.prototype.valueOf);
            if (a) var p = i(Symbol.prototype.valueOf);
            function h(be, Qe) {
                if (typeof be != "object") return !1;
                try {
                    return Qe(be), !0;
                } catch  {
                    return !1;
                }
            }
            t.isArgumentsObject = e, t.isGeneratorFunction = n, t.isTypedArray = s;
            function m(be) {
                return typeof Promise < "u" && be instanceof Promise || be !== null && typeof be == "object" && typeof be.then == "function" && typeof be.catch == "function";
            }
            t.isPromise = m;
            function w(be) {
                return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(be) : s(be) || O(be);
            }
            t.isArrayBufferView = w;
            function v(be) {
                return r(be) === "Uint8Array";
            }
            t.isUint8Array = v;
            function k(be) {
                return r(be) === "Uint8ClampedArray";
            }
            t.isUint8ClampedArray = k;
            function _(be) {
                return r(be) === "Uint16Array";
            }
            t.isUint16Array = _;
            function A(be) {
                return r(be) === "Uint32Array";
            }
            t.isUint32Array = A;
            function P(be) {
                return r(be) === "Int8Array";
            }
            t.isInt8Array = P;
            function U(be) {
                return r(be) === "Int16Array";
            }
            t.isInt16Array = U;
            function K(be) {
                return r(be) === "Int32Array";
            }
            t.isInt32Array = K;
            function X(be) {
                return r(be) === "Float32Array";
            }
            t.isFloat32Array = X;
            function G(be) {
                return r(be) === "Float64Array";
            }
            t.isFloat64Array = G;
            function ce(be) {
                return r(be) === "BigInt64Array";
            }
            t.isBigInt64Array = ce;
            function ie(be) {
                return r(be) === "BigUint64Array";
            }
            t.isBigUint64Array = ie;
            function Y(be) {
                return c(be) === "[object Map]";
            }
            Y.working = typeof Map < "u" && Y(new Map);
            function M(be) {
                return typeof Map > "u" ? !1 : Y.working ? Y(be) : be instanceof Map;
            }
            t.isMap = M;
            function g(be) {
                return c(be) === "[object Set]";
            }
            g.working = typeof Set < "u" && g(new Set);
            function y(be) {
                return typeof Set > "u" ? !1 : g.working ? g(be) : be instanceof Set;
            }
            t.isSet = y;
            function C(be) {
                return c(be) === "[object WeakMap]";
            }
            C.working = typeof WeakMap < "u" && C(new WeakMap);
            function R(be) {
                return typeof WeakMap > "u" ? !1 : C.working ? C(be) : be instanceof WeakMap;
            }
            t.isWeakMap = R;
            function N(be) {
                return c(be) === "[object WeakSet]";
            }
            N.working = typeof WeakSet < "u" && N(new WeakSet);
            function L(be) {
                return N(be);
            }
            t.isWeakSet = L;
            function z(be) {
                return c(be) === "[object ArrayBuffer]";
            }
            z.working = typeof ArrayBuffer < "u" && z(new ArrayBuffer);
            function B(be) {
                return typeof ArrayBuffer > "u" ? !1 : z.working ? z(be) : be instanceof ArrayBuffer;
            }
            t.isArrayBuffer = B;
            function x(be) {
                return c(be) === "[object DataView]";
            }
            x.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && x(new DataView(new ArrayBuffer(1), 0, 1));
            function O(be) {
                return typeof DataView > "u" ? !1 : x.working ? x(be) : be instanceof DataView;
            }
            t.isDataView = O;
            var q = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
            function H(be) {
                return c(be) === "[object SharedArrayBuffer]";
            }
            function Z(be) {
                return typeof q > "u" ? !1 : (typeof H.working > "u" && (H.working = H(new q)), H.working ? H(be) : be instanceof q);
            }
            t.isSharedArrayBuffer = Z;
            function te(be) {
                return c(be) === "[object AsyncFunction]";
            }
            t.isAsyncFunction = te;
            function J(be) {
                return c(be) === "[object Map Iterator]";
            }
            t.isMapIterator = J;
            function se(be) {
                return c(be) === "[object Set Iterator]";
            }
            t.isSetIterator = se;
            function fe(be) {
                return c(be) === "[object Generator]";
            }
            t.isGeneratorObject = fe;
            function ge(be) {
                return c(be) === "[object WebAssembly.Module]";
            }
            t.isWebAssemblyCompiledModule = ge;
            function Ce(be) {
                return h(be, l);
            }
            t.isNumberObject = Ce;
            function Ue(be) {
                return h(be, u);
            }
            t.isStringObject = Ue;
            function Ie(be) {
                return h(be, d);
            }
            t.isBooleanObject = Ie;
            function Le(be) {
                return o && h(be, f);
            }
            t.isBigIntObject = Le;
            function Ge(be) {
                return a && h(be, p);
            }
            t.isSymbolObject = Ge;
            function Ve(be) {
                return Ce(be) || Ue(be) || Ie(be) || Le(be) || Ge(be);
            }
            t.isBoxedPrimitive = Ve;
            function Ne(be) {
                return typeof Uint8Array < "u" && (B(be) || Z(be));
            }
            t.isAnyArrayBuffer = Ne, [
                "isProxy",
                "isExternal",
                "isModuleNamespaceObject"
            ].forEach(function(be) {
                Object.defineProperty(t, be, {
                    enumerable: !1,
                    value: function() {
                        throw new Error(be + " is not supported in userland");
                    }
                });
            });
        })($S)), $S;
    }
    var K4, fL;
    function rst() {
        return fL || (fL = 1, K4 = function(e) {
            return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
        }), K4;
    }
    var s_ = {
        exports: {}
    }, pL;
    sst = function() {
        return pL || (pL = 1, typeof Object.create == "function" ? s_.exports = function(e, n) {
            n && (e.super_ = n, e.prototype = Object.create(n.prototype, {
                constructor: {
                    value: e,
                    enumerable: !1,
                    writable: !0,
                    configurable: !0
                }
            }));
        } : s_.exports = function(e, n) {
            if (n) {
                e.super_ = n;
                var r = function() {};
                r.prototype = n.prototype, e.prototype = new r, e.prototype.constructor = e;
            }
        }), s_.exports;
    };
    var hL;
    function Oy() {
        return hL || (hL = 1, (function(t) {
            var e = {}, n = Object.getOwnPropertyDescriptors || function(q) {
                for(var H = Object.keys(q), Z = {}, te = 0; te < H.length; te++)Z[H[te]] = Object.getOwnPropertyDescriptor(q, H[te]);
                return Z;
            }, r = /%[sdj%]/g;
            t.format = function(O) {
                if (!U(O)) {
                    for(var q = [], H = 0; H < arguments.length; H++)q.push(a(arguments[H]));
                    return q.join(" ");
                }
                for(var H = 1, Z = arguments, te = Z.length, J = String(O).replace(r, function(fe) {
                    if (fe === "%%") return "%";
                    if (H >= te) return fe;
                    switch(fe){
                        case "%s":
                            return String(Z[H++]);
                        case "%d":
                            return Number(Z[H++]);
                        case "%j":
                            try {
                                return JSON.stringify(Z[H++]);
                            } catch  {
                                return "[Circular]";
                            }
                        default:
                            return fe;
                    }
                }), se = Z[H]; H < te; se = Z[++H])_(se) || !ce(se) ? J += " " + se : J += " " + a(se);
                return J;
            }, t.deprecate = function(O, q) {
                if (typeof process < "u" && process.noDeprecation === !0) return O;
                if (typeof process > "u") return function() {
                    return t.deprecate(O, q).apply(this, arguments);
                };
                var H = !1;
                function Z() {
                    if (!H) {
                        if (process.throwDeprecation) throw new Error(q);
                        process.traceDeprecation ? console.trace(q) : console.error(q), H = !0;
                    }
                    return O.apply(this, arguments);
                }
                return Z;
            };
            var s = {}, i = /^$/;
            if (e.NODE_DEBUG) {
                var o = e.NODE_DEBUG;
                o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), i = new RegExp("^" + o + "$", "i");
            }
            t.debuglog = function(O) {
                if (O = O.toUpperCase(), !s[O]) if (i.test(O)) {
                    var q = process.pid;
                    s[O] = function() {
                        var H = t.format.apply(t, arguments);
                        console.error("%s %d: %s", O, q, H);
                    };
                } else s[O] = function() {};
                return s[O];
            };
            function a(O, q) {
                var H = {
                    seen: [],
                    stylize: l
                };
                return arguments.length >= 3 && (H.depth = arguments[2]), arguments.length >= 4 && (H.colors = arguments[3]), k(q) ? H.showHidden = q : q && t._extend(H, q), X(H.showHidden) && (H.showHidden = !1), X(H.depth) && (H.depth = 2), X(H.colors) && (H.colors = !1), X(H.customInspect) && (H.customInspect = !0), H.colors && (H.stylize = c), d(H, O, H.depth);
            }
            t.inspect = a, a.colors = {
                bold: [
                    1,
                    22
                ],
                italic: [
                    3,
                    23
                ],
                underline: [
                    4,
                    24
                ],
                inverse: [
                    7,
                    27
                ],
                white: [
                    37,
                    39
                ],
                grey: [
                    90,
                    39
                ],
                black: [
                    30,
                    39
                ],
                blue: [
                    34,
                    39
                ],
                cyan: [
                    36,
                    39
                ],
                green: [
                    32,
                    39
                ],
                magenta: [
                    35,
                    39
                ],
                red: [
                    31,
                    39
                ],
                yellow: [
                    33,
                    39
                ]
            }, a.styles = {
                special: "cyan",
                number: "yellow",
                boolean: "yellow",
                undefined: "grey",
                null: "bold",
                string: "green",
                date: "magenta",
                regexp: "red"
            };
            function c(O, q) {
                var H = a.styles[q];
                return H ? "\x1B[" + a.colors[H][0] + "m" + O + "\x1B[" + a.colors[H][1] + "m" : O;
            }
            function l(O, q) {
                return O;
            }
            function u(O) {
                var q = {};
                return O.forEach(function(H, Z) {
                    q[H] = !0;
                }), q;
            }
            function d(O, q, H) {
                if (O.customInspect && q && M(q.inspect) && q.inspect !== t.inspect && !(q.constructor && q.constructor.prototype === q)) {
                    var Z = q.inspect(H, O);
                    return U(Z) || (Z = d(O, Z, H)), Z;
                }
                var te = f(O, q);
                if (te) return te;
                var J = Object.keys(q), se = u(J);
                if (O.showHidden && (J = Object.getOwnPropertyNames(q)), Y(q) && (J.indexOf("message") >= 0 || J.indexOf("description") >= 0)) return p(q);
                if (J.length === 0) {
                    if (M(q)) {
                        var fe = q.name ? ": " + q.name : "";
                        return O.stylize("[Function" + fe + "]", "special");
                    }
                    if (G(q)) return O.stylize(RegExp.prototype.toString.call(q), "regexp");
                    if (ie(q)) return O.stylize(Date.prototype.toString.call(q), "date");
                    if (Y(q)) return p(q);
                }
                var ge = "", Ce = !1, Ue = [
                    "{",
                    "}"
                ];
                if (v(q) && (Ce = !0, Ue = [
                    "[",
                    "]"
                ]), M(q)) {
                    var Ie = q.name ? ": " + q.name : "";
                    ge = " [Function" + Ie + "]";
                }
                if (G(q) && (ge = " " + RegExp.prototype.toString.call(q)), ie(q) && (ge = " " + Date.prototype.toUTCString.call(q)), Y(q) && (ge = " " + p(q)), J.length === 0 && (!Ce || q.length == 0)) return Ue[0] + ge + Ue[1];
                if (H < 0) return G(q) ? O.stylize(RegExp.prototype.toString.call(q), "regexp") : O.stylize("[Object]", "special");
                O.seen.push(q);
                var Le;
                return Ce ? Le = h(O, q, H, se, J) : Le = J.map(function(Ge) {
                    return m(O, q, H, se, Ge, Ce);
                }), O.seen.pop(), w(Le, ge, Ue);
            }
            function f(O, q) {
                if (X(q)) return O.stylize("undefined", "undefined");
                if (U(q)) {
                    var H = "'" + JSON.stringify(q).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
                    return O.stylize(H, "string");
                }
                if (P(q)) return O.stylize("" + q, "number");
                if (k(q)) return O.stylize("" + q, "boolean");
                if (_(q)) return O.stylize("null", "null");
            }
            function p(O) {
                return "[" + Error.prototype.toString.call(O) + "]";
            }
            function h(O, q, H, Z, te) {
                for(var J = [], se = 0, fe = q.length; se < fe; ++se)L(q, String(se)) ? J.push(m(O, q, H, Z, String(se), !0)) : J.push("");
                return te.forEach(function(ge) {
                    ge.match(/^\d+$/) || J.push(m(O, q, H, Z, ge, !0));
                }), J;
            }
            function m(O, q, H, Z, te, J) {
                var se, fe, ge;
                if (ge = Object.getOwnPropertyDescriptor(q, te) || {
                    value: q[te]
                }, ge.get ? ge.set ? fe = O.stylize("[Getter/Setter]", "special") : fe = O.stylize("[Getter]", "special") : ge.set && (fe = O.stylize("[Setter]", "special")), L(Z, te) || (se = "[" + te + "]"), fe || (O.seen.indexOf(ge.value) < 0 ? (_(H) ? fe = d(O, ge.value, null) : fe = d(O, ge.value, H - 1), fe.indexOf(`
`) > -1 && (J ? fe = fe.split(`
`).map(function(Ce) {
                    return "  " + Ce;
                }).join(`
`).slice(2) : fe = `
` + fe.split(`
`).map(function(Ce) {
                    return "   " + Ce;
                }).join(`
`))) : fe = O.stylize("[Circular]", "special")), X(se)) {
                    if (J && te.match(/^\d+$/)) return fe;
                    se = JSON.stringify("" + te), se.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (se = se.slice(1, -1), se = O.stylize(se, "name")) : (se = se.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), se = O.stylize(se, "string"));
                }
                return se + ": " + fe;
            }
            function w(O, q, H) {
                var Z = O.reduce(function(te, J) {
                    return J.indexOf(`
`) >= 0, te + J.replace(/\u001b\[\d\d?m/g, "").length + 1;
                }, 0);
                return Z > 60 ? H[0] + (q === "" ? "" : q + `
 `) + " " + O.join(`,
  `) + " " + H[1] : H[0] + q + " " + O.join(", ") + " " + H[1];
            }
            t.types = nst();
            function v(O) {
                return Array.isArray(O);
            }
            t.isArray = v;
            function k(O) {
                return typeof O == "boolean";
            }
            t.isBoolean = k;
            function _(O) {
                return O === null;
            }
            t.isNull = _;
            function A(O) {
                return O == null;
            }
            t.isNullOrUndefined = A;
            function P(O) {
                return typeof O == "number";
            }
            t.isNumber = P;
            function U(O) {
                return typeof O == "string";
            }
            t.isString = U;
            function K(O) {
                return typeof O == "symbol";
            }
            t.isSymbol = K;
            function X(O) {
                return O === void 0;
            }
            t.isUndefined = X;
            function G(O) {
                return ce(O) && y(O) === "[object RegExp]";
            }
            t.isRegExp = G, t.types.isRegExp = G;
            function ce(O) {
                return typeof O == "object" && O !== null;
            }
            t.isObject = ce;
            function ie(O) {
                return ce(O) && y(O) === "[object Date]";
            }
            t.isDate = ie, t.types.isDate = ie;
            function Y(O) {
                return ce(O) && (y(O) === "[object Error]" || O instanceof Error);
            }
            t.isError = Y, t.types.isNativeError = Y;
            function M(O) {
                return typeof O == "function";
            }
            t.isFunction = M;
            function g(O) {
                return O === null || typeof O == "boolean" || typeof O == "number" || typeof O == "string" || typeof O == "symbol" || typeof O > "u";
            }
            t.isPrimitive = g, t.isBuffer = rst();
            function y(O) {
                return Object.prototype.toString.call(O);
            }
            function C(O) {
                return O < 10 ? "0" + O.toString(10) : O.toString(10);
            }
            var R = [
                "Jan",
                "Feb",
                "Mar",
                "Apr",
                "May",
                "Jun",
                "Jul",
                "Aug",
                "Sep",
                "Oct",
                "Nov",
                "Dec"
            ];
            function N() {
                var O = new Date, q = [
                    C(O.getHours()),
                    C(O.getMinutes()),
                    C(O.getSeconds())
                ].join(":");
                return [
                    O.getDate(),
                    R[O.getMonth()],
                    q
                ].join(" ");
            }
            t.log = function() {
                N(), t.format.apply(t, arguments);
            }, t.inherits = sst(), t._extend = function(O, q) {
                if (!q || !ce(q)) return O;
                for(var H = Object.keys(q), Z = H.length; Z--;)O[H[Z]] = q[H[Z]];
                return O;
            };
            function L(O, q) {
                return Object.prototype.hasOwnProperty.call(O, q);
            }
            var z = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
            t.promisify = function(q) {
                if (typeof q != "function") throw new TypeError('The "original" argument must be of type Function');
                if (z && q[z]) {
                    var H = q[z];
                    if (typeof H != "function") throw new TypeError('The "util.promisify.custom" argument must be of type Function');
                    return Object.defineProperty(H, z, {
                        value: H,
                        enumerable: !1,
                        writable: !1,
                        configurable: !0
                    }), H;
                }
                function H() {
                    for(var Z, te, J = new Promise(function(ge, Ce) {
                        Z = ge, te = Ce;
                    }), se = [], fe = 0; fe < arguments.length; fe++)se.push(arguments[fe]);
                    se.push(function(ge, Ce) {
                        ge ? te(ge) : Z(Ce);
                    });
                    try {
                        q.apply(this, se);
                    } catch (ge) {
                        te(ge);
                    }
                    return J;
                }
                return Object.setPrototypeOf(H, Object.getPrototypeOf(q)), z && Object.defineProperty(H, z, {
                    value: H,
                    enumerable: !1,
                    writable: !1,
                    configurable: !0
                }), Object.defineProperties(H, n(q));
            }, t.promisify.custom = z;
            function B(O, q) {
                if (!O) {
                    var H = new Error("Promise was rejected with a falsy value");
                    H.reason = O, O = H;
                }
                return q(O);
            }
            function x(O) {
                if (typeof O != "function") throw new TypeError('The "original" argument must be of type Function');
                function q() {
                    for(var H = [], Z = 0; Z < arguments.length; Z++)H.push(arguments[Z]);
                    var te = H.pop();
                    if (typeof te != "function") throw new TypeError("The last argument must be of type Function");
                    var J = this, se = function() {
                        return te.apply(J, arguments);
                    };
                    O.apply(this, H).then(function(fe) {
                        process.nextTick(se.bind(null, null, fe));
                    }, function(fe) {
                        process.nextTick(B.bind(null, fe, se));
                    });
                }
                return Object.setPrototypeOf(q, Object.getPrototypeOf(O)), Object.defineProperties(q, n(O)), q;
            }
            t.callbackify = x;
        })(KS)), KS;
    }
    var gL;
    function TQ() {
        if (gL) return WS;
        gL = 1;
        function t(k) {
            "@babel/helpers - typeof";
            return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(_) {
                return typeof _;
            } : function(_) {
                return _ && typeof Symbol == "function" && _.constructor === Symbol && _ !== Symbol.prototype ? "symbol" : typeof _;
            }, t(k);
        }
        function e(k, _, A) {
            return Object.defineProperty(k, "prototype", {
                writable: !1
            }), k;
        }
        function n(k, _) {
            if (!(k instanceof _)) throw new TypeError("Cannot call a class as a function");
        }
        function r(k, _) {
            if (typeof _ != "function" && _ !== null) throw new TypeError("Super expression must either be null or a function");
            k.prototype = Object.create(_ && _.prototype, {
                constructor: {
                    value: k,
                    writable: !0,
                    configurable: !0
                }
            }), Object.defineProperty(k, "prototype", {
                writable: !1
            }), _ && s(k, _);
        }
        function s(k, _) {
            return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(P, U) {
                return P.__proto__ = U, P;
            }, s(k, _);
        }
        function i(k) {
            var _ = c();
            return function() {
                var P = l(k), U;
                if (_) {
                    var K = l(this).constructor;
                    U = Reflect.construct(P, arguments, K);
                } else U = P.apply(this, arguments);
                return o(this, U);
            };
        }
        function o(k, _) {
            if (_ && (t(_) === "object" || typeof _ == "function")) return _;
            if (_ !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
            return a(k);
        }
        function a(k) {
            if (k === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return k;
        }
        function c() {
            if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
            if (typeof Proxy == "function") return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0;
            } catch  {
                return !1;
            }
        }
        function l(k) {
            return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(A) {
                return A.__proto__ || Object.getPrototypeOf(A);
            }, l(k);
        }
        var u = {}, d, f;
        function p(k, _, A) {
            A || (A = Error);
            function P(K, X, G) {
                return typeof _ == "string" ? _ : _(K, X, G);
            }
            var U = (function(K) {
                r(G, K);
                var X = i(G);
                function G(ce, ie, Y) {
                    var M;
                    return n(this, G), M = X.call(this, P(ce, ie, Y)), M.code = k, M;
                }
                return e(G);
            })(A);
            u[k] = U;
        }
        function h(k, _) {
            if (Array.isArray(k)) {
                var A = k.length;
                return k = k.map(function(P) {
                    return String(P);
                }), A > 2 ? "one of ".concat(_, " ").concat(k.slice(0, A - 1).join(", "), ", or ") + k[A - 1] : A === 2 ? "one of ".concat(_, " ").concat(k[0], " or ").concat(k[1]) : "of ".concat(_, " ").concat(k[0]);
            } else return "of ".concat(_, " ").concat(String(k));
        }
        function m(k, _, A) {
            return k.substr(0, _.length) === _;
        }
        function w(k, _, A) {
            return (A === void 0 || A > k.length) && (A = k.length), k.substring(A - _.length, A) === _;
        }
        function v(k, _, A) {
            return typeof A != "number" && (A = 0), A + _.length > k.length ? !1 : k.indexOf(_, A) !== -1;
        }
        return p("ERR_AMBIGUOUS_ARGUMENT", 'The "%s" argument is ambiguous. %s', TypeError), p("ERR_INVALID_ARG_TYPE", function(k, _, A) {
            d === void 0 && (d = du()), d(typeof k == "string", "'name' must be a string");
            var P;
            typeof _ == "string" && m(_, "not ") ? (P = "must not be", _ = _.replace(/^not /, "")) : P = "must be";
            var U;
            if (w(k, " argument")) U = "The ".concat(k, " ").concat(P, " ").concat(h(_, "type"));
            else {
                var K = v(k, ".") ? "property" : "argument";
                U = 'The "'.concat(k, '" ').concat(K, " ").concat(P, " ").concat(h(_, "type"));
            }
            return U += ". Received type ".concat(t(A)), U;
        }, TypeError), p("ERR_INVALID_ARG_VALUE", function(k, _) {
            var A = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "is invalid";
            f === void 0 && (f = Oy());
            var P = f.inspect(_);
            return P.length > 128 && (P = "".concat(P.slice(0, 128), "...")), "The argument '".concat(k, "' ").concat(A, ". Received ").concat(P);
        }, TypeError), p("ERR_INVALID_RETURN_VALUE", function(k, _, A) {
            var P;
            return A && A.constructor && A.constructor.name ? P = "instance of ".concat(A.constructor.name) : P = "type ".concat(t(A)), "Expected ".concat(k, ' to be returned from the "').concat(_, '"') + " function but got ".concat(P, ".");
        }, TypeError), p("ERR_MISSING_ARGS", function() {
            for(var k = arguments.length, _ = new Array(k), A = 0; A < k; A++)_[A] = arguments[A];
            d === void 0 && (d = du()), d(_.length > 0, "At least one arg needs to be specified");
            var P = "The ", U = _.length;
            switch(_ = _.map(function(K) {
                return '"'.concat(K, '"');
            }), U){
                case 1:
                    P += "".concat(_[0], " argument");
                    break;
                case 2:
                    P += "".concat(_[0], " and ").concat(_[1], " arguments");
                    break;
                default:
                    P += _.slice(0, U - 1).join(", "), P += ", and ".concat(_[U - 1], " arguments");
                    break;
            }
            return "".concat(P, " must be specified");
        }, TypeError), WS.codes = u, WS;
    }
    var $4, bL;
    function ist() {
        if (bL) return $4;
        bL = 1;
        function t(L, z) {
            var B = Object.keys(L);
            if (Object.getOwnPropertySymbols) {
                var x = Object.getOwnPropertySymbols(L);
                z && (x = x.filter(function(O) {
                    return Object.getOwnPropertyDescriptor(L, O).enumerable;
                })), B.push.apply(B, x);
            }
            return B;
        }
        function e(L) {
            for(var z = 1; z < arguments.length; z++){
                var B = arguments[z] != null ? arguments[z] : {};
                z % 2 ? t(Object(B), !0).forEach(function(x) {
                    n(L, x, B[x]);
                }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(L, Object.getOwnPropertyDescriptors(B)) : t(Object(B)).forEach(function(x) {
                    Object.defineProperty(L, x, Object.getOwnPropertyDescriptor(B, x));
                });
            }
            return L;
        }
        function n(L, z, B) {
            return z = o(z), z in L ? Object.defineProperty(L, z, {
                value: B,
                enumerable: !0,
                configurable: !0,
                writable: !0
            }) : L[z] = B, L;
        }
        function r(L, z) {
            if (!(L instanceof z)) throw new TypeError("Cannot call a class as a function");
        }
        function s(L, z) {
            for(var B = 0; B < z.length; B++){
                var x = z[B];
                x.enumerable = x.enumerable || !1, x.configurable = !0, "value" in x && (x.writable = !0), Object.defineProperty(L, o(x.key), x);
            }
        }
        function i(L, z, B) {
            return z && s(L.prototype, z), Object.defineProperty(L, "prototype", {
                writable: !1
            }), L;
        }
        function o(L) {
            var z = a(L, "string");
            return k(z) === "symbol" ? z : String(z);
        }
        function a(L, z) {
            if (k(L) !== "object" || L === null) return L;
            var B = L[Symbol.toPrimitive];
            if (B !== void 0) {
                var x = B.call(L, z);
                if (k(x) !== "object") return x;
                throw new TypeError("@@toPrimitive must return a primitive value.");
            }
            return String(L);
        }
        function c(L, z) {
            if (typeof z != "function" && z !== null) throw new TypeError("Super expression must either be null or a function");
            L.prototype = Object.create(z && z.prototype, {
                constructor: {
                    value: L,
                    writable: !0,
                    configurable: !0
                }
            }), Object.defineProperty(L, "prototype", {
                writable: !1
            }), z && w(L, z);
        }
        function l(L) {
            var z = h();
            return function() {
                var x = v(L), O;
                if (z) {
                    var q = v(this).constructor;
                    O = Reflect.construct(x, arguments, q);
                } else O = x.apply(this, arguments);
                return u(this, O);
            };
        }
        function u(L, z) {
            if (z && (k(z) === "object" || typeof z == "function")) return z;
            if (z !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
            return d(L);
        }
        function d(L) {
            if (L === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return L;
        }
        function f(L) {
            var z = typeof Map == "function" ? new Map : void 0;
            return f = function(x) {
                if (x === null || !m(x)) return x;
                if (typeof x != "function") throw new TypeError("Super expression must either be null or a function");
                if (typeof z < "u") {
                    if (z.has(x)) return z.get(x);
                    z.set(x, O);
                }
                function O() {
                    return p(x, arguments, v(this).constructor);
                }
                return O.prototype = Object.create(x.prototype, {
                    constructor: {
                        value: O,
                        enumerable: !1,
                        writable: !0,
                        configurable: !0
                    }
                }), w(O, x);
            }, f(L);
        }
        function p(L, z, B) {
            return h() ? p = Reflect.construct.bind() : p = function(O, q, H) {
                var Z = [
                    null
                ];
                Z.push.apply(Z, q);
                var te = Function.bind.apply(O, Z), J = new te;
                return H && w(J, H.prototype), J;
            }, p.apply(null, arguments);
        }
        function h() {
            if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
            if (typeof Proxy == "function") return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0;
            } catch  {
                return !1;
            }
        }
        function m(L) {
            return Function.toString.call(L).indexOf("[native code]") !== -1;
        }
        function w(L, z) {
            return w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(x, O) {
                return x.__proto__ = O, x;
            }, w(L, z);
        }
        function v(L) {
            return v = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(B) {
                return B.__proto__ || Object.getPrototypeOf(B);
            }, v(L);
        }
        function k(L) {
            "@babel/helpers - typeof";
            return k = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(z) {
                return typeof z;
            } : function(z) {
                return z && typeof Symbol == "function" && z.constructor === Symbol && z !== Symbol.prototype ? "symbol" : typeof z;
            }, k(L);
        }
        var _ = Oy(), A = _.inspect, P = TQ(), U = P.codes.ERR_INVALID_ARG_TYPE;
        function K(L, z, B) {
            return (B === void 0 || B > L.length) && (B = L.length), L.substring(B - z.length, B) === z;
        }
        function X(L, z) {
            if (z = Math.floor(z), L.length == 0 || z == 0) return "";
            var B = L.length * z;
            for(z = Math.floor(Math.log(z) / Math.log(2)); z;)L += L, z--;
            return L += L.substring(0, B - L.length), L;
        }
        var G = "", ce = "", ie = "", Y = "", M = {
            deepStrictEqual: "Expected values to be strictly deep-equal:",
            strictEqual: "Expected values to be strictly equal:",
            strictEqualObject: 'Expected "actual" to be reference-equal to "expected":',
            deepEqual: "Expected values to be loosely deep-equal:",
            equal: "Expected values to be loosely equal:",
            notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:',
            notStrictEqual: 'Expected "actual" to be strictly unequal to:',
            notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":',
            notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:',
            notEqual: 'Expected "actual" to be loosely unequal to:',
            notIdentical: "Values identical but not reference-equal:"
        }, g = 10;
        function y(L) {
            var z = Object.keys(L), B = Object.create(Object.getPrototypeOf(L));
            return z.forEach(function(x) {
                B[x] = L[x];
            }), Object.defineProperty(B, "message", {
                value: L.message
            }), B;
        }
        function C(L) {
            return A(L, {
                compact: !1,
                customInspect: !1,
                depth: 1e3,
                maxArrayLength: 1 / 0,
                showHidden: !1,
                breakLength: 1 / 0,
                showProxy: !1,
                sorted: !0,
                getters: !0
            });
        }
        function R(L, z, B) {
            var x = "", O = "", q = 0, H = "", Z = !1, te = C(L), J = te.split(`
`), se = C(z).split(`
`), fe = 0, ge = "";
            if (B === "strictEqual" && k(L) === "object" && k(z) === "object" && L !== null && z !== null && (B = "strictEqualObject"), J.length === 1 && se.length === 1 && J[0] !== se[0]) {
                var Ce = J[0].length + se[0].length;
                if (Ce <= g) {
                    if ((k(L) !== "object" || L === null) && (k(z) !== "object" || z === null) && (L !== 0 || z !== 0)) return "".concat(M[B], `

`) + "".concat(J[0], " !== ").concat(se[0], `
`);
                } else if (B !== "strictEqualObject") {
                    var Ue = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;
                    if (Ce < Ue) {
                        for(; J[0][fe] === se[0][fe];)fe++;
                        fe > 2 && (ge = `
  `.concat(X(" ", fe), "^"), fe = 0);
                    }
                }
            }
            for(var Ie = J[J.length - 1], Le = se[se.length - 1]; Ie === Le && (fe++ < 2 ? H = `
  `.concat(Ie).concat(H) : x = Ie, J.pop(), se.pop(), !(J.length === 0 || se.length === 0));)Ie = J[J.length - 1], Le = se[se.length - 1];
            var Ge = Math.max(J.length, se.length);
            if (Ge === 0) {
                var Ve = te.split(`
`);
                if (Ve.length > 30) for(Ve[26] = "".concat(G, "...").concat(Y); Ve.length > 27;)Ve.pop();
                return "".concat(M.notIdentical, `

`).concat(Ve.join(`
`), `
`);
            }
            fe > 3 && (H = `
`.concat(G, "...").concat(Y).concat(H), Z = !0), x !== "" && (H = `
  `.concat(x).concat(H), x = "");
            var Ne = 0, be = M[B] + `
`.concat(ce, "+ actual").concat(Y, " ").concat(ie, "- expected").concat(Y), Qe = " ".concat(G, "...").concat(Y, " Lines skipped");
            for(fe = 0; fe < Ge; fe++){
                var le = fe - q;
                if (J.length < fe + 1) le > 1 && fe > 2 && (le > 4 ? (O += `
`.concat(G, "...").concat(Y), Z = !0) : le > 3 && (O += `
  `.concat(se[fe - 2]), Ne++), O += `
  `.concat(se[fe - 1]), Ne++), q = fe, x += `
`.concat(ie, "-").concat(Y, " ").concat(se[fe]), Ne++;
                else if (se.length < fe + 1) le > 1 && fe > 2 && (le > 4 ? (O += `
`.concat(G, "...").concat(Y), Z = !0) : le > 3 && (O += `
  `.concat(J[fe - 2]), Ne++), O += `
  `.concat(J[fe - 1]), Ne++), q = fe, O += `
`.concat(ce, "+").concat(Y, " ").concat(J[fe]), Ne++;
                else {
                    var De = se[fe], Re = J[fe], ee = Re !== De && (!K(Re, ",") || Re.slice(0, -1) !== De);
                    ee && K(De, ",") && De.slice(0, -1) === Re && (ee = !1, Re += ","), ee ? (le > 1 && fe > 2 && (le > 4 ? (O += `
`.concat(G, "...").concat(Y), Z = !0) : le > 3 && (O += `
  `.concat(J[fe - 2]), Ne++), O += `
  `.concat(J[fe - 1]), Ne++), q = fe, O += `
`.concat(ce, "+").concat(Y, " ").concat(Re), x += `
`.concat(ie, "-").concat(Y, " ").concat(De), Ne += 2) : (O += x, x = "", (le === 1 || fe === 0) && (O += `
  `.concat(Re), Ne++));
                }
                if (Ne > 20 && fe < Ge - 2) return "".concat(be).concat(Qe, `
`).concat(O, `
`).concat(G, "...").concat(Y).concat(x, `
`) + "".concat(G, "...").concat(Y);
            }
            return "".concat(be).concat(Z ? Qe : "", `
`).concat(O).concat(x).concat(H).concat(ge);
        }
        var N = (function(L, z) {
            c(x, L);
            var B = l(x);
            function x(O) {
                var q;
                if (r(this, x), k(O) !== "object" || O === null) throw new U("options", "Object", O);
                var H = O.message, Z = O.operator, te = O.stackStartFn, J = O.actual, se = O.expected, fe = Error.stackTraceLimit;
                if (Error.stackTraceLimit = 0, H != null) q = B.call(this, String(H));
                else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 ? (G = "\x1B[34m", ce = "\x1B[32m", Y = "\x1B[39m", ie = "\x1B[31m") : (G = "", ce = "", Y = "", ie = "")), k(J) === "object" && J !== null && k(se) === "object" && se !== null && "stack" in J && J instanceof Error && "stack" in se && se instanceof Error && (J = y(J), se = y(se)), Z === "deepStrictEqual" || Z === "strictEqual") q = B.call(this, R(J, se, Z));
                else if (Z === "notDeepStrictEqual" || Z === "notStrictEqual") {
                    var ge = M[Z], Ce = C(J).split(`
`);
                    if (Z === "notStrictEqual" && k(J) === "object" && J !== null && (ge = M.notStrictEqualObject), Ce.length > 30) for(Ce[26] = "".concat(G, "...").concat(Y); Ce.length > 27;)Ce.pop();
                    Ce.length === 1 ? q = B.call(this, "".concat(ge, " ").concat(Ce[0])) : q = B.call(this, "".concat(ge, `

`).concat(Ce.join(`
`), `
`));
                } else {
                    var Ue = C(J), Ie = "", Le = M[Z];
                    Z === "notDeepEqual" || Z === "notEqual" ? (Ue = "".concat(M[Z], `

`).concat(Ue), Ue.length > 1024 && (Ue = "".concat(Ue.slice(0, 1021), "..."))) : (Ie = "".concat(C(se)), Ue.length > 512 && (Ue = "".concat(Ue.slice(0, 509), "...")), Ie.length > 512 && (Ie = "".concat(Ie.slice(0, 509), "...")), Z === "deepEqual" || Z === "equal" ? Ue = "".concat(Le, `

`).concat(Ue, `

should equal

`) : Ie = " ".concat(Z, " ").concat(Ie)), q = B.call(this, "".concat(Ue).concat(Ie));
                }
                return Error.stackTraceLimit = fe, q.generatedMessage = !H, Object.defineProperty(d(q), "name", {
                    value: "AssertionError [ERR_ASSERTION]",
                    enumerable: !1,
                    writable: !0,
                    configurable: !0
                }), q.code = "ERR_ASSERTION", q.actual = J, q.expected = se, q.operator = Z, Error.captureStackTrace && Error.captureStackTrace(d(q), te), q.stack, q.name = "AssertionError", u(q);
            }
            return i(x, [
                {
                    key: "toString",
                    value: function() {
                        return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message);
                    }
                },
                {
                    key: z,
                    value: function(q, H) {
                        return A(this, e(e({}, H), {}, {
                            customInspect: !1,
                            depth: 0
                        }));
                    }
                }
            ]), x;
        })(f(Error), A.custom);
        return $4 = N, $4;
    }
    var X4, mL;
    function CQ() {
        if (mL) return X4;
        mL = 1;
        var t = Object.prototype.toString;
        return X4 = function(n) {
            var r = t.call(n), s = r === "[object Arguments]";
            return s || (s = r !== "[object Array]" && n !== null && typeof n == "object" && typeof n.length == "number" && n.length >= 0 && t.call(n.callee) === "[object Function]"), s;
        }, X4;
    }
    var G4, yL;
    function ost() {
        if (yL) return G4;
        yL = 1;
        var t;
        if (!Object.keys) {
            var e = Object.prototype.hasOwnProperty, n = Object.prototype.toString, r = CQ(), s = Object.prototype.propertyIsEnumerable, i = !s.call({
                toString: null
            }, "toString"), o = s.call(function() {}, "prototype"), a = [
                "toString",
                "toLocaleString",
                "valueOf",
                "hasOwnProperty",
                "isPrototypeOf",
                "propertyIsEnumerable",
                "constructor"
            ], c = function(f) {
                var p = f.constructor;
                return p && p.prototype === f;
            }, l = {
                $applicationCache: !0,
                $console: !0,
                $external: !0,
                $frame: !0,
                $frameElement: !0,
                $frames: !0,
                $innerHeight: !0,
                $innerWidth: !0,
                $onmozfullscreenchange: !0,
                $onmozfullscreenerror: !0,
                $outerHeight: !0,
                $outerWidth: !0,
                $pageXOffset: !0,
                $pageYOffset: !0,
                $parent: !0,
                $scrollLeft: !0,
                $scrollTop: !0,
                $scrollX: !0,
                $scrollY: !0,
                $self: !0,
                $webkitIndexedDB: !0,
                $webkitStorageInfo: !0,
                $window: !0
            }, u = (function() {
                if (typeof window > "u") return !1;
                for(var f in window)try {
                    if (!l["$" + f] && e.call(window, f) && window[f] !== null && typeof window[f] == "object") try {
                        c(window[f]);
                    } catch  {
                        return !0;
                    }
                } catch  {
                    return !0;
                }
                return !1;
            })(), d = function(f) {
                if (typeof window > "u" || !u) return c(f);
                try {
                    return c(f);
                } catch  {
                    return !1;
                }
            };
            t = function(p) {
                var h = p !== null && typeof p == "object", m = n.call(p) === "[object Function]", w = r(p), v = h && n.call(p) === "[object String]", k = [];
                if (!h && !m && !w) throw new TypeError("Object.keys called on a non-object");
                var _ = o && m;
                if (v && p.length > 0 && !e.call(p, 0)) for(var A = 0; A < p.length; ++A)k.push(String(A));
                if (w && p.length > 0) for(var P = 0; P < p.length; ++P)k.push(String(P));
                else for(var U in p)!(_ && U === "prototype") && e.call(p, U) && k.push(String(U));
                if (i) for(var K = d(p), X = 0; X < a.length; ++X)!(K && a[X] === "constructor") && e.call(p, a[X]) && k.push(a[X]);
                return k;
            };
        }
        return G4 = t, G4;
    }
    var Z4, wL;
    EQ = function() {
        if (wL) return Z4;
        wL = 1;
        var t = Array.prototype.slice, e = CQ(), n = Object.keys, r = n ? function(o) {
            return n(o);
        } : ost(), s = Object.keys;
        return r.shim = function() {
            if (Object.keys) {
                var o = (function() {
                    var a = Object.keys(arguments);
                    return a && a.length === arguments.length;
                })(1, 2);
                o || (Object.keys = function(c) {
                    return e(c) ? s(t.call(c)) : s(c);
                });
            } else Object.keys = r;
            return Object.keys || r;
        }, Z4 = r, Z4;
    };
    var J4, _L;
    function ast() {
        if (_L) return J4;
        _L = 1;
        var t = EQ(), e = bP()(), n = sb(), r = mP(), s = n("Array.prototype.push"), i = n("Object.prototype.propertyIsEnumerable"), o = e ? r.getOwnPropertySymbols : null;
        return J4 = function(c, l) {
            if (c == null) throw new TypeError("target must be an object");
            var u = r(c);
            if (arguments.length === 1) return u;
            for(var d = 1; d < arguments.length; ++d){
                var f = r(arguments[d]), p = t(f), h = e && (r.getOwnPropertySymbols || o);
                if (h) for(var m = h(f), w = 0; w < m.length; ++w){
                    var v = m[w];
                    i(f, v) && s(p, v);
                }
                for(var k = 0; k < p.length; ++k){
                    var _ = p[k];
                    if (i(f, _)) {
                        var A = f[_];
                        u[_] = A;
                    }
                }
            }
            return u;
        }, J4;
    }
    var Y4, xL;
    function cst() {
        if (xL) return Y4;
        xL = 1;
        var t = ast(), e = function() {
            if (!Object.assign) return !1;
            for(var r = "abcdefghijklmnopqrst", s = r.split(""), i = {}, o = 0; o < s.length; ++o)i[s[o]] = s[o];
            var a = Object.assign({}, i), c = "";
            for(var l in a)c += l;
            return r !== c;
        }, n = function() {
            if (!Object.assign || !Object.preventExtensions) return !1;
            var r = Object.preventExtensions({
                1: 2
            });
            try {
                Object.assign(r, "xy");
            } catch  {
                return r[1] === "y";
            }
            return !1;
        };
        return Y4 = function() {
            return !Object.assign || e() || n() ? t : Object.assign;
        }, Y4;
    }
    var Q4, vL;
    function IQ() {
        if (vL) return Q4;
        vL = 1;
        var t = function(e) {
            return e !== e;
        };
        return Q4 = function(n, r) {
            return n === 0 && r === 0 ? 1 / n === 1 / r : !!(n === r || t(n) && t(r));
        }, Q4;
    }
    var e7, SL;
    function SP() {
        if (SL) return e7;
        SL = 1;
        var t = IQ();
        return e7 = function() {
            return typeof Object.is == "function" ? Object.is : t;
        }, e7;
    }
    var t7, kL;
    function lst() {
        if (kL) return t7;
        kL = 1;
        var t = vP(), e = g9(), n = e(t("String.prototype.indexOf"));
        return t7 = function(s, i) {
            var o = t(s, !!i);
            return typeof o == "function" && n(s, ".prototype.") > -1 ? e(o) : o;
        }, t7;
    }
    var n7, TL;
    function b9() {
        if (TL) return n7;
        TL = 1;
        var t = EQ(), e = typeof Symbol == "function" && typeof Symbol("foo") == "symbol", n = Object.prototype.toString, r = Array.prototype.concat, s = vQ(), i = function(l) {
            return typeof l == "function" && n.call(l) === "[object Function]";
        }, o = SQ()(), a = function(l, u, d, f) {
            if (u in l) {
                if (f === !0) {
                    if (l[u] === d) return;
                } else if (!i(f) || !f()) return;
            }
            o ? s(l, u, d, !0) : s(l, u, d);
        }, c = function(l, u) {
            var d = arguments.length > 2 ? arguments[2] : {}, f = t(u);
            e && (f = r.call(f, Object.getOwnPropertySymbols(u)));
            for(var p = 0; p < f.length; p += 1)a(l, f[p], u[f[p]], d[f[p]]);
        };
        return c.supportsDescriptors = !!o, n7 = c, n7;
    }
    var r7, CL;
    function ust() {
        if (CL) return r7;
        CL = 1;
        var t = SP(), e = b9();
        return r7 = function() {
            var r = t();
            return e(Object, {
                is: r
            }, {
                is: function() {
                    return Object.is !== r;
                }
            }), r;
        }, r7;
    }
    var s7, EL;
    function dst() {
        if (EL) return s7;
        EL = 1;
        var t = b9(), e = g9(), n = IQ(), r = SP(), s = ust(), i = e(r(), Object);
        return t(i, {
            getPolyfill: r,
            implementation: n,
            shim: s
        }), s7 = i, s7;
    }
    var i7, IL;
    function AQ() {
        return IL || (IL = 1, i7 = function(e) {
            return e !== e;
        }), i7;
    }
    var o7, AL;
    function PQ() {
        if (AL) return o7;
        AL = 1;
        var t = AQ();
        return o7 = function() {
            return Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a") ? Number.isNaN : t;
        }, o7;
    }
    var a7, PL;
    function fst() {
        if (PL) return a7;
        PL = 1;
        var t = b9(), e = PQ();
        return a7 = function() {
            var r = e();
            return t(Number, {
                isNaN: r
            }, {
                isNaN: function() {
                    return Number.isNaN !== r;
                }
            }), r;
        }, a7;
    }
    var c7, OL;
    function pst() {
        if (OL) return c7;
        OL = 1;
        var t = g9(), e = b9(), n = AQ(), r = PQ(), s = fst(), i = t(r(), Number);
        return e(i, {
            getPolyfill: r,
            implementation: n,
            shim: s
        }), c7 = i, c7;
    }
    var l7, ML;
    function hst() {
        if (ML) return l7;
        ML = 1;
        function t(ee, oe) {
            return i(ee) || s(ee, oe) || n(ee, oe) || e();
        }
        function e() {
            throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
        }
        function n(ee, oe) {
            if (ee) {
                if (typeof ee == "string") return r(ee, oe);
                var ye = Object.prototype.toString.call(ee).slice(8, -1);
                if (ye === "Object" && ee.constructor && (ye = ee.constructor.name), ye === "Map" || ye === "Set") return Array.from(ee);
                if (ye === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ye)) return r(ee, oe);
            }
        }
        function r(ee, oe) {
            (oe == null || oe > ee.length) && (oe = ee.length);
            for(var ye = 0, D = new Array(oe); ye < oe; ye++)D[ye] = ee[ye];
            return D;
        }
        function s(ee, oe) {
            var ye = ee == null ? null : typeof Symbol < "u" && ee[Symbol.iterator] || ee["@@iterator"];
            if (ye != null) {
                var D, S, E, $, re = [], ae = !0, me = !1;
                try {
                    if (E = (ye = ye.call(ee)).next, oe !== 0) for(; !(ae = (D = E.call(ye)).done) && (re.push(D.value), re.length !== oe); ae = !0);
                } catch (Oe) {
                    me = !0, S = Oe;
                } finally{
                    try {
                        if (!ae && ye.return != null && ($ = ye.return(), Object($) !== $)) return;
                    } finally{
                        if (me) throw S;
                    }
                }
                return re;
            }
        }
        function i(ee) {
            if (Array.isArray(ee)) return ee;
        }
        function o(ee) {
            "@babel/helpers - typeof";
            return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(oe) {
                return typeof oe;
            } : function(oe) {
                return oe && typeof Symbol == "function" && oe.constructor === Symbol && oe !== Symbol.prototype ? "symbol" : typeof oe;
            }, o(ee);
        }
        var a = /a/g.flags !== void 0, c = function(oe) {
            var ye = [];
            return oe.forEach(function(D) {
                return ye.push(D);
            }), ye;
        }, l = function(oe) {
            var ye = [];
            return oe.forEach(function(D, S) {
                return ye.push([
                    S,
                    D
                ]);
            }), ye;
        }, u = Object.is ? Object.is : dst(), d = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {
            return [];
        }, f = Number.isNaN ? Number.isNaN : pst();
        function p(ee) {
            return ee.call.bind(ee);
        }
        var h = p(Object.prototype.hasOwnProperty), m = p(Object.prototype.propertyIsEnumerable), w = p(Object.prototype.toString), v = Oy().types, k = v.isAnyArrayBuffer, _ = v.isArrayBufferView, A = v.isDate, P = v.isMap, U = v.isRegExp, K = v.isSet, X = v.isNativeError, G = v.isBoxedPrimitive, ce = v.isNumberObject, ie = v.isStringObject, Y = v.isBooleanObject, M = v.isBigIntObject, g = v.isSymbolObject, y = v.isFloat32Array, C = v.isFloat64Array;
        function R(ee) {
            if (ee.length === 0 || ee.length > 10) return !0;
            for(var oe = 0; oe < ee.length; oe++){
                var ye = ee.charCodeAt(oe);
                if (ye < 48 || ye > 57) return !0;
            }
            return ee.length === 10 && ee >= Math.pow(2, 32);
        }
        function N(ee) {
            return Object.keys(ee).filter(R).concat(d(ee).filter(Object.prototype.propertyIsEnumerable.bind(ee)));
        }
        function L(ee, oe) {
            if (ee === oe) return 0;
            for(var ye = ee.length, D = oe.length, S = 0, E = Math.min(ye, D); S < E; ++S)if (ee[S] !== oe[S]) {
                ye = ee[S], D = oe[S];
                break;
            }
            return ye < D ? -1 : D < ye ? 1 : 0;
        }
        var z = !0, B = !1, x = 0, O = 1, q = 2, H = 3;
        function Z(ee, oe) {
            return a ? ee.source === oe.source && ee.flags === oe.flags : RegExp.prototype.toString.call(ee) === RegExp.prototype.toString.call(oe);
        }
        function te(ee, oe) {
            if (ee.byteLength !== oe.byteLength) return !1;
            for(var ye = 0; ye < ee.byteLength; ye++)if (ee[ye] !== oe[ye]) return !1;
            return !0;
        }
        function J(ee, oe) {
            return ee.byteLength !== oe.byteLength ? !1 : L(new Uint8Array(ee.buffer, ee.byteOffset, ee.byteLength), new Uint8Array(oe.buffer, oe.byteOffset, oe.byteLength)) === 0;
        }
        function se(ee, oe) {
            return ee.byteLength === oe.byteLength && L(new Uint8Array(ee), new Uint8Array(oe)) === 0;
        }
        function fe(ee, oe) {
            return ce(ee) ? ce(oe) && u(Number.prototype.valueOf.call(ee), Number.prototype.valueOf.call(oe)) : ie(ee) ? ie(oe) && String.prototype.valueOf.call(ee) === String.prototype.valueOf.call(oe) : Y(ee) ? Y(oe) && Boolean.prototype.valueOf.call(ee) === Boolean.prototype.valueOf.call(oe) : M(ee) ? M(oe) && BigInt.prototype.valueOf.call(ee) === BigInt.prototype.valueOf.call(oe) : g(oe) && Symbol.prototype.valueOf.call(ee) === Symbol.prototype.valueOf.call(oe);
        }
        function ge(ee, oe, ye, D) {
            if (ee === oe) return ee !== 0 ? !0 : ye ? u(ee, oe) : !0;
            if (ye) {
                if (o(ee) !== "object") return typeof ee == "number" && f(ee) && f(oe);
                if (o(oe) !== "object" || ee === null || oe === null || Object.getPrototypeOf(ee) !== Object.getPrototypeOf(oe)) return !1;
            } else {
                if (ee === null || o(ee) !== "object") return oe === null || o(oe) !== "object" ? ee == oe : !1;
                if (oe === null || o(oe) !== "object") return !1;
            }
            var S = w(ee), E = w(oe);
            if (S !== E) return !1;
            if (Array.isArray(ee)) {
                if (ee.length !== oe.length) return !1;
                var $ = N(ee), re = N(oe);
                return $.length !== re.length ? !1 : Ue(ee, oe, ye, D, O, $);
            }
            if (S === "[object Object]" && (!P(ee) && P(oe) || !K(ee) && K(oe))) return !1;
            if (A(ee)) {
                if (!A(oe) || Date.prototype.getTime.call(ee) !== Date.prototype.getTime.call(oe)) return !1;
            } else if (U(ee)) {
                if (!U(oe) || !Z(ee, oe)) return !1;
            } else if (X(ee) || ee instanceof Error) {
                if (ee.message !== oe.message || ee.name !== oe.name) return !1;
            } else if (_(ee)) {
                if (!ye && (y(ee) || C(ee))) {
                    if (!te(ee, oe)) return !1;
                } else if (!J(ee, oe)) return !1;
                var ae = N(ee), me = N(oe);
                return ae.length !== me.length ? !1 : Ue(ee, oe, ye, D, x, ae);
            } else {
                if (K(ee)) return !K(oe) || ee.size !== oe.size ? !1 : Ue(ee, oe, ye, D, q);
                if (P(ee)) return !P(oe) || ee.size !== oe.size ? !1 : Ue(ee, oe, ye, D, H);
                if (k(ee)) {
                    if (!se(ee, oe)) return !1;
                } else if (G(ee) && !fe(ee, oe)) return !1;
            }
            return Ue(ee, oe, ye, D, x);
        }
        function Ce(ee, oe) {
            return oe.filter(function(ye) {
                return m(ee, ye);
            });
        }
        function Ue(ee, oe, ye, D, S, E) {
            if (arguments.length === 5) {
                E = Object.keys(ee);
                var $ = Object.keys(oe);
                if (E.length !== $.length) return !1;
            }
            for(var re = 0; re < E.length; re++)if (!h(oe, E[re])) return !1;
            if (ye && arguments.length === 5) {
                var ae = d(ee);
                if (ae.length !== 0) {
                    var me = 0;
                    for(re = 0; re < ae.length; re++){
                        var Oe = ae[re];
                        if (m(ee, Oe)) {
                            if (!m(oe, Oe)) return !1;
                            E.push(Oe), me++;
                        } else if (m(oe, Oe)) return !1;
                    }
                    var ut = d(oe);
                    if (ae.length !== ut.length && Ce(oe, ut).length !== me) return !1;
                } else {
                    var dt = d(oe);
                    if (dt.length !== 0 && Ce(oe, dt).length !== 0) return !1;
                }
            }
            if (E.length === 0 && (S === x || S === O && ee.length === 0 || ee.size === 0)) return !0;
            if (D === void 0) D = {
                val1: new Map,
                val2: new Map,
                position: 0
            };
            else {
                var Ut = D.val1.get(ee);
                if (Ut !== void 0) {
                    var at = D.val2.get(oe);
                    if (at !== void 0) return Ut === at;
                }
                D.position++;
            }
            D.val1.set(ee, D.position), D.val2.set(oe, D.position);
            var Qt = le(ee, oe, ye, E, D, S);
            return D.val1.delete(ee), D.val2.delete(oe), Qt;
        }
        function Ie(ee, oe, ye, D) {
            for(var S = c(ee), E = 0; E < S.length; E++){
                var $ = S[E];
                if (ge(oe, $, ye, D)) return ee.delete($), !0;
            }
            return !1;
        }
        function Le(ee) {
            switch(o(ee)){
                case "undefined":
                    return null;
                case "object":
                    return;
                case "symbol":
                    return !1;
                case "string":
                    ee = +ee;
                case "number":
                    if (f(ee)) return !1;
            }
            return !0;
        }
        function Ge(ee, oe, ye) {
            var D = Le(ye);
            return D ?? (oe.has(D) && !ee.has(D));
        }
        function Ve(ee, oe, ye, D, S) {
            var E = Le(ye);
            if (E != null) return E;
            var $ = oe.get(E);
            return $ === void 0 && !oe.has(E) || !ge(D, $, !1, S) ? !1 : !ee.has(E) && ge(D, $, !1, S);
        }
        function Ne(ee, oe, ye, D) {
            for(var S = null, E = c(ee), $ = 0; $ < E.length; $++){
                var re = E[$];
                if (o(re) === "object" && re !== null) S === null && (S = new Set), S.add(re);
                else if (!oe.has(re)) {
                    if (ye || !Ge(ee, oe, re)) return !1;
                    S === null && (S = new Set), S.add(re);
                }
            }
            if (S !== null) {
                for(var ae = c(oe), me = 0; me < ae.length; me++){
                    var Oe = ae[me];
                    if (o(Oe) === "object" && Oe !== null) {
                        if (!Ie(S, Oe, ye, D)) return !1;
                    } else if (!ye && !ee.has(Oe) && !Ie(S, Oe, ye, D)) return !1;
                }
                return S.size === 0;
            }
            return !0;
        }
        function be(ee, oe, ye, D, S, E) {
            for(var $ = c(ee), re = 0; re < $.length; re++){
                var ae = $[re];
                if (ge(ye, ae, S, E) && ge(D, oe.get(ae), S, E)) return ee.delete(ae), !0;
            }
            return !1;
        }
        function Qe(ee, oe, ye, D) {
            for(var S = null, E = l(ee), $ = 0; $ < E.length; $++){
                var re = t(E[$], 2), ae = re[0], me = re[1];
                if (o(ae) === "object" && ae !== null) S === null && (S = new Set), S.add(ae);
                else {
                    var Oe = oe.get(ae);
                    if (Oe === void 0 && !oe.has(ae) || !ge(me, Oe, ye, D)) {
                        if (ye || !Ve(ee, oe, ae, me, D)) return !1;
                        S === null && (S = new Set), S.add(ae);
                    }
                }
            }
            if (S !== null) {
                for(var ut = l(oe), dt = 0; dt < ut.length; dt++){
                    var Ut = t(ut[dt], 2), at = Ut[0], Qt = Ut[1];
                    if (o(at) === "object" && at !== null) {
                        if (!be(S, ee, at, Qt, ye, D)) return !1;
                    } else if (!ye && (!ee.has(at) || !ge(ee.get(at), Qt, !1, D)) && !be(S, ee, at, Qt, !1, D)) return !1;
                }
                return S.size === 0;
            }
            return !0;
        }
        function le(ee, oe, ye, D, S, E) {
            var $ = 0;
            if (E === q) {
                if (!Ne(ee, oe, ye, S)) return !1;
            } else if (E === H) {
                if (!Qe(ee, oe, ye, S)) return !1;
            } else if (E === O) for(; $ < ee.length; $++)if (h(ee, $)) {
                if (!h(oe, $) || !ge(ee[$], oe[$], ye, S)) return !1;
            } else {
                if (h(oe, $)) return !1;
                for(var re = Object.keys(ee); $ < re.length; $++){
                    var ae = re[$];
                    if (!h(oe, ae) || !ge(ee[ae], oe[ae], ye, S)) return !1;
                }
                return re.length === Object.keys(oe).length;
            }
            for($ = 0; $ < D.length; $++){
                var me = D[$];
                if (!ge(ee[me], oe[me], ye, S)) return !1;
            }
            return !0;
        }
        function De(ee, oe) {
            return ge(ee, oe, B);
        }
        function Re(ee, oe) {
            return ge(ee, oe, z);
        }
        return l7 = {
            isDeepEqual: De,
            isDeepStrictEqual: Re
        }, l7;
    }
    var RL;
    du = function() {
        if (RL) return qS.exports;
        RL = 1;
        function t(q) {
            "@babel/helpers - typeof";
            return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(H) {
                return typeof H;
            } : function(H) {
                return H && typeof Symbol == "function" && H.constructor === Symbol && H !== Symbol.prototype ? "symbol" : typeof H;
            }, t(q);
        }
        function e(q, H, Z) {
            return Object.defineProperty(q, "prototype", {
                writable: !1
            }), q;
        }
        function n(q, H) {
            if (!(q instanceof H)) throw new TypeError("Cannot call a class as a function");
        }
        var r = TQ(), s = r.codes, i = s.ERR_AMBIGUOUS_ARGUMENT, o = s.ERR_INVALID_ARG_TYPE, a = s.ERR_INVALID_ARG_VALUE, c = s.ERR_INVALID_RETURN_VALUE, l = s.ERR_MISSING_ARGS, u = ist(), d = Oy(), f = d.inspect, p = Oy().types, h = p.isPromise, m = p.isRegExp, w = cst()(), v = SP()(), k = lst()("RegExp.prototype.test"), _, A;
        function P() {
            var q = hst();
            _ = q.isDeepEqual, A = q.isDeepStrictEqual;
        }
        var U = !1, K = qS.exports = Y, X = {};
        function G(q) {
            throw q.message instanceof Error ? q.message : new u(q);
        }
        function ce(q, H, Z, te, J) {
            var se = arguments.length, fe;
            if (se === 0) fe = "Failed";
            else if (se === 1) Z = q, q = void 0;
            else {
                if (U === !1) {
                    U = !0;
                    var ge = process.emitWarning ? process.emitWarning : console.warn.bind(console);
                    ge("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
                }
                se === 2 && (te = "!=");
            }
            if (Z instanceof Error) throw Z;
            var Ce = {
                actual: q,
                expected: H,
                operator: te === void 0 ? "fail" : te,
                stackStartFn: J || ce
            };
            Z !== void 0 && (Ce.message = Z);
            var Ue = new u(Ce);
            throw fe && (Ue.message = fe, Ue.generatedMessage = !0), Ue;
        }
        K.fail = ce, K.AssertionError = u;
        function ie(q, H, Z, te) {
            if (!Z) {
                var J = !1;
                if (H === 0) J = !0, te = "No value argument passed to `assert.ok()`";
                else if (te instanceof Error) throw te;
                var se = new u({
                    actual: Z,
                    expected: !0,
                    message: te,
                    operator: "==",
                    stackStartFn: q
                });
                throw se.generatedMessage = J, se;
            }
        }
        function Y() {
            for(var q = arguments.length, H = new Array(q), Z = 0; Z < q; Z++)H[Z] = arguments[Z];
            ie.apply(void 0, [
                Y,
                H.length
            ].concat(H));
        }
        K.ok = Y, K.equal = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            H != Z && G({
                actual: H,
                expected: Z,
                message: te,
                operator: "==",
                stackStartFn: q
            });
        }, K.notEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            H == Z && G({
                actual: H,
                expected: Z,
                message: te,
                operator: "!=",
                stackStartFn: q
            });
        }, K.deepEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _ === void 0 && P(), _(H, Z) || G({
                actual: H,
                expected: Z,
                message: te,
                operator: "deepEqual",
                stackStartFn: q
            });
        }, K.notDeepEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _ === void 0 && P(), _(H, Z) && G({
                actual: H,
                expected: Z,
                message: te,
                operator: "notDeepEqual",
                stackStartFn: q
            });
        }, K.deepStrictEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _ === void 0 && P(), A(H, Z) || G({
                actual: H,
                expected: Z,
                message: te,
                operator: "deepStrictEqual",
                stackStartFn: q
            });
        }, K.notDeepStrictEqual = M;
        function M(q, H, Z) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _ === void 0 && P(), A(q, H) && G({
                actual: q,
                expected: H,
                message: Z,
                operator: "notDeepStrictEqual",
                stackStartFn: M
            });
        }
        K.strictEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            v(H, Z) || G({
                actual: H,
                expected: Z,
                message: te,
                operator: "strictEqual",
                stackStartFn: q
            });
        }, K.notStrictEqual = function q(H, Z, te) {
            if (arguments.length < 2) throw new l("actual", "expected");
            v(H, Z) && G({
                actual: H,
                expected: Z,
                message: te,
                operator: "notStrictEqual",
                stackStartFn: q
            });
        };
        var g = e(function q(H, Z, te) {
            var J = this;
            n(this, q), Z.forEach(function(se) {
                se in H && (te !== void 0 && typeof te[se] == "string" && m(H[se]) && k(H[se], te[se]) ? J[se] = te[se] : J[se] = H[se]);
            });
        });
        function y(q, H, Z, te, J, se) {
            if (!(Z in q) || !A(q[Z], H[Z])) {
                if (!te) {
                    var fe = new g(q, J), ge = new g(H, J, q), Ce = new u({
                        actual: fe,
                        expected: ge,
                        operator: "deepStrictEqual",
                        stackStartFn: se
                    });
                    throw Ce.actual = q, Ce.expected = H, Ce.operator = se.name, Ce;
                }
                G({
                    actual: q,
                    expected: H,
                    message: te,
                    operator: se.name,
                    stackStartFn: se
                });
            }
        }
        function C(q, H, Z, te) {
            if (typeof H != "function") {
                if (m(H)) return k(H, q);
                if (arguments.length === 2) throw new o("expected", [
                    "Function",
                    "RegExp"
                ], H);
                if (t(q) !== "object" || q === null) {
                    var J = new u({
                        actual: q,
                        expected: H,
                        message: Z,
                        operator: "deepStrictEqual",
                        stackStartFn: te
                    });
                    throw J.operator = te.name, J;
                }
                var se = Object.keys(H);
                if (H instanceof Error) se.push("name", "message");
                else if (se.length === 0) throw new a("error", H, "may not be an empty object");
                return _ === void 0 && P(), se.forEach(function(fe) {
                    typeof q[fe] == "string" && m(H[fe]) && k(H[fe], q[fe]) || y(q, H, fe, Z, se, te);
                }), !0;
            }
            return H.prototype !== void 0 && q instanceof H ? !0 : Error.isPrototypeOf(H) ? !1 : H.call({}, q) === !0;
        }
        function R(q) {
            if (typeof q != "function") throw new o("fn", "Function", q);
            try {
                q();
            } catch (H) {
                return H;
            }
            return X;
        }
        function N(q) {
            return h(q) || q !== null && t(q) === "object" && typeof q.then == "function" && typeof q.catch == "function";
        }
        function L(q) {
            return Promise.resolve().then(function() {
                var H;
                if (typeof q == "function") {
                    if (H = q(), !N(H)) throw new c("instance of Promise", "promiseFn", H);
                } else if (N(q)) H = q;
                else throw new o("promiseFn", [
                    "Function",
                    "Promise"
                ], q);
                return Promise.resolve().then(function() {
                    return H;
                }).then(function() {
                    return X;
                }).catch(function(Z) {
                    return Z;
                });
            });
        }
        function z(q, H, Z, te) {
            if (typeof Z == "string") {
                if (arguments.length === 4) throw new o("error", [
                    "Object",
                    "Error",
                    "Function",
                    "RegExp"
                ], Z);
                if (t(H) === "object" && H !== null) {
                    if (H.message === Z) throw new i("error/message", 'The error message "'.concat(H.message, '" is identical to the message.'));
                } else if (H === Z) throw new i("error/message", 'The error "'.concat(H, '" is identical to the message.'));
                te = Z, Z = void 0;
            } else if (Z != null && t(Z) !== "object" && typeof Z != "function") throw new o("error", [
                "Object",
                "Error",
                "Function",
                "RegExp"
            ], Z);
            if (H === X) {
                var J = "";
                Z && Z.name && (J += " (".concat(Z.name, ")")), J += te ? ": ".concat(te) : ".";
                var se = q.name === "rejects" ? "rejection" : "exception";
                G({
                    actual: void 0,
                    expected: Z,
                    operator: q.name,
                    message: "Missing expected ".concat(se).concat(J),
                    stackStartFn: q
                });
            }
            if (Z && !C(H, Z, te, q)) throw H;
        }
        function B(q, H, Z, te) {
            if (H !== X) {
                if (typeof Z == "string" && (te = Z, Z = void 0), !Z || C(H, Z)) {
                    var J = te ? ": ".concat(te) : ".", se = q.name === "doesNotReject" ? "rejection" : "exception";
                    G({
                        actual: H,
                        expected: Z,
                        operator: q.name,
                        message: "Got unwanted ".concat(se).concat(J, `
`) + 'Actual message: "'.concat(H && H.message, '"'),
                        stackStartFn: q
                    });
                }
                throw H;
            }
        }
        K.throws = function q(H) {
            for(var Z = arguments.length, te = new Array(Z > 1 ? Z - 1 : 0), J = 1; J < Z; J++)te[J - 1] = arguments[J];
            z.apply(void 0, [
                q,
                R(H)
            ].concat(te));
        }, K.rejects = function q(H) {
            for(var Z = arguments.length, te = new Array(Z > 1 ? Z - 1 : 0), J = 1; J < Z; J++)te[J - 1] = arguments[J];
            return L(H).then(function(se) {
                return z.apply(void 0, [
                    q,
                    se
                ].concat(te));
            });
        }, K.doesNotThrow = function q(H) {
            for(var Z = arguments.length, te = new Array(Z > 1 ? Z - 1 : 0), J = 1; J < Z; J++)te[J - 1] = arguments[J];
            B.apply(void 0, [
                q,
                R(H)
            ].concat(te));
        }, K.doesNotReject = function q(H) {
            for(var Z = arguments.length, te = new Array(Z > 1 ? Z - 1 : 0), J = 1; J < Z; J++)te[J - 1] = arguments[J];
            return L(H).then(function(se) {
                return B.apply(void 0, [
                    q,
                    se
                ].concat(te));
            });
        }, K.ifError = function q(H) {
            if (H != null) {
                var Z = "ifError got unwanted exception: ";
                t(H) === "object" && typeof H.message == "string" ? H.message.length === 0 && H.constructor ? Z += H.constructor.name : Z += H.message : Z += f(H);
                var te = new u({
                    actual: H,
                    expected: null,
                    operator: "ifError",
                    message: Z,
                    stackStartFn: q
                }), J = H.stack;
                if (typeof J == "string") {
                    var se = J.split(`
`);
                    se.shift();
                    for(var fe = te.stack.split(`
`), ge = 0; ge < se.length; ge++){
                        var Ce = fe.indexOf(se[ge]);
                        if (Ce !== -1) {
                            fe = fe.slice(0, Ce);
                            break;
                        }
                    }
                    te.stack = "".concat(fe.join(`
`), `
`).concat(se.join(`
`));
                }
                throw te;
            }
        };
        function x(q, H, Z, te, J) {
            if (!m(H)) throw new o("regexp", "RegExp", H);
            var se = J === "match";
            if (typeof q != "string" || k(H, q) !== se) {
                if (Z instanceof Error) throw Z;
                var fe = !Z;
                Z = Z || (typeof q != "string" ? 'The "string" argument must be of type string. Received type ' + "".concat(t(q), " (").concat(f(q), ")") : (se ? "The input did not match the regular expression " : "The input was expected to not match the regular expression ") + "".concat(f(H), `. Input:

`).concat(f(q), `
`));
                var ge = new u({
                    actual: q,
                    expected: H,
                    message: Z,
                    operator: J,
                    stackStartFn: te
                });
                throw ge.generatedMessage = fe, ge;
            }
        }
        K.match = function q(H, Z, te) {
            x(H, Z, te, q, "match");
        }, K.doesNotMatch = function q(H, Z, te) {
            x(H, Z, te, q, "doesNotMatch");
        };
        function O() {
            for(var q = arguments.length, H = new Array(q), Z = 0; Z < q; Z++)H[Z] = arguments[Z];
            ie.apply(void 0, [
                O,
                H.length
            ].concat(H));
        }
        return K.strict = w(O, K, {
            equal: K.strictEqual,
            deepEqual: K.deepStrictEqual,
            notEqual: K.notStrictEqual,
            notDeepEqual: K.notDeepStrictEqual
        }), K.strict.strict = K.strict, qS.exports;
    };
    var NL;
    function m9() {
        if (NL) return Ta;
        NL = 1;
        var t = Ta && Ta.__importDefault || function(i) {
            return i && i.__esModule ? i : {
                default: i
            };
        };
        Object.defineProperty(Ta, "__esModule", {
            value: !0
        }), Ta.decodeHex = Ta.isHex = Ta.toHex = void 0;
        const e = t(du());
        function n(i) {
            return Buffer.isBuffer(i) ? "0x" + i.toString("hex") : "0x" + Buffer.from(i.buffer, i.byteOffset, i.byteLength).toString("hex");
        }
        Ta.toHex = n;
        function r(i) {
            return typeof i == "string" && i.length % 2 == 0 && /^0x[a-f\d]*$/i.test(i);
        }
        Ta.isHex = r;
        function s(i) {
            return (0, e.default)(r(i)), Buffer.from(i.slice(2), "hex");
        }
        return Ta.decodeHex = s, Ta;
    }
    var Qn = {}, VL;
    function $1() {
        if (VL) return Qn;
        VL = 1;
        var t = Qn && Qn.__importDefault || function(h) {
            return h && h.__esModule ? h : {
                default: h
            };
        };
        Object.defineProperty(Qn, "__esModule", {
            value: !0
        }), Qn.isObject = Qn.unsignedIntByteLength = Qn.UTF8_ENCODER = Qn.UTF8_DECODER = Qn.toUnsignedBigInt = Qn.toSignedBigInt = Qn.checkUnsignedBigInt = Qn.checkUnsignedInt = Qn.checkSignedBigInt = Qn.checkSignedInt = Qn.throwUnexpectedCase = Qn.assertNotNull = void 0;
        const e = t(du());
        function n(h, m) {
            return (0, e.default)(h != null, m), h;
        }
        Qn.assertNotNull = n;
        function r(h) {
            throw new Error(h ? `Unexpected case: ${h}` : "Unexpected case");
        }
        Qn.throwUnexpectedCase = r;
        function s(h, m, w, v, k) {
            if (!(Number.isInteger(h) && v <= h && k >= h)) throw new Error(`Invalid ${m}${w}: ${h}`);
        }
        function i(h, m, w, v, k) {
            if (!(typeof h == "bigint" && v <= h && k >= h)) throw new Error(`Invalid ${m}${w}: ${h}`);
        }
        function o(h, m) {
            let w, v;
            switch(m){
                case 8:
                    w = -128, v = 127;
                    break;
                case 16:
                    w = -32768, v = 32767;
                    break;
                case 32:
                    w = -2147483648, v = 2147483647;
                    break;
                default:
                    r(m);
            }
            s(h, "I", m, w, v);
        }
        Qn.checkSignedInt = o;
        function a(h, m) {
            let w, v;
            switch(m){
                case 64:
                    w = -(2n ** 63n), v = 2n ** 63n - 1n;
                    break;
                case 128:
                    w = -(2n ** 127n), v = 2n ** 127n - 1n;
                    break;
                case 256:
                    w = -(2n ** 255n), v = 2n ** 255n - 1n;
                    break;
                default:
                    r(m);
            }
            i(h, "I", m, w, v);
        }
        Qn.checkSignedBigInt = a;
        function c(h, m) {
            let w;
            switch(m){
                case 8:
                    w = 255;
                    break;
                case 16:
                    w = 65535;
                    break;
                case 32:
                    w = 4294967295;
                    break;
                default:
                    r(m);
            }
            s(h, "U", m, 0, w);
        }
        Qn.checkUnsignedInt = c;
        function l(h, m) {
            let w;
            switch(m){
                case 64:
                    w = 0xffffffffffffffffn;
                    break;
                case 128:
                    w = 2n ** 128n - 1n;
                    break;
                case 256:
                    w = 2n ** 256n - 1n;
                    break;
                default:
                    r(m);
            }
            i(h, "U", m, 0n, w);
        }
        Qn.checkUnsignedBigInt = l;
        function u(h, m) {
            return (0, e.default)(typeof h == "string" || typeof h == "number"), h = BigInt(h), a(h, m), h;
        }
        Qn.toSignedBigInt = u;
        function d(h, m) {
            return (0, e.default)(typeof h == "string" || typeof h == "number"), h = BigInt(h), l(h, m), h;
        }
        Qn.toUnsignedBigInt = d, Qn.UTF8_DECODER = new TextDecoder("utf-8", {
            fatal: !0,
            ignoreBOM: !1
        }), Qn.UTF8_ENCODER = new TextEncoder;
        function f(h) {
            let m = 0;
            for(; h > 0n;)h = h >> 8n, m += 1;
            return m;
        }
        Qn.unsignedIntByteLength = f;
        function p(h) {
            return h != null && typeof h == "object";
        }
        return Qn.isObject = p, Qn;
    }
    var DL;
    function OQ() {
        if (DL) return pf;
        DL = 1;
        var t = pf && pf.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(pf, "__esModule", {
            value: !0
        }), pf.Src = void 0;
        const e = m9(), n = t(du()), r = $1();
        class s {
            constructor(a){
                this.idx = 0, typeof a == "string" ? this.buf = (0, e.decodeHex)(a) : this.buf = a;
            }
            byte() {
                let a = this.buf[this.idx];
                if (a === void 0) throw i();
                return this.idx += 1, a;
            }
            i8() {
                let a = this.byte();
                return a | (a & 2 ** 7) * 33554430;
            }
            u8() {
                return this.byte();
            }
            i16() {
                let a = this.u16();
                return a | (a & 2 ** 15) * 131070;
            }
            u16() {
                let a = this.byte(), c = this.byte();
                return a + c * 2 ** 8;
            }
            i32() {
                return this.byte() + this.byte() * 2 ** 8 + this.byte() * 2 ** 16 + (this.byte() << 24);
            }
            u32() {
                return this.byte() + this.byte() * 2 ** 8 + this.byte() * 2 ** 16 + this.byte() * 2 ** 24;
            }
            i64() {
                let a = this.u32(), c = this.i32();
                return BigInt(a) + (BigInt(c) << 32n);
            }
            u64() {
                let a = this.u32(), c = this.u32();
                return BigInt(a) + (BigInt(c) << 32n);
            }
            i128() {
                let a = this.u64(), c = this.i64();
                return a + (c << 64n);
            }
            u128() {
                let a = this.u64(), c = this.u64();
                return a + (c << 64n);
            }
            i256() {
                let a = this.u128(), c = this.i128();
                return a + (c << 128n);
            }
            u256() {
                let a = this.u128(), c = this.u128();
                return a + (c << 128n);
            }
            compact() {
                let a = this.byte();
                switch(a & 3){
                    case 0:
                        return a >> 2;
                    case 1:
                        return (a >> 2) + this.byte() * 2 ** 6;
                    case 2:
                        return (a >> 2) + this.byte() * 2 ** 6 + this.byte() * 2 ** 14 + this.byte() * 2 ** 22;
                    case 3:
                        return this.bigCompact(a >> 2);
                    default:
                        throw new Error("Reached unreachable statement");
                }
            }
            bigCompact(a) {
                let c = this.u32();
                switch(a){
                    case 0:
                        return c;
                    case 1:
                        return c + this.byte() * 2 ** 32;
                    case 2:
                        return c + this.byte() * 2 ** 32 + this.byte() * 2 ** 40;
                }
                let l = BigInt(c), u = 32n;
                for(; a--;)l += BigInt(this.byte()) << u, u += 8n;
                return l;
            }
            compactLength() {
                let a = this.compact();
                return (0, n.default)(typeof a == "number"), a;
            }
            str() {
                let a = this.compactLength(), c = this.bytes(a);
                return r.UTF8_DECODER.decode(c);
            }
            bytes(a) {
                let c = this.idx, l = this.idx += a;
                if (this.buf.length < l) throw i();
                return this.buf.subarray(c, l);
            }
            skip(a) {
                this.idx += a;
            }
            bool() {
                return !!this.byte();
            }
            hasBytes() {
                return this.buf.length > this.idx;
            }
            assertEOF() {
                if (this.hasBytes()) throw new Error("Unprocessed data left");
            }
        }
        pf.Src = s;
        function i() {
            return new Error("Unexpected EOF");
        }
        return pf;
    }
    var Ca = {}, BL;
    function MQ() {
        if (BL) return Ca;
        BL = 1;
        var t = Ca && Ca.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(Ca, "__esModule", {
            value: !0
        }), Ca.ByteSink = Ca.HexSink = Ca.Sink = void 0;
        const e = t(du()), n = $1();
        class r {
            uncheckedU16(a) {
                this.write(a & 255), this.write(a >>> 8);
            }
            uncheckedU32(a) {
                this.write(a & 255), this.write(a >>> 8 & 255), this.write(a >>> 16 & 255), this.write(a >>> 24);
            }
            uncheckedU64(a) {
                this.uncheckedU32(Number(a & 0xffffffffn)), this.uncheckedU32(Number(a >> 32n));
            }
            uncheckedU128(a) {
                this.uncheckedU64(a & 0xffffffffffffffffn), this.uncheckedU64(a >> 64n);
            }
            uncheckedU256(a) {
                this.uncheckedU128(a & 2n ** 128n - 1n), this.uncheckedU128(a >> 128n);
            }
            u8(a) {
                (0, n.checkUnsignedInt)(a, 8), this.write(a);
            }
            u16(a) {
                (0, n.checkUnsignedInt)(a, 16), this.uncheckedU16(a);
            }
            u32(a) {
                (0, n.checkUnsignedInt)(a, 32), this.uncheckedU32(a);
            }
            u64(a) {
                (0, n.checkUnsignedBigInt)(a, 64), this.uncheckedU64(a);
            }
            u128(a) {
                (0, n.checkUnsignedBigInt)(a, 128), this.uncheckedU128(a);
            }
            u256(a) {
                (0, n.checkUnsignedBigInt)(a, 256), this.uncheckedU256(a);
            }
            i8(a) {
                (0, n.checkSignedInt)(a, 8), this.write((a + 256) % 256);
            }
            i16(a) {
                (0, n.checkSignedInt)(a, 16);
                let c = 2 ** 16;
                a = (a + c) % c, this.uncheckedU16(a);
            }
            i32(a) {
                (0, n.checkSignedInt)(a, 32);
                let c = 2 ** 32;
                a = (a + c) % c, this.uncheckedU32(a);
            }
            i64(a) {
                (0, n.checkSignedBigInt)(a, 64);
                let c = 2n ** 64n;
                a = (a + c) % c, this.uncheckedU64(a);
            }
            i128(a) {
                (0, n.checkSignedBigInt)(a, 128);
                let c = 2n ** 128n;
                a = (a + c) % c, this.uncheckedU128(a);
            }
            i256(a) {
                (0, n.checkSignedBigInt)(a, 256);
                let c = 2n ** 256n;
                a = (a + c) % c, this.uncheckedU256(a);
            }
            str(a) {
                (0, e.default)(typeof a == "string");
                let c = n.UTF8_ENCODER.encode(a);
                this.compact(c.length), this.bytes(c);
            }
            bool(a) {
                (0, e.default)(typeof a == "boolean"), this.write(Number(a));
            }
            compact(a) {
                if ((0, e.default)((typeof a == "number" || typeof a == "bigint") && a >= 0, "invalid compact"), a < 64) this.write(Number(a) * 4);
                else if (a < 2 ** 14) a = Number(a), this.write((a & 63) * 4 + 1), this.write(a >>> 6);
                else if (a < 2 ** 30) a = Number(a), this.write((a & 63) * 4 + 2), this.write(a >>> 6 & 255), this.uncheckedU16(a >>> 14);
                else if (a < 2n ** 536n) for(a = BigInt(a), this.write((0, n.unsignedIntByteLength)(a) * 4 - 13); a > 0;)this.write(Number(a & 0xffn)), a = a >> 8n;
                else throw new Error(`${a.toString(16)} is too large for a compact`);
            }
        }
        Ca.Sink = r;
        class s extends r {
            constructor(){
                super(...arguments), this.out = "0x";
            }
            write(a) {
                this.out += (a >>> 4).toString(16), this.out += (a & 15).toString(16);
            }
            bytes(a) {
                Buffer.isBuffer(a) ? this.out += a.toString("hex") : this.out += Buffer.from(a.buffer, a.byteOffset, a.byteLength).toString("hex");
            }
            toHex() {
                return this.out;
            }
        }
        Ca.HexSink = s;
        class i extends r {
            constructor(){
                super(...arguments), this.buf = Buffer.allocUnsafe(128), this.pos = 0;
            }
            alloc(a) {
                if (this.buf.length - this.pos < a) {
                    let c = Buffer.allocUnsafe(Math.max(a, this.buf.length) * 2);
                    c.set(this.buf), this.buf = c;
                }
            }
            write(a) {
                this.alloc(1), this.buf[this.pos] = a, this.pos += 1;
            }
            bytes(a) {
                this.alloc(a.length), this.buf.set(a, this.pos), this.pos += a.length;
            }
            toBytes() {
                return this.buf.subarray(0, this.pos);
            }
        }
        return Ca.ByteSink = i, Ca;
    }
    var hf = {}, hl = {}, FL;
    function RQ() {
        if (FL) return hl;
        FL = 1;
        var t = hl && hl.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(hl, "__esModule", {
            value: !0
        }), hl.toCodecTypes = hl.getCodecType = void 0;
        const e = t(du()), n = f9(), r = $1();
        function s(o, a) {
            let c = o[a];
            switch(c.kind){
                case n.TypeKind.Compact:
                    {
                        let l = o[c.type];
                        return (0, e.default)(l.kind == n.TypeKind.Primitive), (0, e.default)(l.primitive[0] == "U"), {
                            kind: n.TypeKind.Compact,
                            integer: l.primitive
                        };
                    }
                case n.TypeKind.Composite:
                    return c.fields.length == 0 || c.fields[0].name == null ? {
                        kind: n.TypeKind.Tuple,
                        tuple: c.fields.map((l)=>((0, e.default)(l.name == null), l.type))
                    } : {
                        kind: n.TypeKind.Struct,
                        fields: c.fields.map((l)=>({
                                name: (0, r.assertNotNull)(l.name),
                                type: l.type
                            }))
                    };
                case n.TypeKind.Variant:
                    {
                        let l = c.variants.filter((h)=>h != null), u = {};
                        if (new Set(l.map((h)=>h.index)).size != l.length) throw new Error(`Variant type ${a} has duplicate case indexes`);
                        let f = l.reduce((h, m)=>Math.max(h, m.index), 0) + 1, p = new Array(f);
                        return l.forEach((h)=>{
                            let m;
                            if (h.fields[0]?.name == null) switch(h.fields.length){
                                case 0:
                                    m = {
                                        kind: "empty",
                                        name: h.name,
                                        index: h.index
                                    };
                                    break;
                                case 1:
                                    m = {
                                        kind: "value",
                                        name: h.name,
                                        index: h.index,
                                        type: h.fields[0].type
                                    };
                                    break;
                                default:
                                    m = {
                                        kind: "tuple",
                                        name: h.name,
                                        index: h.index,
                                        def: {
                                            kind: n.TypeKind.Tuple,
                                            tuple: h.fields.map((w)=>((0, e.default)(w.name == null), w.type))
                                        }
                                    };
                            }
                            else m = {
                                kind: "struct",
                                name: h.name,
                                index: h.index,
                                def: {
                                    kind: n.TypeKind.Struct,
                                    fields: h.fields.map((w)=>({
                                            name: (0, r.assertNotNull)(w.name),
                                            type: w.type
                                        }))
                                }
                            };
                            p[h.index] = m, u[m.name] = m;
                        }), {
                            kind: n.TypeKind.Variant,
                            variants: p,
                            variantsByName: u
                        };
                    }
                default:
                    return c;
            }
        }
        hl.getCodecType = s;
        function i(o) {
            let a = new Array(o.length);
            for(let c = 0; c < o.length; c++)a[c] = s(o, c);
            return a;
        }
        return hl.toCodecTypes = i, hl;
    }
    var LL;
    function gst() {
        if (LL) return hf;
        LL = 1;
        var t = hf && hf.__importDefault || function(_) {
            return _ && _.__esModule ? _ : {
                default: _
            };
        };
        Object.defineProperty(hf, "__esModule", {
            value: !0
        }), hf.Codec = void 0;
        const e = m9(), n = t(du()), r = MQ(), s = OQ(), i = f9(), o = RQ(), a = $1();
        class c {
            constructor(A){
                this.types = (0, o.toCodecTypes)(A);
            }
            decodeBinary(A, P) {
                let U = new s.Src(P), K = this.decode(A, U);
                return U.assertEOF(), K;
            }
            encodeToHex(A, P) {
                let U = new r.HexSink;
                return this.encode(A, P, U), U.toHex();
            }
            encodeToBinary(A, P) {
                let U = new r.ByteSink;
                return this.encode(A, P, U), U.toBytes();
            }
            decode(A, P) {
                let U = this.types[A];
                switch(U.kind){
                    case i.TypeKind.Primitive:
                        return v(U.primitive, P);
                    case i.TypeKind.Compact:
                        return w(U, P);
                    case i.TypeKind.BitSequence:
                        return f(P);
                    case i.TypeKind.Array:
                        return this.decodeArray(U, P);
                    case i.TypeKind.Sequence:
                        return this.decodeSequence(U, P);
                    case i.TypeKind.Tuple:
                        return this.decodeTuple(U, P);
                    case i.TypeKind.Struct:
                        return this.decodeStruct(U, P);
                    case i.TypeKind.Variant:
                        return this.decodeVariant(U, P);
                    case i.TypeKind.Option:
                        return this.decodeOption(U, P);
                    case i.TypeKind.BooleanOption:
                        return h(P);
                    case i.TypeKind.Bytes:
                        return l(P);
                    case i.TypeKind.BytesArray:
                        return P.bytes(U.len);
                    case i.TypeKind.HexBytes:
                        return (0, e.toHex)(l(P));
                    case i.TypeKind.HexBytesArray:
                        return (0, e.toHex)(P.bytes(U.len));
                    case i.TypeKind.DoNotConstruct:
                        (0, a.throwUnexpectedCase)("DoNotConstruct type reached");
                    default:
                        (0, a.throwUnexpectedCase)(U.kind);
                }
            }
            decodeArray(A, P) {
                let { len: U, type: K } = A, X = new Array(U);
                for(let G = 0; G < U; G++)X[G] = this.decode(K, P);
                return X;
            }
            decodeSequence(A, P) {
                let U = P.compactLength(), K = new Array(U);
                for(let X = 0; X < U; X++)K[X] = this.decode(A.type, P);
                return K;
            }
            decodeTuple(A, P) {
                if (A.tuple.length == 0) return null;
                let U = new Array(A.tuple.length);
                for(let K = 0; K < A.tuple.length; K++)U[K] = this.decode(A.tuple[K], P);
                return U;
            }
            decodeStruct(A, P) {
                let U = {};
                for(let K = 0; K < A.fields.length; K++){
                    let X = A.fields[K];
                    U[X.name] = this.decode(X.type, P);
                }
                return U;
            }
            decodeVariant(A, P) {
                let U = P.u8(), K = A.variants[U];
                switch(K == null && (0, a.throwUnexpectedCase)(`unknown variant index: ${U}`), K.kind){
                    case "empty":
                        return {
                            __kind: K.name
                        };
                    case "tuple":
                        return {
                            __kind: K.name,
                            value: this.decodeTuple(K.def, P)
                        };
                    case "value":
                        return {
                            __kind: K.name,
                            value: this.decode(K.type, P)
                        };
                    case "struct":
                        {
                            let X = this.decodeStruct(K.def, P);
                            return X.__kind = K.name, X;
                        }
                    default:
                        (0, a.throwUnexpectedCase)();
                }
            }
            decodeOption(A, P) {
                let U = P.u8();
                switch(U){
                    case 0:
                        return;
                    case 1:
                        return this.decode(A.type, P);
                    default:
                        (0, a.throwUnexpectedCase)(U.toString());
                }
            }
            encode(A, P, U) {
                let K = this.types[A];
                switch(K.kind){
                    case i.TypeKind.Primitive:
                        k(K.primitive, P, U);
                        break;
                    case i.TypeKind.Compact:
                        U.compact(P);
                        break;
                    case i.TypeKind.BitSequence:
                        p(P, U);
                        break;
                    case i.TypeKind.Array:
                        this.encodeArray(K, P, U);
                        break;
                    case i.TypeKind.Sequence:
                        this.encodeSequence(K, P, U);
                        break;
                    case i.TypeKind.Tuple:
                        this.encodeTuple(K, P, U);
                        break;
                    case i.TypeKind.Struct:
                        this.encodeStruct(K, P, U);
                        break;
                    case i.TypeKind.Variant:
                        this.encodeVariant(K, P, U);
                        break;
                    case i.TypeKind.BytesArray:
                        d(K, P, U);
                        break;
                    case i.TypeKind.HexBytesArray:
                        d(K, (0, e.decodeHex)(P), U);
                        break;
                    case i.TypeKind.Bytes:
                        u(P, U);
                        break;
                    case i.TypeKind.HexBytes:
                        u((0, e.decodeHex)(P), U);
                        break;
                    case i.TypeKind.BooleanOption:
                        m(P, U);
                        break;
                    case i.TypeKind.Option:
                        this.encodeOption(K, P, U);
                        break;
                    default:
                        (0, a.throwUnexpectedCase)(K.kind);
                }
            }
            encodeArray(A, P, U) {
                (0, n.default)(Array.isArray(P) && P.length == A.len);
                for(let K = 0; K < P.length; K++)this.encode(A.type, P[K], U);
            }
            encodeSequence(A, P, U) {
                (0, n.default)(Array.isArray(P)), U.compact(P.length);
                for(let K = 0; K < P.length; K++)this.encode(A.type, P[K], U);
            }
            encodeTuple(A, P, U) {
                if (A.tuple.length == 0) {
                    (0, n.default)(P == null);
                    return;
                }
                (0, n.default)(Array.isArray(P) && A.tuple.length == P.length);
                for(let K = 0; K < P.length; K++)this.encode(A.tuple[K], P[K], U);
            }
            encodeStruct(A, P, U) {
                for(let K = 0; K < A.fields.length; K++){
                    let X = A.fields[K];
                    this.encode(X.type, P[X.name], U);
                }
            }
            encodeVariant(A, P, U) {
                (0, n.default)(typeof P?.__kind == "string", "not a variant type value");
                let K = A.variantsByName[P.__kind];
                if (K == null) throw new Error(`Unknown variant: ${P.__kind}`);
                switch(U.u8(K.index), K.kind){
                    case "empty":
                        break;
                    case "value":
                        this.encode(K.type, P.value, U);
                        break;
                    case "tuple":
                        this.encodeTuple(K.def, P.value, U);
                        break;
                    case "struct":
                        this.encodeStruct(K.def, P, U);
                        break;
                    default:
                        (0, a.throwUnexpectedCase)();
                }
            }
            encodeOption(A, P, U) {
                P === void 0 ? U.u8(0) : (U.u8(1), this.encode(A.type, P, U));
            }
        }
        hf.Codec = c;
        function l(_) {
            let A = _.compactLength();
            return _.bytes(A);
        }
        function u(_, A) {
            (0, n.default)(_ instanceof Uint8Array), A.compact(_.length), A.bytes(_);
        }
        function d(_, A, P) {
            (0, n.default)(A instanceof Uint8Array && A.length == _.len), P.bytes(A);
        }
        function f(_) {
            let A = _.compactLength(), P = Math.ceil(A / 8);
            return {
                bytes: _.bytes(P),
                bitLength: A
            };
        }
        function p(_, A) {
            (0, n.default)(_ && typeof _ == "object" && Number.isInteger(_.bitLength) && _.bytes instanceof Uint8Array);
            let P = _;
            (0, n.default)(Math.ceil(P.bitLength / 8) == P.bytes.length), A.compact(P.bitLength), A.bytes(P.bytes);
        }
        function h(_) {
            let A = _.u8();
            switch(A){
                case 0:
                    return null;
                case 1:
                    return !0;
                case 2:
                    return !1;
                default:
                    (0, a.throwUnexpectedCase)(A.toString());
            }
        }
        function m(_, A) {
            _ == null ? A.u8(0) : ((0, n.default)(typeof _ == "boolean"), A.u8(_ ? 1 : 2));
        }
        function w(_, A) {
            let P = A.compact();
            switch(_.integer){
                case "U8":
                case "U16":
                case "U32":
                    return P;
                default:
                    return BigInt(P);
            }
        }
        function v(_, A) {
            switch(_){
                case "I8":
                    return A.i8();
                case "U8":
                    return A.u8();
                case "I16":
                    return A.i16();
                case "U16":
                    return A.u16();
                case "I32":
                    return A.i32();
                case "U32":
                    return A.u32();
                case "I64":
                    return A.i64();
                case "U64":
                    return A.u64();
                case "I128":
                    return A.i128();
                case "U128":
                    return A.u128();
                case "I256":
                    return A.i256();
                case "U256":
                    return A.u256();
                case "Bool":
                    return A.bool();
                case "Str":
                    return A.str();
                default:
                    (0, a.throwUnexpectedCase)(_);
            }
        }
        function k(_, A, P) {
            switch(_){
                case "I8":
                    P.i8(A);
                    break;
                case "U8":
                    P.u8(A);
                    break;
                case "I16":
                    P.i16(A);
                    break;
                case "U16":
                    P.u16(A);
                    break;
                case "I32":
                    P.i32(A);
                    break;
                case "U32":
                    P.u32(A);
                    break;
                case "I64":
                    P.i64(A);
                    break;
                case "U64":
                    P.u64(A);
                    break;
                case "I128":
                    P.i128(A);
                    break;
                case "U128":
                    P.u128(A);
                    break;
                case "I256":
                    P.i256(A);
                    break;
                case "U256":
                    P.u256(A);
                    break;
                case "Bool":
                    P.bool(A);
                    break;
                case "Str":
                    P.str(A);
                    break;
                default:
                    (0, a.throwUnexpectedCase)(_);
            }
        }
        return hf;
    }
    var gl = {}, Hb = {}, zL;
    function bst() {
        if (zL) return Hb;
        zL = 1, Object.defineProperty(Hb, "__esModule", {
            value: !0
        }), Hb.toJSON = void 0;
        const t = m9();
        function e(s) {
            let i;
            switch(typeof s){
                case "bigint":
                    return s.toString();
                case "object":
                    if (s == null) return null;
                    if (s instanceof Uint8Array) return (0, t.toHex)(s);
                    if (s instanceof Date) return s.toISOString();
                    if (typeof s.toJSON == "function" && (i = s.toJSON()) !== s) return e(i);
                    if (s instanceof Error) return i = {}, s.stack ? i.stack = s.stack : i.stack = s.toString(), i = r(s, i), i;
                    if (s instanceof Map) {
                        let o = [];
                        for (let [a, c] of s.entries())o.push({
                            k: a,
                            v: c
                        });
                        return e({
                            map: o
                        });
                    } else return s instanceof Set ? e({
                        set: [
                            ...s
                        ]
                    }) : Array.isArray(s) ? n(s) : r(s);
                default:
                    return s;
            }
        }
        Hb.toJSON = e;
        function n(s) {
            let i = new Array(s.length);
            for(let o = 0; o < s.length; o++)i[o] = e(s[o]);
            return i;
        }
        function r(s, i) {
            i = i || {};
            for(let o in s)i[o] = e(s[o]);
            return i;
        }
        return Hb;
    }
    var UL;
    function mst() {
        if (UL) return gl;
        UL = 1;
        var t = gl && gl.__importDefault || function(d) {
            return d && d.__esModule ? d : {
                default: d
            };
        };
        Object.defineProperty(gl, "__esModule", {
            value: !0
        }), gl.decodeBinaryArray = gl.JsonCodec = void 0;
        const e = m9(), n = bst(), r = t(du()), s = f9(), i = RQ(), o = $1();
        class a {
            static encode(f) {
                return (0, n.toJSON)(f);
            }
            constructor(f){
                this.types = (0, i.toCodecTypes)(f);
            }
            decode(f, p) {
                let h = this.types[f];
                switch(h.kind){
                    case s.TypeKind.Primitive:
                        return c(h.primitive, p);
                    case s.TypeKind.Compact:
                        return c(h.integer, p);
                    case s.TypeKind.BitSequence:
                        return (0, e.decodeHex)(p);
                    case s.TypeKind.Array:
                        return this.decodeArray(h, p);
                    case s.TypeKind.Sequence:
                        return this.decodeSequence(h, p);
                    case s.TypeKind.Tuple:
                        return this.decodeTuple(h, p);
                    case s.TypeKind.Struct:
                        return this.decodeStruct(h, p);
                    case s.TypeKind.Variant:
                        return this.decodeVariant(h, p);
                    case s.TypeKind.Option:
                        return this.decodeOption(h, p);
                    case s.TypeKind.BooleanOption:
                        return l(p);
                    case s.TypeKind.Bytes:
                        return (0, e.decodeHex)(p);
                    case s.TypeKind.BytesArray:
                        return u(h.len, p);
                    case s.TypeKind.HexBytes:
                    case s.TypeKind.HexBytesArray:
                        return (0, r.default)((0, e.isHex)(p)), p;
                    case s.TypeKind.DoNotConstruct:
                        (0, o.throwUnexpectedCase)("DoNotConstruct type reached");
                    default:
                        (0, o.throwUnexpectedCase)();
                }
            }
            decodeArray(f, p) {
                let { len: h, type: m } = f;
                (0, r.default)(Array.isArray(p)), (0, r.default)(p.length == h);
                let w = new Array(h);
                for(let v = 0; v < h; v++)w[v] = this.decode(m, p[v]);
                return w;
            }
            decodeSequence(f, p) {
                (0, r.default)(Array.isArray(p));
                let h = new Array(p.length);
                for(let m = 0; m < p.length; m++)h[m] = this.decode(f.type, p[m]);
                return h;
            }
            decodeTuple(f, p) {
                let h = f.tuple;
                if (h.length == 0) return (0, r.default)(p == null || Array.isArray(p) && p.length == 0), null;
                {
                    (0, r.default)(Array.isArray(p)), (0, r.default)(p.length == h.length);
                    let m = new Array(h.length);
                    for(let w = 0; w < h.length; w++)m[w] = this.decode(h[w], p[w]);
                    return m;
                }
            }
            decodeStruct(f, p) {
                (0, r.default)((0, o.isObject)(p));
                let h = {};
                for(let m = 0; m < f.fields.length; m++){
                    let w = f.fields[m];
                    h[w.name] = this.decode(w.type, p[w.name]);
                }
                return h;
            }
            decodeVariant(f, p) {
                (0, r.default)((0, o.isObject)(p)), (0, r.default)(typeof p.__kind == "string");
                let h = f.variantsByName[p.__kind];
                if (h == null) throw new Error(`Unknown variant ${p.__kind}`);
                switch(h.kind){
                    case "empty":
                        return {
                            __kind: p.__kind
                        };
                    case "value":
                        return {
                            __kind: p.__kind,
                            value: this.decode(h.type, p.value)
                        };
                    case "tuple":
                        return {
                            __kind: p.__kind,
                            value: this.decodeTuple(h.def, p.value)
                        };
                    case "struct":
                        {
                            let m = this.decodeStruct(h.def, p);
                            return m.__kind = p.__kind, m;
                        }
                    default:
                        (0, o.throwUnexpectedCase)(h.kind);
                }
            }
            decodeOption(f, p) {
                return p == null ? void 0 : this.decode(f.type, p);
            }
        }
        gl.JsonCodec = a;
        function c(d, f) {
            switch(d){
                case "I8":
                    return (0, o.checkSignedInt)(f, 8), f;
                case "I16":
                    return (0, o.checkSignedInt)(f, 16), f;
                case "I32":
                    return (0, o.checkSignedInt)(f, 32), f;
                case "I64":
                    return (0, o.toSignedBigInt)(f, 64);
                case "I128":
                    return (0, o.toSignedBigInt)(f, 128);
                case "I256":
                    return (0, o.toSignedBigInt)(f, 256);
                case "U8":
                    return (0, o.checkUnsignedInt)(f, 8), f;
                case "U16":
                    return (0, o.checkUnsignedInt)(f, 16), f;
                case "U32":
                    return (0, o.checkUnsignedInt)(f, 32), f;
                case "U64":
                    return (0, o.toUnsignedBigInt)(f, 64);
                case "U128":
                    return (0, o.toUnsignedBigInt)(f, 128);
                case "U256":
                    return (0, o.toUnsignedBigInt)(f, 256);
                case "Bool":
                    return (0, r.default)(typeof f == "boolean"), f;
                case "Str":
                    return (0, r.default)(typeof f == "string"), f;
                default:
                    (0, o.throwUnexpectedCase)(d);
            }
        }
        function l(d) {
            if (d != null) return (0, r.default)(typeof d == "boolean"), d;
        }
        function u(d, f) {
            let p = (0, e.decodeHex)(f);
            return (0, r.default)(p.length == d), p;
        }
        return gl.decodeBinaryArray = u, gl;
    }
    var HL;
    function yst() {
        return HL || (HL = 1, (function(t) {
            var e = ff && ff.__createBinding || (Object.create ? (function(r, s, i, o) {
                o === void 0 && (o = i);
                var a = Object.getOwnPropertyDescriptor(s, i);
                (!a || ("get" in a ? !s.__esModule : a.writable || a.configurable)) && (a = {
                    enumerable: !0,
                    get: function() {
                        return s[i];
                    }
                }), Object.defineProperty(r, o, a);
            }) : (function(r, s, i, o) {
                o === void 0 && (o = i), r[o] = s[i];
            })), n = ff && ff.__exportStar || function(r, s) {
                for(var i in r)i !== "default" && !Object.prototype.hasOwnProperty.call(s, i) && e(s, r, i);
            };
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), n(f9(), t), n(OQ(), t), n(MQ(), t), n(gst(), t), n(mst(), t);
        })(ff)), ff;
    }
    var jL = yst();
    const Uh = Symbol("Mainnet"), qL = {
        toString: (t)=>t === Uh ? "mainnet" : t
    }, wst = {
        modulus: BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001")
    }, WL = {
        encode: (t)=>{
            const e = new jL.ByteSink;
            return e.compact(t), Buffer.from(e.toBytes());
        },
        decode: (t)=>{
            const e = new jL.Src(t), n = e.compact();
            return e.assertEOF(), BigInt(n);
        }
    }, Bd = Symbol("MidnightBech32m");
    class Jr {
        static prefix = "mn";
        static encode(e, n) {
            return n[Bd].encode(e, n);
        }
        static validateSegment(e, n) {
            if (!/^[A-Za-z1-9-]+$/.test(n)) throw new Error(`Segment ${e}: ${n} contains disallowed characters. Allowed characters are only numbers, latin letters and a hyphen`);
        }
        static parse(e) {
            const n = Pa.decodeToBytes(e), [r, s, i = Uh] = n.prefix.split("_");
            if (r != Jr.prefix) throw new Error(`Expected prefix ${Jr.prefix}`);
            return Jr.validateSegment("type", s), i != Uh && Jr.validateSegment("network", i), new Jr(s, i, Buffer.from(n.bytes));
        }
        type;
        network;
        data;
        constructor(e, n, r){
            this.data = r, this.network = n, this.type = e, Jr.validateSegment("type", e), n != Uh && Jr.validateSegment("network", n);
        }
        decode(e, n) {
            return e[Bd].decode(n, this);
        }
        asString() {
            const e = this.network == Uh ? "" : `_${this.network}`;
            return Pa.encode(`${Jr.prefix}_${this.type}${e}`, Pa.toWords(this.data), !1);
        }
        toString() {
            return this.asString();
        }
    }
    class Fd {
        type;
        dataToBytes;
        dataFromBytes;
        constructor(e, n, r){
            this.dataFromBytes = r, this.dataToBytes = n, this.type = e;
        }
        encode(e, n) {
            const r = Fd.createContext(e);
            return new Jr(this.type, r.networkId, this.dataToBytes(n));
        }
        decode(e, n) {
            const r = Fd.createContext(e);
            if (n.type != this.type) throw new Error(`Expected type ${this.type}, got ${n.type}`);
            if (r.networkId != n.network) throw new Error(`Expected ${qL.toString(r.networkId)} address, got ${qL.toString(n.network)} one`);
            return this.dataFromBytes(n.data);
        }
        static createContext(e) {
            return e === "mainnet" ? {
                networkId: Uh
            } : {
                networkId: e
            };
        }
    }
    class Zl {
        static codec = new Fd("shield-addr", (e)=>Buffer.concat([
                e.coinPublicKey.data,
                e.encryptionPublicKey.data
            ]), (e)=>{
            const n = new ia(e.subarray(0, ia.keyLength)), r = new Jl(e.subarray(ia.keyLength));
            return new Zl(n, r);
        });
        static [Bd] = Zl.codec;
        [Bd] = Zl.codec;
        coinPublicKey;
        encryptionPublicKey;
        constructor(e, n){
            this.encryptionPublicKey = n, this.coinPublicKey = e;
        }
        coinPublicKeyString() {
            return this.coinPublicKey.data.toString("hex");
        }
        encryptionPublicKeyString() {
            return this.encryptionPublicKey.data.toString("hex");
        }
        equals(e) {
            return this.coinPublicKey.equals(e.coinPublicKey) && this.encryptionPublicKey.equals(e.encryptionPublicKey);
        }
    }
    class ia {
        static keyLength = 32;
        static codec = new Fd("shield-cpk", (e)=>e.data, (e)=>new ia(e));
        static fromHexString(e) {
            return new ia(Buffer.from(e, "hex"));
        }
        data;
        constructor(e){
            if (this.data = e, e.length != ia.keyLength) throw new Error("Coin public key needs to be 32 bytes long");
        }
        toHexString() {
            return this.data.toString("hex");
        }
        equals(e) {
            return (typeof e == "string" ? ia.fromHexString(e) : e).data.equals(this.data);
        }
    }
    class Jl {
        static keyLength = 32;
        static codec = new Fd("shield-epk", (e)=>e.data, (e)=>new Jl(e));
        static fromHexString(e) {
            return new Jl(Buffer.from(e, "hex"));
        }
        data;
        constructor(e){
            this.data = e;
        }
        toHexString() {
            return this.data.toString("hex");
        }
        equals(e) {
            return (typeof e == "string" ? Jl.fromHexString(e) : e).data.equals(this.data);
        }
    }
    class Wi {
        data;
        static keyLength = 32;
        static codec = new Fd("addr", (e)=>e.data, (e)=>new Wi(e));
        static [Bd] = Wi.codec;
        [Bd] = Wi.codec;
        constructor(e){
            if (e.length != Wi.keyLength) throw new Error("Unshielded address needs to be 32 bytes long");
            this.data = e;
        }
        get hexString() {
            return this.data.toString("hex");
        }
        equals(e) {
            return (typeof e == "string" ? new Wi(Buffer.from(e, "hex")) : e).data.equals(this.data);
        }
    }
    class Yu {
        data;
        static codec = new Fd("dust", (e)=>e.serialize(), (e)=>new Yu(WL.decode(e)));
        static [Bd] = Yu.codec;
        [Bd] = Yu.codec;
        static encodePublicKey = (e, n)=>Yu.codec.encode(e, new Yu(n)).asString();
        constructor(e){
            if (e >= wst.modulus) throw new Error("Dust address is too large");
            this.data = e;
        }
        serialize() {
            return WL.encode(this.data);
        }
        equals(e) {
            return (typeof e == "bigint" ? e : e.data) === this.data;
        }
    }
    const _st = ()=>({
            getPublicKey: (t)=>t.publicKey.publicKey,
            getAddress: (t)=>new Wi(Buffer.from(t.publicKey.addressHex, "hex"))
        }), xst = ({ transaction: t, createdUtxos: e, spentUtxos: n, status: r })=>({
            id: t.id,
            hash: t.hash,
            protocolVersion: t.protocolVersion,
            identifiers: t.identifiers ? t.identifiers : [],
            status: r,
            timestamp: t.block?.timestamp ?? null,
            fees: t.fees?.paidFees ?? null,
            createdUtxos: e.map(({ utxo: s })=>({
                    value: s.value,
                    owner: s.owner,
                    tokenType: s.type,
                    intentHash: s.intentHash,
                    outputIndex: s.outputNo
                })),
            spentUtxos: n.map(({ utxo: s })=>({
                    value: s.value,
                    owner: s.owner,
                    tokenType: s.type,
                    intentHash: s.intentHash,
                    outputIndex: s.outputNo
                }))
        }), vst = (t, e)=>{
        const { txHistoryStorage: n } = t;
        return {
            create: async (r)=>{
                const s = xst(r);
                await n.create(s);
            },
            get: async (r)=>await n.get(r),
            getAll: ()=>n.getAll(),
            delete: async (r)=>n.delete(r)
        };
    }, kP = {
        fromKeyStore: (t)=>({
                publicKey: t.getPublicKey(),
                addressHex: t.getAddress(),
                address: t.getBech32Address().asString()
            })
    }, Yl = (t, e)=>{
        const n = {
            getSecretKey: ()=>Buffer.from(t),
            getBech32Address: ()=>{
                const r = n.getAddress(), s = Buffer.from(r, "hex");
                return Wi.codec.encode(e, new Wi(s));
            },
            getPublicKey: ()=>xH(n.getSecretKey().toString("hex")),
            getAddress: ()=>_H(n.getPublicKey()),
            signData: (r)=>vH(n.getSecretKey().toString("hex"), r)
        };
        return n;
    };
    let Sst = class $u {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withTransactionHistoryDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withSyncDefaults() {
            return this.withSync(xrt, vrt);
        }
        withSync(e, n) {
            return new $u({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(hrt);
        }
        withSerialization(e) {
            return new $u({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(Srt);
        }
        withTransacting(e) {
            return new $u({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new $u({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>GT);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(Trt);
        }
        withCoinsAndBalances(e) {
            return new $u({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withTransactionHistoryDefaults() {
            return this.withTransactionHistory(vst);
        }
        withTransactionHistory(e) {
            return new $u({
                ...this.#e,
                transactionHistoryService: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(_st);
        }
        withKeys(e) {
            return new $u({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e), { networkId: r } = e;
            return {
                __polyTag__: co,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                transactionHistory: n.transactionHistoryService,
                start (s) {
                    return or(function*() {
                        const i = yield* Ha;
                        return new urt(i, s, n);
                    });
                },
                migrateState (s) {
                    const i = pQ("0000000000000000000000000000000000000000000000000000000000000001");
                    return Zt(Fl.init(kP.fromKeyStore(Yl(i, r)), r));
                },
                deserializeState: (s)=>n.serializationCapability.deserialize(s)
            };
        }
        #t(e) {
            if (!kst(this.#e)) throw new Error("Not all components are configured in V1 Builder");
            const { syncCapability: n, syncService: r, transactingCapability: s, serializationCapability: i, coinSelection: o, coinsAndBalancesCapability: a, keysCapability: c, transactionHistoryService: l } = this.#e, u = ()=>d, d = {
                serializationCapability: i(e, u),
                syncCapability: n(e, u),
                syncService: r(e, u),
                transactingCapability: s(e, u),
                coinsAndBalancesCapability: a(e, u),
                keysCapability: c(e, u),
                coinSelection: o(e, u),
                transactionHistoryService: l(e, u)
            };
            return d;
        }
    };
    const kst = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability",
            "transactionHistoryService"
        ].every((n)=>typeof t[n] == "function"), Tst = en, KL = tn({
        value: ky,
        owner: en,
        tokenType: en,
        intentHash: en,
        outputIndex: Or
    }), Cst = tn({
        id: Or,
        hash: Tst,
        protocolVersion: Or,
        identifiers: Os(en),
        timestamp: jG,
        fees: OG(ky),
        status: ri("SUCCESS", "FAILURE", "PARTIAL_SUCCESS"),
        createdUtxos: Os(KL),
        spentUtxos: Os(KL)
    }), NQ = JRe({
        key: en,
        value: Cst
    }), Est = sd(NQ), Ist = Xc(NQ);
    class id {
        entries;
        constructor(e){
            this.entries = e || new Map;
        }
        create(e) {
            return this.entries.set(e.hash, e), Promise.resolve();
        }
        delete(e) {
            const n = this.entries.get(e);
            return n ? (this.entries.delete(e), Promise.resolve(n)) : Promise.resolve(void 0);
        }
        async *getAll() {
            for (const e of this.entries.values())yield await Promise.resolve(e);
        }
        get(e) {
            return Promise.resolve(this.entries.get(e));
        }
        serialize() {
            const e = Est(this.entries);
            return JSON.stringify(e);
        }
        reset() {
            this.entries.clear();
        }
        static fromSerialized(e) {
            const n = JSON.parse(e), r = l_e(Ist(n), (s)=>{
                throw new Error(`Failed to decode transaction history: ${s.message}`);
            });
            return new id(r);
        }
    }
    const Ast = (t)=>{
        const e = lZ(t.variants);
        return VQ({
            variants: t.variants,
            tag: rA(e.variant),
            state: t.state
        });
    }, VQ = (t)=>R$.pipe(Cf("initiatedFirstVariant", ()=>Mst(t)), Cf("currentStateRef", ({ initiatedFirstVariant: e })=>e.currentStateRef.get.pipe(nt((n)=>QI(mt({
                    version: e.initProtocolVersion,
                    state: n
                }))))), Cf("progressRef", ()=>fV({
                applyGap: 0n,
                sourceGap: 0n
            })), Cf("currentVariantRef", ({ initiatedFirstVariant: e })=>jp(fV(e), (n, r)=>or(function*() {
                    const s = yield* wNe(n);
                    yield* Id(s.variantScope, r);
                }))), Cf("runningStream", ({ initiatedFirstVariant: e, currentStateRef: n, progressRef: r, currentVariantRef: s })=>BQ(e, n, r, s).pipe(Gg((i)=>ZG(n, st(i))), x1)), nt(({ currentStateRef: e, progressRef: n, currentVariantRef: r })=>or(function*() {
                const i = {
                    stateChanges: yield* e.changes.pipe($d((o)=>Br(o)), nNe({
                        capacity: "unbounded",
                        replay: 1
                    })),
                    progress: n.get,
                    currentVariant: r.get,
                    dispatch: (o)=>Pst(i, o)
                };
                return i;
            }))), Pst = (t, e)=>t.currentVariant.pipe(nt((n)=>LVe(n.runningVariant, e))), Ost = (t)=>or(function*() {
            const [e] = t.variants;
            e || (yield* Ns(new uP({
                message: "No variant to init"
            })));
            const n = yield* e.variant.migrateState(t.state);
            return yield* DQ({
                variants: t.variants,
                state: n,
                initProtocolVersion: t.initProtocolVersion
            });
        }), Mst = (t)=>or(function*() {
            const e = t.variants.findIndex((r)=>rA(r.variant) === t.tag), n = t.variants.toSpliced(0, e);
            return yield* DQ({
                variants: n,
                state: t.state,
                initProtocolVersion: void 0
            });
        }), DQ = (t)=>or(function*() {
            const [e, n] = t.variants;
            e || (yield* Ns(new uP({
                message: "No variant to init"
            })));
            const r = e, s = t.initProtocolVersion ?? r.sinceVersion, i = n ? n.sinceVersion : Znt, o = $nt(r.sinceVersion, i), a = yield* QI(t.state), c = yield* Y0(), l = yield* r.variant.start({
                stateRef: a
            }).pipe(Od(Ha, c));
            return {
                __polyTag__: r.variant.__polyTag__,
                variant: r,
                initialState: t.state,
                runningVariant: l,
                currentStateRef: a,
                restVariants: HVe(t.variants),
                initProtocolVersion: s,
                validVersionRange: o,
                nextProtocolVersion: n ? n.sinceVersion : null,
                variantScope: c
            };
        }), BQ = (t, e, n, r)=>{
        const s = {
            protocolVersion: t.initProtocolVersion,
            shouldInitChange: !1,
            followEffect: ln,
            lastState: t.initialState
        };
        return t.runningVariant.state.pipe(pNe(s, (i, o)=>ort(o, {
                State: ({ state: a })=>ZG(e, mt({
                        version: i.protocolVersion,
                        state: a
                    })).pipe(La({
                        ...i,
                        lastState: a
                    })),
                ProgressUpdate: (a)=>pV(n, a).pipe(La(i)),
                VersionChange: ({ change: a })=>{
                    const c = art(a, {
                        Version: ({ version: l })=>l,
                        Next: ()=>t.nextProtocolVersion
                    });
                    return c != null && !Xnt(c, t.validVersionRange) ? Zt({
                        ...i,
                        protocolVersion: c,
                        shouldInitChange: !0,
                        followEffect: or(function*() {
                            yield* Id(t.variantScope, Xv);
                            const l = yield* Ost({
                                variants: t.restVariants,
                                state: i.lastState,
                                initProtocolVersion: c
                            });
                            return yield* pV(r, l), yield* BQ(l, e, n, r);
                        })
                    }) : Zt({
                        ...i,
                        protocolVersion: c ?? i.protocolVersion
                    });
                }
            })), oNe((i)=>i.shouldInitChange), XG, nt((i)=>dn(i, {
                onSome: (o)=>o.followEffect,
                onNone: ()=>ln
            })));
    };
    class ig {
        constructor(e){
            this.#e = e;
        }
        static init() {
            return new ig({
                variants: []
            });
        }
        #e;
        withVariant(e, n) {
            const { sinceVersion: r } = this.#e.variants.at(-1) ?? {
                sinceVersion: Wa(-1n)
            };
            if (e <= r) throw new Error("ProtocolMismatch: sinceVersion is prior to previously registered version");
            const s = {
                sinceVersion: e,
                variantBuilder: n
            };
            return new ig({
                variants: zVe(this.#e.variants, s)
            });
        }
        build(...[e]) {
            if (this.#e.variants.length == 0) throw new uP({
                message: "Empty variants list"
            });
            const n = this.#e.variants.map(({ sinceVersion: r, variantBuilder: s })=>({
                    sinceVersion: r,
                    variant: s.build(e ?? {})
                }));
            return class X_ {
                static configuration = e ?? {};
                static allVariants() {
                    return n;
                }
                static allVariantsRecord() {
                    return irt(X_.allVariants());
                }
                static startEmpty(s) {
                    return or(this, function*() {
                        const i = yield* lZ(X_.allVariants()).variant.migrateState(null);
                        return X_.startFirst(s, i);
                    }).pipe(Xi);
                }
                static startFirst(s, i) {
                    return or(this, function*() {
                        const o = yield* Y0(), a = yield* Ast({
                            variants: n,
                            state: i
                        }).pipe(Od(Ha, o));
                        return new s(a, o);
                    }).pipe(Xi);
                }
                static start(s, i, o) {
                    return or(this, function*() {
                        const a = yield* Y0(), c = yield* VQ({
                            variants: n,
                            tag: i,
                            state: o
                        }).pipe(Od(Ha, a));
                        return new s(c, a);
                    }).pipe(Xi);
                }
                runtime;
                runtimeScope;
                rawState;
                get syncComplete() {
                    const { sourceGap: s, applyGap: i } = Xi(this.runtime.progress);
                    return s === 0n && i === 0n;
                }
                constructor(s, i){
                    this.runtime = s, this.runtimeScope = i, this.rawState = MZ(s.stateChanges).pipe(U3({
                        refCount: !0,
                        bufferSize: 1
                    }));
                }
                stop() {
                    return Id(this.runtimeScope, Xv).pipe(Cn);
                }
            };
        }
    }
    class TP {
        static mapState = (e)=>(n)=>new TP(n, e);
        protocolVersion;
        state;
        capabilities;
        get balances() {
            return this.capabilities.coinsAndBalances.getAvailableBalances(this.state);
        }
        get totalCoins() {
            return this.capabilities.coinsAndBalances.getTotalCoins(this.state);
        }
        get availableCoins() {
            return this.capabilities.coinsAndBalances.getAvailableCoins(this.state);
        }
        get pendingCoins() {
            return this.capabilities.coinsAndBalances.getPendingCoins(this.state);
        }
        get address() {
            return this.capabilities.keys.getAddress(this.state);
        }
        get progress() {
            return this.state.progress;
        }
        get transactionHistory() {
            return this.capabilities.transactionHistory;
        }
        constructor(e, n){
            this.protocolVersion = e.version, this.state = e.state, this.capabilities = n;
        }
        serialize() {
            return this.capabilities.serialization.serialize(this.state);
        }
    }
    function Bx(t) {
        return Rst(t, new Sst().withDefaults());
    }
    function Rst(t, e) {
        const n = [
            t
        ], r = ig.init().withVariant(Tp, e).build(...n);
        return class xf extends r {
            static startWithPublicKey(i) {
                return xf.startFirst(xf, Fl.init(i, t.networkId));
            }
            static restore(i) {
                const o = xf.allVariantsRecord()[co].variant.deserializeState(i).pipe(ov);
                return xf.startFirst(xf, o);
            }
            state;
            constructor(i, o){
                super(i, o), this.state = this.rawState.pipe(ve(TP.mapState(xf.allVariantsRecord()[co].variant)), U3({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start() {
                return this.runtime.dispatch({
                    [co]: (i)=>i.startSyncInBackground()
                }).pipe(Cn);
            }
            balanceFinalizedTransaction(i) {
                return this.runtime.dispatch({
                    [co]: (o)=>o.balanceFinalizedTransaction(i)
                }).pipe(Cn);
            }
            balanceUnboundTransaction(i) {
                return this.runtime.dispatch({
                    [co]: (o)=>o.balanceUnboundTransaction(i)
                }).pipe(Cn);
            }
            balanceUnprovenTransaction(i) {
                return this.runtime.dispatch({
                    [co]: (o)=>o.balanceUnprovenTransaction(i)
                }).pipe(Cn);
            }
            transferTransaction(i, o) {
                return this.runtime.dispatch({
                    [co]: (a)=>a.transferTransaction(i, o)
                }).pipe(Cn);
            }
            initSwap(i, o, a) {
                return this.runtime.dispatch({
                    [co]: (c)=>c.initSwap(i, o, a)
                }).pipe(Cn);
            }
            signUnprovenTransaction(i, o) {
                return this.runtime.dispatch({
                    [co]: (a)=>a.signUnprovenTransaction(i, o)
                }).pipe(Cn);
            }
            signUnboundTransaction(i, o) {
                return this.runtime.dispatch({
                    [co]: (a)=>a.signUnboundTransaction(i, o)
                }).pipe(Cn);
            }
            revertTransaction(i) {
                return this.runtime.dispatch({
                    [co]: (o)=>o.revertTransaction(i)
                }).pipe(Cn);
            }
            waitForSyncedState(i = 0n) {
                return Dn(this.state.pipe(vu((o)=>o.state.progress.isCompleteWithin(i))));
            }
            serializeState() {
                return Dn(this.state).then((i)=>i.serialize());
            }
            getAddress() {
                return Dn(this.state).then((i)=>i.address);
            }
        };
    }
    const Nst = {
        other (t) {
            let e;
            return t ? typeof t == "object" && "message" in t ? e = String(t.message) : typeof t == "string" ? e = t : e = "" : e = "", new mc({
                message: `Other wallet error: ${e}`,
                cause: t
            });
        },
        submission (t) {
            const e = t && typeof t == "object" && "message" in t ? String(t.message) : "";
            return new Vst({
                message: `Transaction submission error: ${e}`,
                cause: t
            });
        }
    };
    let mc = class extends wn("Wallet.Other") {
    }, i_ = class extends wn("Wallet.Sync") {
    };
    class Vst extends wn("Wallet.SubmissionWalletError") {
    }
    let $L = class extends wn("Wallet.InsufficientFunds") {
    };
    class u2t extends wn("Wallet.Address") {
    }
    class Dst extends wn("Wallet.InvalidCoinHashes") {
    }
    let d2t = class extends wn("Wallet.Transacting") {
    };
    const Bst = (t)=>{
        const e = t.progress?.appliedIndex ?? 0n, n = t.progress?.highestRelevantWalletIndex ?? 0n, r = t.progress?.highestIndex ?? 0n, s = t.progress?.highestRelevantIndex ?? 0n, i = r - s, o = n - e;
        return [
            fP({
                sourceGap: i,
                applyGap: o
            })
        ];
    }, Fst = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            pP({
                change: gP({
                    version: Wa(e.protocolVersion)
                })
            })
        ] : [], xl = Symbol("V1");
    let Lst = class {
        __polyTag__ = xl;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = ou(n.stateRef.get).pipe(zc((s)=>n.stateRef.changes.pipe(GI(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), N3(([s, i])=>[
                    dP({
                        state: i
                    }),
                    ...Bst(i),
                    ...Fst(s, i)
                ]));
        }
        startSyncInBackground(e) {
            return this.startSync(e).pipe(JI(XI), x1, Od(Ha, this.#e));
        }
        startSync(e) {
            return V(Xf(this.#t.stateRef), ou, zc((n)=>this.#n.syncService.updates(n, e)), $d((n)=>xp(this.#t.stateRef, (r)=>Io({
                        try: ()=>this.#n.syncCapability.applyUpdate(r, n),
                        catch: (s)=>new mc({
                                message: "Error while applying sync update",
                                cause: s
                            })
                    }))), YI((n)=>RI(n)), V3(V(E1(yu(1), 2), TI((n)=>{
                const r = Yy(2), s = ls(Math.floor(Math.random() * 1e3)), i = ki(n) + ki(s);
                return ls(Math.min(i, ki(r)));
            }))));
        }
        balanceTransaction(e, n) {
            return Il(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.balanceTransaction(e, r, n), Br));
        }
        transferTransaction(e, n) {
            return Il(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.makeTransfer(e, r, n), Br));
        }
        initSwap(e, n, r) {
            return Il(this.#t.stateRef, (s)=>V(this.#n.transactingCapability.initSwap(e, s, n, r), Br));
        }
        revertTransaction(e) {
            return xp(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Br));
        }
        serializeState(e) {
            return this.#n.serializationCapability.serialize(e);
        }
    };
    const G_ = {
        fromSecretKeys: (t)=>({
                coinPublicKey: t.coinPublicKey,
                encryptionPublicKey: t.encryptionPublicKey
            })
    }, gi = {
        empty: {},
        pickAllCoins (t) {
            return [
                ...t.coins,
                ...t.pendingOutputs.values().map(([e])=>e)
            ];
        },
        assertValid (t, e) {
            const n = gi.pickAllCoins(e), r = new Set(f6(n, (o)=>o.nonce)), s = new Set(Object.keys(t)), i = r.difference(s);
            return i.size === 0 ? o_e : st(i);
        },
        updateWithCoins (t, e, n) {
            return P_e(n, (r)=>[
                    r.nonce,
                    e[r.nonce] ?? {
                        commitment: Lie(r, t.coinPublicKey),
                        nullifier: zie(r, t.coinSecretKey)
                    }
                ]);
        },
        updateWithNewCoins (t, e, n) {
            const r = gi.updateWithCoins(t, gi.empty, n);
            return N_e(e, r, (s)=>s);
        },
        init (t, e) {
            return gi.updateWithCoins(t, {}, e);
        }
    }, Jo = {
        init (t, e, n) {
            const r = G_.fromSecretKeys(e), s = gi.init(e, gi.pickAllCoins(t)), i = Ju();
            return {
                state: t,
                publicKeys: r,
                networkId: n,
                coinHashes: s,
                progress: i,
                protocolVersion: Tp
            };
        },
        empty (t, e) {
            return {
                state: new Hs,
                publicKeys: t,
                networkId: e,
                coinHashes: gi.empty,
                progress: Ju(),
                protocolVersion: Tp
            };
        },
        restore (t, e, n, r, s) {
            const i = G_.fromSecretKeys(e), o = gi.init(e, gi.pickAllCoins(t));
            return {
                state: t,
                publicKeys: i,
                networkId: s,
                coinHashes: o,
                progress: Ju(n),
                protocolVersion: Wa(r)
            };
        },
        restoreWithCoinHashes (t, e, n, r, s, i) {
            return gi.assertValid(n, e).pipe(YH({
                onLeft: (o)=>new Dst({
                        message: "Missing coin hashes for coins present in the state",
                        missingNonces: o
                    }),
                onRight: ()=>({
                        state: e,
                        publicKeys: t,
                        networkId: i,
                        coinHashes: n,
                        progress: Ju(r),
                        protocolVersion: Wa(s)
                    })
            }));
        },
        initEmpty (t, e) {
            return this.empty(G_.fromSecretKeys(t), e);
        },
        applyCollapsedUpdate (t, e) {
            const n = t.state.applyCollapsedUpdate(e);
            return {
                ...t,
                state: n
            };
        },
        apply (t, e, n) {
            const r = t.state.apply(e, n), s = gi.updateWithCoins(e, t.coinHashes, gi.pickAllCoins(r));
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        },
        replayEvents (t, e, n) {
            const r = t.state.replayEvents(e, n), s = gi.updateWithCoins(e, t.coinHashes, gi.pickAllCoins(r));
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        },
        updateProgress (t, { appliedIndex: e, highestRelevantWalletIndex: n, highestIndex: r, highestRelevantIndex: s, isConnected: i }) {
            const o = Ju({
                appliedIndex: e ?? t.progress.appliedIndex,
                highestRelevantWalletIndex: n ?? t.progress.highestRelevantWalletIndex,
                highestIndex: r ?? t.progress.highestIndex,
                highestRelevantIndex: s ?? t.progress.highestRelevantIndex,
                isConnected: i ?? t.progress.isConnected
            });
            return {
                ...t,
                progress: o
            };
        },
        addTransaction (t, e) {
            return t;
        },
        revertTransaction (t, e) {
            const n = t.state.revertTransaction(e);
            return {
                ...t,
                state: n
            };
        },
        updateTxHistory (t, e) {
            return t;
        },
        spendCoins (t, e, n, r) {
            const [s, i] = V(n, nu([
                [],
                t.state
            ], ([a, c], l)=>{
                const [u, d] = c.spend(e, l, r), f = is.fromInput(d, l.type, l.value);
                return [
                    a.concat([
                        f
                    ]),
                    u
                ];
            })), o = {
                ...t,
                state: i
            };
            return [
                s,
                o
            ];
        },
        watchCoins (t, e, n) {
            const r = n.reduce((i, o)=>i.watchFor(t.publicKeys.coinPublicKey, o), t.state), s = gi.updateWithNewCoins(e, t.coinHashes, n);
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        }
    }, zst = Ni((t)=>t instanceof Hs).annotations({
        identifier: "ledger.ZswapLocalState"
    }), Ust = Ni((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), Hst = ()=>Oo(Ust, zst, {
            encode: (t)=>Io({
                    try: ()=>t.serialize(),
                    catch: (e)=>new Ao(e, "Could not serialize local state")
                }),
            decode: (t)=>Io({
                    try: ()=>Hs.deserialize(t),
                    catch: (e)=>new Ao(e, "Could not deserialize local state")
                })
        }), jst = ()=>V(O1, A1(Hst())), qst = ()=>{
        const t = tn({
            publicKeys: tn({
                coinPublicKey: en,
                encryptionPublicKey: en
            }),
            state: jst(),
            protocolVersion: Wl,
            offset: $f(Wl),
            networkId: en,
            coinHashes: ARe({
                key: en,
                value: tn({
                    nullifier: en,
                    commitment: en
                })
            })
        });
        return {
            serialize: (e)=>V(e, (r)=>({
                        publicKeys: r.publicKeys,
                        state: r.state,
                        protocolVersion: r.protocolVersion,
                        networkId: r.networkId,
                        offset: r.progress?.appliedIndex,
                        coinHashes: r.coinHashes
                    }), sd(t), JSON.stringify),
            deserialize: (e, n)=>V(n, Xc(P1(t)), Ks((r)=>Nst.other(r)), _g((r)=>Jo.restoreWithCoinHashes(r.publicKeys, r.state, r.coinHashes, {
                        appliedIndex: r.offset ?? 0n,
                        highestRelevantWalletIndex: 0n,
                        highestIndex: 0n,
                        highestRelevantIndex: 0n,
                        isConnected: !1
                    }, r.protocolVersion, r.networkId)))
        };
    }, Wst = Ni((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), Kst = {
        create: (t, e)=>({
                updates: t,
                secretKeys: e
            })
    }, FQ = Ni((t)=>t instanceof yd).annotations({
        identifier: "ledger.Event"
    }), $st = Oo(Wst, FQ, {
        encode: (t)=>Io({
                try: ()=>t.serialize(),
                catch: (e)=>new Ao(e, "Could not serialize ledger event")
            }),
        decode: (t)=>Io({
                try: ()=>yd.deserialize(t),
                catch: (e)=>new Ao(e, "Could not deserialize ledger event")
            })
    }), XL = V(O1, A1($st)), Xst = tn({
        id: Or,
        raw: en,
        maxId: Or
    }), Gst = IRe("EventsSyncUpdate", {
        id: Or,
        maxId: Or,
        event: FQ
    }), Zst = Oo(Xst, Gst, {
        decode: (t)=>V(Xc(XL)(t.raw), Qs((e)=>({
                    _tag: "EventsSyncUpdate",
                    id: t.id,
                    maxId: t.maxId,
                    event: e
                })), Ks((e)=>new Ao(e, "Failed to decode ledger event payload")), Br),
        encode: (t)=>V(fRe(XL)(t.event), Qs((e)=>({
                    id: t.id,
                    raw: e,
                    maxId: t.maxId
                })), Ks((e)=>new Ao(e, "Failed to encode ledger event payload")), Br)
    }), Jst = (t)=>({
            updates: (e, n)=>{
                const { indexerClientConnection: r } = t, s = nA(r.indexerHttpUrl, r.indexerWsUrl);
                if (pr(s)) return xy(new i_(new Error(`Could not derive WebSocket URL from indexer HTTP URL: ${s.left.message}`)));
                const i = F3(s.right);
                if (pr(i)) return xy(new i_(new Error(`Invalid indexer WS URL: ${i.left.message}`)));
                const o = i.right, a = e.progress?.appliedIndex ?? 0n, c = t.batchSize ?? 50;
                return V(NVe.run({
                    id: Number(a)
                }), $G(tA({
                    url: o,
                    keepAlive: t.indexerClientConnection.keepAlive
                })), ZI((l)=>new i_(l)), $d((l)=>V(l.zswapLedgerEvents, Xc(Zst), Ks((u)=>new i_(u)), Br)), KG(c, ls(1)), dx(kC), dx((l)=>Kst.create(l, n)), GG(I1(ls(1))));
            }
        }), Yst = ()=>({
            applyUpdate: (t, e)=>{
                if (e.updates.length === 0) return t;
                const n = e.updates.at(-1), r = BigInt(n.id), s = BigInt(n.maxId);
                return r <= t.progress.appliedIndex ? Jo.updateProgress(t, {
                    highestRelevantWalletIndex: s,
                    isConnected: !0
                }) : Jo.updateProgress(Jo.replayEvents(t, e.secretKeys, e.updates.map((i)=>i.event)), {
                    highestRelevantWalletIndex: s,
                    appliedIndex: r,
                    isConnected: !0
                });
            }
        }), GL = {
        inputFeeOverhead: 0n,
        outputFeeOverhead: 0n
    }, u7 = new class {
        empty = ()=>({
                guaranteed: Es.empty(),
                fallible: Es.empty()
            });
        areBalanced = (t)=>{
            const e = t.fallible.entries().every(([, r])=>r === 0n), n = t.guaranteed.entries().every(([, r])=>r === 0n);
            return e && n;
        };
    }, Qu = new class {
        default = {
            getImbalances (t) {
                return Qu.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        proofErased = {
            getImbalances (t) {
                return Qu.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        unproven = {
            getImbalances (t) {
                return Qu.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        shared = {
            getImbalances (t) {
                const e = Qu.shared.getGuaranteedImbalances(t), n = Qu.shared.getFallibleImbalances(t);
                return V({
                    guaranteed: e,
                    fallible: n,
                    fees: 0n
                });
            },
            getGuaranteedImbalances: (t)=>{
                const e = t.imbalances(0).entries().filter(([n])=>n.tag === "shielded").map(([n, r])=>[
                        n.raw.toString(),
                        r
                    ]);
                return Es.fromEntries(e);
            },
            getFallibleImbalances: (t)=>{
                try {
                    const e = t.imbalances(1).entries().filter(([n])=>n.tag === "shielded").map(([n, r])=>[
                            n.raw.toString(),
                            r
                        ]);
                    return Es.fromEntries(e);
                } catch  {
                    return Es.empty();
                }
            }
        };
    }, Qst = (t, e)=>new eit(t.networkId, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability, Qu.default);
    let eit = class {
        networkId;
        getCoinSelection;
        txOps;
        getCoins;
        getKeys;
        constructor(e, n, r, s, i){
            this.getCoins = r, this.networkId = e, this.getCoinSelection = n, this.getKeys = s, this.txOps = i;
        }
        balanceTransaction(e, n, r) {
            return qs(this, function*() {
                const s = this.getCoinSelection(), i = this.txOps.getImbalances(r);
                if (u7.areBalanced(i)) return [
                    void 0,
                    n
                ];
                const { newState: o, offer: a } = yield* this.balanceFallibleSection(e, n, i, s), { newState: c, offer: l } = yield* this.#t(e, o, i, s, Es.empty());
                return [
                    _n.fromParts(this.networkId, l, a),
                    c
                ];
            });
        }
        makeTransfer(e, n, r) {
            return qs(this, function*() {
                const s = yield* V(r, Xy((m)=>m.amount > 0n), k8({
                    onEmpty: ()=>st(new mc({
                            message: "The amount needs to be positive"
                        })),
                    onNonEmpty: (m)=>mt(m)
                })), i = this.networkId, { initialOffersAndCoins: o, selfCoins: a } = yield* this.#n(n, s), c = V(o, Ps((m)=>m.outputOffer), sS((m, w)=>m.merge(w))), l = _n.fromParts(i, c), u = Qu.unproven.getImbalances(l), { offer: d, newState: f } = yield* this.#t(e, n, u, this.getCoinSelection(), Es.empty()), p = Jo.watchCoins(f, e, a);
                return [
                    l.merge(_n.fromParts(i, d)),
                    p
                ];
            });
        }
        initSwap(e, n, r, s) {
            return qs(this, function*() {
                if (!s.every((m)=>m.amount > 0n)) return yield* st(new mc({
                    message: "The amount needs to be positive"
                }));
                if (!Object.entries(r).every(([, m])=>m > 0n)) return yield* st(new mc({
                    message: "The input amounts need to be positive"
                }));
                const a = yield* this.#r(n, s), c = Es.fromEntries(M_e(r)), l = this.networkId, { offer: u, newState: d } = yield* this.#t(e, n, u7.empty(), this.getCoinSelection(), c), f = Jo.watchCoins(d, e, a.selfCoins), p = _n.fromParts(l, u);
                return [
                    a.unprovenTxToBalance ? a.unprovenTxToBalance.merge(p) : p,
                    f
                ];
            });
        }
        revertTransaction(e, n) {
            return yo({
                try: ()=>Jo.revertTransaction(e, n),
                catch: (r)=>new mc({
                        message: `Error while reverting transaction ${n.identifiers().at(0)}`,
                        cause: r
                    })
            });
        }
        #e(e, n, r, s) {
            const [i, o] = Jo.spendCoins(n, e, r.inputs, s), a = Jo.watchCoins(o, e, r.outputs), c = r.outputs.map((l)=>{
                const u = $i.new(l, s, this.getKeys().getCoinPublicKey(n).toHexString(), this.getKeys().getEncryptionPublicKey(n).toHexString());
                return is.fromOutput(u, l.type, l.value);
            });
            return V(uv(i, c), k8({
                onEmpty: ()=>Fe(),
                onNonEmpty: (l)=>V(l, sS((u, d)=>u.merge(d)), ze)
            }), Ac((l)=>({
                    offer: l,
                    newState: a
                })));
        }
        balanceFallibleSection(e, n, r, s) {
            return yo({
                try: ()=>{
                    const i = b2({
                        coins: this.getCoins().getAvailableCoins(n).map((o)=>o.coin),
                        initialImbalances: r.fallible,
                        transactionCostModel: GL,
                        feeTokenType: "",
                        coinSelection: s,
                        createOutput: (o)=>y5(o.type, o.value),
                        isCoinEqual: (o, a)=>o.type === a.type && o.value === a.value
                    });
                    return V(this.#e(e, n, i, 1), dn({
                        onNone: ()=>({
                                newState: n,
                                offer: void 0
                            }),
                        onSome: (o)=>o
                    }));
                },
                catch: (i)=>i instanceof jm ? new $L({
                        message: "Insufficient funds",
                        tokenType: i.tokenType,
                        amount: r.fallible.get(i.tokenType) ?? 0n
                    }) : new mc({
                        message: "Balancing fallible section failed",
                        cause: i
                    })
            });
        }
        #t(e, n, r, s, i) {
            return qs(this, function*() {
                const o = yield* yo({
                    try: ()=>b2({
                            coins: this.getCoins().getAvailableCoins(n).map((a)=>a.coin),
                            initialImbalances: r.guaranteed,
                            transactionCostModel: GL,
                            feeTokenType: "",
                            coinSelection: s,
                            createOutput: (a)=>y5(a.type, a.value),
                            isCoinEqual: (a, c)=>a.nonce === c.nonce,
                            targetImbalances: i
                        }),
                    catch: (a)=>a instanceof jm ? new $L({
                            message: "Insufficient funds",
                            tokenType: a.tokenType,
                            amount: r.guaranteed.get(a.tokenType) ?? 0n
                        }) : new mc({
                            message: "Balancing guaranteed section failed",
                            cause: a
                        })
                });
                return yield* V(this.#e(e, n, o, 0), aC(()=>new mc({
                        message: "Could not create a valid guaranteed offer"
                    })));
            });
        }
        #n(e, n) {
            return yo({
                try: ()=>{
                    const r = V(n, Ps((i)=>{
                        const { receiverAddress: o, type: a, amount: c } = i, l = y5(a, c), u = $i.new(l, 0, o.coinPublicKey.toHexString(), o.encryptionPublicKey.toHexString()), d = is.fromOutput(u, a, c);
                        return {
                            coin: l,
                            outputOffer: d,
                            isForSelf: o.coinPublicKey.equals(this.getKeys().getCoinPublicKey(e))
                        };
                    })), s = vg(r, ({ coin: i, isForSelf: o })=>o ? [
                            i
                        ] : []);
                    return {
                        initialOffersAndCoins: r,
                        selfCoins: s
                    };
                },
                catch: (r)=>new mc({
                        message: "Failed to process desired outputs",
                        cause: r
                    })
            });
        }
        #r(e, n) {
            return V(n, k8({
                onEmpty: ()=>mt({
                        imbalances: u7.empty(),
                        selfCoins: [],
                        unprovenTxToBalance: null
                    }),
                onNonEmpty: (r)=>V(this.#n(e, r), Qs(({ initialOffersAndCoins: s, selfCoins: i })=>{
                        const o = this.networkId, a = V(s, Ps((u)=>u.outputOffer), sS((u, d)=>u.merge(d))), c = _n.fromParts(o, a);
                        return {
                            imbalances: Qu.unproven.getImbalances(c),
                            selfCoins: i,
                            unprovenTxToBalance: c
                        };
                    }))
            }));
        }
    };
    const ZL = (t)=>t.reduce((e, { coin: n })=>({
                ...e,
                [n.type]: e[n.type] === void 0 ? n.value : e[n.type] + n.value
            }), {}), tit = ()=>{
        const t = (o)=>{
            const a = r(o);
            return ZL(a);
        }, e = (o)=>{
            const a = s(o);
            return ZL(a);
        }, n = (o)=>{
            const a = t(o), c = e(o);
            return V([
                a,
                c
            ], RZ(0n, (l, u)=>l + u));
        }, r = (o)=>{
            const a = new Set([
                ...o.state.pendingSpends.values()
            ].map(([c])=>c.nonce));
            return V([
                ...o.state.coins
            ], Xy((c)=>!a.has(c.nonce)), Ps((c)=>({
                    coin: c,
                    commitment: o.coinHashes[c.nonce].commitment,
                    nullifier: o.coinHashes[c.nonce].nullifier
                })));
        }, s = (o)=>V([
                ...o.state.pendingOutputs.values()
            ], Ps(([a, c])=>({
                    coin: a,
                    ttl: c,
                    commitment: o.coinHashes[a.nonce].commitment,
                    nullifier: o.coinHashes[a.nonce].nullifier
                })));
        return {
            getAvailableBalances: t,
            getPendingBalances: e,
            getTotalBalances: n,
            getAvailableCoins: r,
            getPendingCoins: s,
            getTotalCoins: (o)=>[
                    ...r(o),
                    ...s(o)
                ]
        };
    }, nit = ()=>({
            getCoinPublicKey: (t)=>new ia(Buffer.from(t.publicKeys.coinPublicKey, "hex")),
            getEncryptionPublicKey: (t)=>new Jl(Buffer.from(t.publicKeys.encryptionPublicKey, "hex")),
            getAddress: (t)=>{
                const e = new ia(Buffer.from(t.publicKeys.coinPublicKey, "hex")), n = new Jl(Buffer.from(t.publicKeys.encryptionPublicKey, "hex"));
                return new Zl(e, n);
            }
        }), rit = ()=>({
            updateTxHistory: (t, e)=>e.reduce((n, r)=>Jo.addTransaction(n, r), t),
            transactionHistory: (t)=>[]
        });
    let sit = class bl {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withDefaultTransactionType().withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withTransactionHistoryDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withTransactionType() {
            return new bl({
                ...this.#e,
                transactingCapability: void 0,
                transactionHistoryCapability: void 0
            });
        }
        withDefaultTransactionType() {
            return this.withTransactionType();
        }
        withSyncDefaults() {
            return this.withSync(Jst, Yst);
        }
        withSync(e, n) {
            return new bl({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(qst);
        }
        withSerialization(e) {
            return new bl({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(Qst);
        }
        withTransacting(e) {
            return new bl({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new bl({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>GT);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(tit);
        }
        withCoinsAndBalances(e) {
            return new bl({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withTransactionHistoryDefaults() {
            return this.withTransactionHistory(rit);
        }
        withTransactionHistory(e) {
            return new bl({
                ...this.#e,
                transactionHistoryCapability: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(nit);
        }
        withKeys(e) {
            return new bl({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e), { networkId: r } = e;
            return {
                __polyTag__: xl,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                transactionHistory: n.transactionHistoryCapability,
                start (s) {
                    return or(function*() {
                        const i = yield* Ha;
                        return new Lst(i, s, n);
                    });
                },
                migrateState (s) {
                    const i = pQ("0000000000000000000000000000000000000000000000000000000000000001");
                    return Zt(Jo.empty(G_.fromSecretKeys(qi.fromSeed(i)), r));
                },
                deserializeState: (s)=>n.serializationCapability.deserialize(null, s)
            };
        }
        #t(e) {
            if (!iit(this.#e)) throw new Error("Not all components are configured in V1 Builder");
            const { syncCapability: n, syncService: r, transactingCapability: s, serializationCapability: i, coinSelection: o, coinsAndBalancesCapability: a, keysCapability: c, transactionHistoryCapability: l } = this.#e, u = ()=>d, d = {
                serializationCapability: i(e, u),
                syncCapability: n(e, u),
                syncService: r(e, u),
                transactingCapability: s(e, u),
                coinsAndBalancesCapability: a(e, u),
                keysCapability: c(e, u),
                coinSelection: o(e, u),
                transactionHistoryCapability: l(e, u)
            };
            return d;
        }
    };
    const iit = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability",
            "transactionHistoryCapability"
        ].every((n)=>typeof t[n] == "function");
    class CP {
        static mapState = (e)=>(n)=>new CP(n, e);
        protocolVersion;
        state;
        capabilities;
        get balances() {
            return this.capabilities.coinsAndBalances.getAvailableBalances(this.state);
        }
        get totalCoins() {
            return this.capabilities.coinsAndBalances.getTotalCoins(this.state);
        }
        get availableCoins() {
            return this.capabilities.coinsAndBalances.getAvailableCoins(this.state);
        }
        get pendingCoins() {
            return this.capabilities.coinsAndBalances.getPendingCoins(this.state);
        }
        get coinPublicKey() {
            return this.capabilities.keys.getCoinPublicKey(this.state);
        }
        get encryptionPublicKey() {
            return this.capabilities.keys.getEncryptionPublicKey(this.state);
        }
        get address() {
            return this.capabilities.keys.getAddress(this.state);
        }
        get progress() {
            return this.state.progress;
        }
        get transactionHistory() {
            throw new Error("Transaction history is not yet implemented for ShieldedWallet");
        }
        constructor(e, n){
            this.protocolVersion = e.version, this.state = e.state, this.capabilities = n;
        }
        serialize() {
            return this.capabilities.serialization.serialize(this.state);
        }
    }
    function Fx(t) {
        return oit(t, new sit().withDefaults());
    }
    function oit(t, e) {
        const n = [
            t
        ], r = ig.init().withVariant(Tp, e).build(...n);
        return class ml extends r {
            static startWithSecretKeys(i) {
                return ml.startFirst(ml, Jo.initEmpty(i, ml.configuration.networkId));
            }
            static startWithSeed(i) {
                const o = qi.fromSeed(i);
                return ml.startWithSecretKeys(o);
            }
            static restore(i) {
                const o = ml.allVariantsRecord()[xl].variant.deserializeState(i).pipe(ov);
                return ml.startFirst(ml, o);
            }
            state;
            constructor(i, o){
                super(i, o), this.state = this.rawState.pipe(ve(CP.mapState(ml.allVariantsRecord()[xl].variant)), U3({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start(i) {
                return this.runtime.dispatch({
                    [xl]: (o)=>o.startSyncInBackground(i)
                }).pipe(Cn);
            }
            balanceTransaction(i, o) {
                return this.runtime.dispatch({
                    [xl]: (a)=>a.balanceTransaction(i, o)
                }).pipe(Cn);
            }
            transferTransaction(i, o) {
                return this.runtime.dispatch({
                    [xl]: (a)=>a.transferTransaction(i, o)
                }).pipe(Cn);
            }
            initSwap(i, o, a) {
                return this.runtime.dispatch({
                    [xl]: (c)=>c.initSwap(i, o, a)
                }).pipe(Cn);
            }
            revertTransaction(i) {
                return this.runtime.dispatch({
                    [xl]: (o)=>o.revertTransaction(i)
                }).pipe(Cn);
            }
            waitForSyncedState(i = 0n) {
                return Dn(this.state.pipe(vu((o)=>o.state.progress.isCompleteWithin(i))));
            }
            serializeState() {
                return Dn(this.state).then((i)=>i.serialize());
            }
            getAddress() {
                return Dn(this.state).then((i)=>i.address);
            }
        };
    }
    const JL = {
        fromSecretKey: (t)=>({
                publicKey: t.publicKey
            })
    }, wo = {
        init (t, e, n) {
            return wo.empty(t, JL.fromSecretKey(e), n);
        },
        initEmpty (t, e, n) {
            return wo.empty(new ea(t), JL.fromSecretKey(e), n);
        },
        empty (t, e, n) {
            return {
                state: t,
                publicKey: e,
                networkId: n,
                pendingDust: [],
                progress: Ju(),
                protocolVersion: Tp
            };
        },
        restore (t, e, n, r, s, i) {
            return {
                state: t,
                publicKey: e,
                networkId: i,
                pendingDust: n,
                progress: Ju(r),
                protocolVersion: Wa(s)
            };
        },
        applyEvents (t, e, n, r) {
            const s = t.state.replayEvents(e, n).processTtls(r), i = s.utxos.map((o)=>o.nonce);
            return {
                ...t,
                state: s,
                pendingDust: t.pendingDust.filter((o)=>i.includes(o.nonce))
            };
        },
        applyFailed (t, e) {
            const n = wo.pendingDustToMap(t.pendingDust), r = V([
                ...e.intents?.values() ?? []
            ], vg((o)=>{
                const a = o.dustActions?.ctime;
                return (o.dustActions?.spends ?? []).map((c)=>({
                        spend: c,
                        spendTime: a
                    }));
            }), dv(({ spend: o, spendTime: a })=>V(Mp(n.get(o.oldNullifier)), Ac(()=>({
                        spend: o,
                        spendTime: a
                    }))))), [s, i] = V(r, nu([
                t.state,
                []
            ], ([o, a], { spend: c, spendTime: l })=>[
                    o.processTtls(cZ(l, t.state.params.dustGracePeriodSeconds)),
                    $m(a, c.oldNullifier)
                ]));
            return {
                ...t,
                state: s,
                pendingDust: t.pendingDust.filter((o)=>!i.includes(o.nullifier))
            };
        },
        revertTransaction (t, e) {
            return wo.applyFailed(t, e);
        },
        updateProgress (t, { appliedIndex: e, highestRelevantWalletIndex: n, highestIndex: r, highestRelevantIndex: s, isConnected: i }) {
            const o = Ju({
                appliedIndex: e ?? t.progress.appliedIndex,
                highestRelevantWalletIndex: n ?? t.progress.highestRelevantWalletIndex,
                highestIndex: r ?? t.progress.highestIndex,
                highestRelevantIndex: s ?? t.progress.highestRelevantIndex,
                isConnected: i ?? t.progress.isConnected
            });
            return {
                ...t,
                progress: o
            };
        },
        spendCoins (t, e, n, r) {
            const [s, i, o] = V(n, nu([
                [],
                t.state,
                t.pendingDust
            ], ([a, c, l], { token: u, value: d })=>{
                const [f, p] = c.spend(e, u, d, r), h = [
                    ...l,
                    {
                        ...u,
                        nullifier: p.oldNullifier
                    }
                ];
                return [
                    $m(a, p),
                    f,
                    h
                ];
            }));
            return [
                s,
                {
                    ...t,
                    state: i,
                    pendingDust: o
                }
            ];
        },
        pendingDustToMap (t) {
            return new Map(t.map(({ nullifier: e, ...n })=>[
                    e,
                    n
                ]));
        }
    };
    class fu extends wn("Wallet.Other") {
    }
    class d7 extends wn("Wallet.Sync") {
    }
    class o_ extends wn("Wallet.Transacting") {
    }
    class ait extends wn("Wallet.InsufficientFunds") {
    }
    const cit = (t)=>{
        const e = t.progress?.appliedIndex ?? 0n, n = t.progress?.highestRelevantWalletIndex ?? 0n, r = t.progress?.highestIndex ?? 0n, s = t.progress?.highestRelevantIndex ?? 0n, i = r - s, o = n - e;
        return [
            fP({
                sourceGap: i,
                applyGap: o
            })
        ];
    }, lit = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            pP({
                change: gP({
                    version: Wa(e.protocolVersion)
                })
            })
        ] : [], Ea = Symbol("V1");
    class uit {
        __polyTag__ = Ea;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = ou(n.stateRef.get).pipe(zc((s)=>n.stateRef.changes.pipe(GI(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), N3(([s, i])=>[
                    dP({
                        state: i
                    }),
                    ...cit(i),
                    ...lit(s, i)
                ]));
        }
        startSyncInBackground(e) {
            return this.startSync(e).pipe(JI(XI), x1, Od(Ha, this.#e));
        }
        startSync(e) {
            return V(Xf(this.#t.stateRef), ou, zc((n)=>this.#n.syncService.updates(n, e)), $d((n)=>xp(this.#t.stateRef, (r)=>Io({
                        try: ()=>this.#n.syncCapability.applyUpdate(r, n),
                        catch: (s)=>new fu({
                                message: "Error while applying sync update",
                                cause: s
                            })
                    }))), YI((n)=>RI(n)), V3(V(E1(yu(1), 2), TI((n)=>{
                const r = Yy(2), s = ls(Math.floor(Math.random() * 1e3)), i = ki(n) + ki(s);
                return ls(Math.min(i, ki(r)));
            }))));
        }
        createDustGenerationTransaction(e, n, r, s, i) {
            return r.some((o)=>o.type !== Yx().raw) ? Ns(new fu({
                message: "Token of a non-Night type received"
            })) : R$.pipe(Cf("currentState", ()=>Xf(this.#t.stateRef)), Cf("blockData", ()=>this.#n.syncService.blockData()), EN("currentTime", ({ blockData: o })=>e ?? o.timestamp), EN("utxosWithDustValue", ({ currentState: o, currentTime: a })=>this.#n.coinsAndBalancesCapability.estimateDustGeneration(o, r, a)), nt(({ utxosWithDustValue: o, currentTime: a })=>this.#n.transactingCapability.createDustGenerationTransaction(a, n, o, s, i).pipe(Br)));
        }
        addDustGenerationSignature(e, n) {
            return this.#n.transactingCapability.addDustGenerationSignature(e, n).pipe(Br);
        }
        calculateFee(e) {
            return V(this.#n.syncService.blockData(), wt((n)=>V(e, Ps((r)=>this.#n.transactingCapability.calculateFee(r, n.ledgerParameters)), BVe)));
        }
        estimateFee(e, n, r, s) {
            return V(py([
                Xf(this.#t.stateRef),
                this.#n.syncService.blockData()
            ]), nt(([i, o])=>V(this.#n.transactingCapability.estimateFee(e, i, n, r, s ?? o.timestamp, o.ledgerParameters), Br)));
        }
        balanceTransactions(e, n, r, s) {
            return Il(this.#t.stateRef, (i)=>V(this.#n.syncService.blockData(), nt((o)=>this.#n.transactingCapability.balanceTransactions(e, i, n, r, s ?? o.timestamp, o.ledgerParameters))));
        }
        revertTransaction(e) {
            return xp(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Br));
        }
    }
    const dit = Ni((t)=>t instanceof ea).annotations({
        identifier: "ledger.DustLocalState"
    }), LQ = Ni((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), fit = Oo(LQ, dit, {
        encode: (t)=>Io({
                try: ()=>t.serialize(),
                catch: (e)=>new Ao(e, "Could not serialize local state")
            }),
        decode: (t)=>Io({
                try: ()=>ea.deserialize(t),
                catch: (e)=>new Ao(e, "Could not deserialize local state")
            })
    }), pit = V(O1, A1(fit)), YL = tn({
        publicKey: tn({
            publicKey: Wl
        }),
        state: pit,
        protocolVersion: Wl,
        networkId: en,
        offset: $f(Wl)
    }), hit = ()=>({
            serialize: (t)=>V(t, (n)=>({
                        publicKey: n.publicKey,
                        state: n.state,
                        protocolVersion: n.protocolVersion,
                        networkId: n.networkId,
                        offset: n.progress?.appliedIndex
                    }), sd(YL), JSON.stringify),
            deserialize: (t, e)=>V(e, Xc(P1(YL)), Ks((n)=>new fu({
                        message: "Error while deserializing snapshot",
                        cause: n
                    })), _g((n)=>yo({
                        try: ()=>wo.restore(n.state, n.publicKey, [], {
                                appliedIndex: n.offset ?? 0n,
                                highestRelevantWalletIndex: 0n,
                                highestIndex: 0n,
                                highestRelevantIndex: 0n
                            }, n.protocolVersion, n.networkId),
                        catch: (r)=>new fu({
                                message: "Error while restoring core wallet",
                                cause: r
                            })
                    })))
        }), git = Ni((t)=>t instanceof yd).annotations({
        identifier: "ledger.Event"
    }), bit = Oo(LQ, git, {
        encode: (t)=>Io({
                try: ()=>t.serialize(),
                catch: (e)=>new Ao(e, "Could not serialize Ledger Event")
            }),
        decode: (t)=>Io({
                try: ()=>yd.deserialize(t),
                catch: (e)=>new Ao(e, "Could not deserialize Ledger Event")
            })
    }), mit = V(O1, A1(bit)), yit = tn({
        id: Or,
        raw: mit,
        maxId: Or
    }), wit = {
        create: (t, e, n)=>({
                updates: t,
                secretKey: e,
                timestamp: n
            })
    }, _it = (t)=>{
        const e = xit(t);
        return {
            updates: (n, r)=>{
                const i = ls(1);
                return V(e.subscribeWallet(n), KG(50, i), dx(kC), dx((o)=>wit.create(o, r, new Date)), GG(I1(ls(1))), uNe(e.connectionLayer()));
            },
            blockData: ()=>or(function*() {
                    return (yield* (yield* AVe)({
                        offset: null
                    })).block;
                }).pipe(Pd(e.queryClient()), tI, Gg((n)=>Ns(new fu({
                        message: `Encountered unexpected error: ${n.message}`,
                        cause: n
                    }))), nt((n)=>{
                    if (!n) throw new fu({
                        message: "Unable to fetch block data"
                    });
                    return L_(()=>({
                            hash: n.hash,
                            height: n.height,
                            ledgerParameters: wi.deserialize(Buffer.from(n.ledgerParameters, "hex")),
                            timestamp: new Date(n.timestamp)
                        }));
                }))
        };
    }, xit = (t)=>({
            queryClient () {
                return V(eA({
                    url: t.indexerClientConnection.indexerHttpUrl
                }), AN((e)=>new fu(e)));
            },
            connectionLayer () {
                const { indexerClientConnection: e } = t;
                return nA(e.indexerHttpUrl, e.indexerWsUrl).pipe(_g((n)=>F3(n)), xr({
                    onLeft: (n)=>mIe(n),
                    onRight: (n)=>tA({
                            url: n,
                            keepAlive: e.keepAlive
                        })
                }), AN((n)=>new d7({
                        message: "Failed to to obtain correct indexer URLs",
                        cause: n
                    })));
            },
            subscribeWallet (e) {
                const { appliedIndex: n } = e.progress;
                return V(MVe.run({
                    id: Number(n)
                }), $d((r)=>V(Xc(yit)(r.dustLedgerEvents), Ks((s)=>new d7(s)), Br)), ZI((r)=>new d7(r)));
            }
        }), vit = ()=>({
            applyUpdate (t, e) {
                const { updates: n, secretKey: r } = e;
                if (n.length === 0) return t;
                const s = n.at(-1), i = BigInt(s.id), o = BigInt(s.maxId);
                if (i <= t.progress.appliedIndex) return wo.updateProgress(t, {
                    highestRelevantWalletIndex: o,
                    isConnected: !0
                });
                const a = n.map((c)=>c.raw).filter((c)=>c !== null);
                return wo.updateProgress(wo.applyEvents(t, r, a, e.timestamp), {
                    appliedIndex: i,
                    highestRelevantWalletIndex: o,
                    isConnected: !0
                });
            }
        }), Sit = ()=>({
            getPublicKey: (t)=>t.publicKey.publicKey,
            getAddress: (t)=>new Yu(t.publicKey.publicKey)
        }), kit = (t)=>t.toSorted((e, n)=>Number(e.value - n.value)).at(0), Tit = "0".repeat(64), Cit = (t, e)=>{
        const n = (h, m)=>h.state.walletBalance(m), r = (h)=>{
            const m = new Set([
                ...h.pendingDust.values()
            ].map((w)=>w.nonce));
            return V(h.state.utxos, Xy((w)=>!m.has(w.nonce)));
        }, s = (h)=>h.pendingDust, i = (h)=>[
                ...r(h),
                ...s(h)
            ], o = (h, m)=>{
            const w = h.state.generationInfo(m);
            return w && w.dtime ? {
                ...w,
                dtime: new Date(+w.dtime)
            } : w;
        }, a = (h, m)=>{
            const w = [], v = r(h);
            for (const k of v){
                const _ = o(h, k);
                if (_) {
                    const A = MM(k.ctime, k.initialValue, _, m, h.state.params);
                    w.push({
                        token: k,
                        value: A
                    });
                }
            }
            return w;
        }, c = (h, m)=>{
            const w = [], v = r(h);
            for (const k of v){
                const _ = o(h, k);
                _ && w.push({
                    token: k,
                    ...l(h.state.params, _, k, m)
                });
            }
            return w;
        }, l = (h, m, w, v)=>{
            const k = MM(w.ctime, w.initialValue, m, v, h);
            return {
                dtime: m.dtime,
                maxCap: m.value * h.nightDustRatio,
                maxCapReachedAt: cZ(w.ctime, h.timeToCapSeconds),
                generatedNow: k,
                rate: m.value * h.generationDecayRate
            };
        }, u = (h, m, w)=>{
            const v = e().keysCapability.getPublicKey(h);
            return V(m, Ps((k)=>{
                const _ = d(k, v), A = f(v, k), P = l(h.state.params, _, A, w);
                return {
                    utxo: k,
                    dust: P
                };
            }));
        }, d = (h, m)=>({
                value: h.value,
                owner: m,
                nonce: Tit,
                dtime: void 0
            }), f = (h, m)=>({
                initialValue: 0n,
                owner: h,
                nonce: 0n,
                seq: 0,
                ctime: m.ctime,
                backingNight: "",
                mtIndex: 0n
            });
        return {
            getWalletBalance: n,
            getAvailableCoins: r,
            getPendingCoins: s,
            getTotalCoins: i,
            getAvailableCoinsWithGeneratedDust: a,
            getAvailableCoinsWithFullInfo: c,
            getGenerationInfo: o,
            estimateDustGeneration: u,
            splitNightUtxos: (h)=>{
                const [m, w] = V(h, P0(V(d_e, f_e, ip((v)=>v.dust.generatedNow))), uC(1));
                return {
                    guaranteed: m,
                    fallible: w
                };
            }
        };
    }, a_ = {
        signature: "signature"
    }, vh = {
        preProof: "pre-proof"
    }, QL = {
        preBinding: "pre-binding"
    }, Eit = (t, e)=>new EP(t.networkId, t.costParameters, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability), Iit = (t, e)=>t.reduce(({ result: n, remaining: r }, s)=>{
            const i = r >= s.value ? s.value : r;
            return {
                result: [
                    ...n,
                    {
                        ...s,
                        value: i
                    }
                ],
                remaining: r - i
            };
        }, {
            result: [],
            remaining: e
        }).result;
    class EP {
        networkId;
        costParams;
        getCoinSelection;
        getCoins;
        getKeys;
        constructor(e, n, r, s, i){
            this.getCoins = s, this.networkId = e, this.costParams = n, this.getCoinSelection = r, this.getKeys = i;
        }
        createDustGenerationTransaction(e, n, r, s, i) {
            const o = (a)=>{
                if (a.length === 0) return Fe();
                const c = V(a, f6((d)=>d.utxo.value), iR), l = a.map(({ utxo: d })=>({
                        ...d,
                        owner: s
                    })), u = {
                    owner: _H(s),
                    type: Yx().raw,
                    value: c
                };
                return ze(mo.new(l, [
                    u
                ], []));
            };
            return qs(this, function*() {
                const a = i ? i.data : void 0;
                return yield* L_(()=>{
                    const c = this.networkId, l = this.getCoins().splitNightUtxos(r), u = a ? V(l.guaranteed, A_e((w)=>!w.utxo.registeredForDustGeneration), f6((w)=>w.dust.generatedNow), iR) : 0n, d = o(l.guaranteed), f = o(l.fallible), p = new Ql(a_.signature, s, a, u), h = new Oa(a_.signature, vh.preProof, e, [], [
                        p
                    ]), m = V(Zr.new(n), (w)=>dn(d, {
                            onNone: ()=>w,
                            onSome: (v)=>(w.guaranteedUnshieldedOffer = v, w)
                        }), (w)=>dn(f, {
                            onNone: ()=>w,
                            onSome: (v)=>(w.fallibleUnshieldedOffer = v, w)
                        }), (w)=>(w.dustActions = h, w));
                    return _n.fromParts(c, void 0, void 0, m);
                });
            });
        }
        addDustGenerationSignature(e, n) {
            return qs(this, function*() {
                const r = e.intents?.get(1);
                if (!r) return yield* st(new o_({
                    message: "No intent found in the transaction intents with segment = 1"
                }));
                const { dustActions: s, guaranteedUnshieldedOffer: i, fallibleUnshieldedOffer: o } = r;
                if (!s) return yield* st(new o_({
                    message: "No dustActions found in intent"
                }));
                if (!i) return yield* st(new o_({
                    message: "No guaranteedUnshieldedOffer found in intent"
                }));
                const [a, ...c] = s.registrations;
                return a ? yield* L_(()=>{
                    const l = new _d(n), u = new Ql(l.instance, a.nightKey, a.dustAddress, a.allowFeePayment, l), d = new Oa(l.instance, vh.preProof, s.ctime, s.spends, [
                        u,
                        ...c
                    ]), f = Zr.deserialize(l.instance, vh.preProof, QL.preBinding, r.serialize());
                    f.dustActions = d;
                    const p = i.inputs.length, h = [];
                    for(let w = 0; w < p; ++w)h.push(i.signatures.at(w) ?? n);
                    if (f.guaranteedUnshieldedOffer = i.addSignatures(h), o) {
                        const w = o.inputs.length, v = [];
                        for(let k = 0; k < w; ++k)v.push(o.signatures.at(k) ?? n);
                        f.fallibleUnshieldedOffer = o.addSignatures(v);
                    }
                    const m = _n.deserialize(l.instance, vh.preProof, QL.preBinding, e.serialize());
                    return m.intents = m.intents.set(1, f), m;
                }) : yield* st(new o_({
                    message: "No registrations found in dustActions"
                }));
            });
        }
        calculateFee(e, n) {
            return e.feesWithMargin(n, this.costParams.feeBlocksMargin) + (this.costParams.additionalFeeOverhead ?? 0n);
        }
        dryRunFee(e, n, r, s, i, o, a) {
            const c = this.networkId, [l] = wo.spendCoins(s, r, e, o), u = Zr.new(i);
            u.dustActions = new Oa(a_.signature, vh.preProof, o, [
                ...l
            ], []);
            const f = _n.fromPartsRandomized(c, void 0, void 0, u).eraseProofs(), p = n.reduce((h, m)=>h.merge(m.eraseProofs()), f);
            return this.calculateFee(p, a);
        }
        static feeImbalance(e, n) {
            const [r, s] = e.imbalances(0, n).entries().find(([i, o])=>i.tag === "dust") ?? [];
            return s ?? 0n;
        }
        computeBalancingRecipe(e, n, r, s, i, o) {
            const a = r.reduce((l, u)=>l + EP.feeImbalance(u, this.calculateFee(u, o)), 0n), c = this.getCoins().getAvailableCoinsWithGeneratedDust(n, i);
            return V(aIe({
                currentFee: a,
                recipeInputs: [],
                converged: !1
            }, {
                while: (l)=>!l.converged,
                body: ({ currentFee: l })=>Io({
                        try: ()=>{
                            const d = b2({
                                coins: c.map((h)=>({
                                        type: "dust",
                                        value: h.value,
                                        token: h.token
                                    })),
                                initialImbalances: Es.fromEntry("dust", l),
                                feeTokenType: "dust",
                                transactionCostModel: {
                                    inputFeeOverhead: 0n,
                                    outputFeeOverhead: 0n
                                },
                                createOutput: (h)=>h,
                                isCoinEqual: (h, m)=>h.type === m.type && h.value === m.value
                            }).inputs.map((h)=>({
                                    token: h.token,
                                    value: h.value
                                })), f = this.dryRunFee(d, r, e, n, s, i, o), p = d.reduce((h, m)=>h + m.value, 0n);
                            return {
                                currentFee: f,
                                recipeInputs: d,
                                converged: f <= p
                            };
                        },
                        catch: (u)=>u instanceof jm ? new ait({
                                message: u.message,
                                tokenType: u.tokenType
                            }) : new fu({
                                message: u instanceof Error ? u.message : "Dust balancing failed",
                                cause: u
                            })
                    })
            }), yf, Xi, Qs(({ currentFee: l, recipeInputs: u })=>({
                    fee: l,
                    recipeInputs: Iit(u, l)
                })));
        }
        estimateFee(e, n, r, s, i, o) {
            return V(this.computeBalancingRecipe(e, n, r, s, i, o), Qs(({ fee: a })=>a));
        }
        balanceTransactions(e, n, r, s, i, o) {
            const a = this.networkId;
            return V(this.computeBalancingRecipe(e, n, r, s, i, o), _g(({ recipeInputs: c })=>L_(()=>{
                    const l = Zr.new(s), [u, d] = wo.spendCoins(n, e, c, i);
                    return l.dustActions = new Oa(a_.signature, vh.preProof, i, [
                        ...u
                    ], []), [
                        _n.fromPartsRandomized(a, void 0, void 0, l),
                        d
                    ];
                })));
        }
        revertTransaction(e, n) {
            return yo({
                try: ()=>wo.revertTransaction(e, n),
                catch: (r)=>new fu({
                        message: `Error while reverting transaction ${n.identifiers().at(0)}`,
                        cause: r
                    })
            });
        }
    }
    class vl {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withDefaultTransactionType().withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withTransactionType() {
            return new vl({
                ...this.#e,
                transactingCapability: void 0
            });
        }
        withDefaultTransactionType() {
            return this.withTransactionType();
        }
        withSyncDefaults() {
            return this.withSync(_it, vit);
        }
        withSync(e, n) {
            return new vl({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(hit);
        }
        withSerialization(e) {
            return new vl({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(Eit);
        }
        withTransacting(e) {
            return new vl({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new vl({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>kit);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(Cit);
        }
        withCoinsAndBalances(e) {
            return new vl({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(Sit);
        }
        withKeys(e) {
            return new vl({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e);
            return {
                __polyTag__: Ea,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                start (r) {
                    return or(function*() {
                        const s = yield* Ha;
                        return new uit(s, r, n);
                    });
                },
                migrateState (r) {
                    return Zt(r);
                },
                deserializeState: (r)=>n.serializationCapability.deserialize(null, r)
            };
        }
        #t(e) {
            if (!Ait(this.#e)) throw new Error("Not all components are configured in V1 Builder");
            const { syncCapability: n, syncService: r, transactingCapability: s, serializationCapability: i, coinSelection: o, coinsAndBalancesCapability: a, keysCapability: c } = this.#e, l = ()=>u, u = {
                serializationCapability: i(e, l),
                syncCapability: n(e, l),
                syncService: r(e, l),
                transactingCapability: s(e, l),
                coinsAndBalancesCapability: a(e, l),
                keysCapability: c(e, l),
                coinSelection: o(e, l)
            };
            return u;
        }
    }
    const Ait = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability"
        ].every((n)=>typeof t[n] == "function");
    class IP {
        static mapState = (e)=>(n)=>new IP(n, e);
        protocolVersion;
        state;
        capabilities;
        get totalCoins() {
            return this.capabilities.coinsAndBalances.getTotalCoins(this.state);
        }
        get availableCoins() {
            return this.capabilities.coinsAndBalances.getAvailableCoins(this.state);
        }
        get pendingCoins() {
            return this.capabilities.coinsAndBalances.getPendingCoins(this.state);
        }
        get publicKey() {
            return this.capabilities.keys.getPublicKey(this.state);
        }
        get address() {
            return this.capabilities.keys.getAddress(this.state);
        }
        get progress() {
            return this.state.progress;
        }
        get transactionHistory() {
            throw new Error("Transaction history is not yet implemented for DustWallet");
        }
        constructor(e, n){
            this.protocolVersion = e.version, this.state = e.state, this.capabilities = n;
        }
        balance(e) {
            return this.capabilities.coinsAndBalances.getWalletBalance(this.state, e);
        }
        availableCoinsWithFullInfo(e) {
            return this.capabilities.coinsAndBalances.getAvailableCoinsWithFullInfo(this.state, e);
        }
        estimateDustGeneration(e, n) {
            return this.capabilities.coinsAndBalances.estimateDustGeneration(this.state, e, n);
        }
        serialize() {
            return this.capabilities.serialization.serialize(this.state);
        }
    }
    function Lx(t) {
        const e = ig.init().withVariant(Tp, new vl().withDefaults()).build(t);
        return class yl extends e {
            static startWithSeed(r, s) {
                const i = Va.fromSeed(r);
                return yl.startFirst(yl, wo.initEmpty(s, i, t.networkId));
            }
            static startWithSecretKey(r, s) {
                return yl.startFirst(yl, wo.initEmpty(s, r, t.networkId));
            }
            static restore(r) {
                const s = yl.allVariantsRecord()[Ea].variant.deserializeState(r).pipe(ov);
                return yl.startFirst(yl, s);
            }
            state;
            constructor(r, s){
                super(r, s), this.state = this.rawState.pipe(ve(IP.mapState(yl.allVariantsRecord()[Ea].variant)), U3({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start(r) {
                return this.runtime.dispatch({
                    [Ea]: (s)=>s.startSyncInBackground(r)
                }).pipe(Cn);
            }
            async createDustGenerationTransaction(r, s, i, o, a) {
                return this.runtime.dispatch({
                    [Ea]: (c)=>c.createDustGenerationTransaction(r, s, i, o, a)
                }).pipe(Cn);
            }
            addDustGenerationSignature(r, s) {
                return this.runtime.dispatch({
                    [Ea]: (i)=>i.addDustGenerationSignature(r, s)
                }).pipe(Cn);
            }
            calculateFee(r) {
                return this.runtime.dispatch({
                    [Ea]: (s)=>s.calculateFee(r)
                }).pipe(Cn);
            }
            estimateFee(r, s, i, o) {
                const a = i ?? new Date(Date.now() + 36e5);
                return this.runtime.dispatch({
                    [Ea]: (c)=>c.estimateFee(r, s, a, o)
                }).pipe(Cn);
            }
            balanceTransactions(r, s, i, o) {
                return this.runtime.dispatch({
                    [Ea]: (a)=>a.balanceTransactions(r, s, i, o)
                }).pipe(Cn);
            }
            revertTransaction(r) {
                return this.runtime.dispatch({
                    [Ea]: (s)=>s.revertTransaction(r)
                }).pipe(Cn);
            }
            waitForSyncedState(r = 0n) {
                return Dn(this.state.pipe(vu((s)=>s.state.progress.isCompleteWithin(r))));
            }
            serializeState() {
                return Dn(this.state).then((r)=>r.serialize());
            }
            getAddress() {
                return Dn(this.state).then((r)=>r.address);
            }
        };
    }
    function Pit(t, e) {
        const n = new URL("/prove", t), r = new URL("/check", t), s = async (i, o)=>{
            const a = await fetch(i.toString(), {
                method: "POST",
                body: o,
                headers: {
                    "Content-Type": "application/octet-stream",
                    ...e
                }
            });
            if (!a.ok) throw new Error(`Proof server error: ${a.status}`);
            return new Uint8Array(await a.arrayBuffer());
        };
        return {
            async prove (i, o, a) {
                const c = XT(i, a);
                return s(n, c);
            },
            async check (i, o) {
                const a = KT(i), c = await s(r, a);
                return $T(c);
            }
        };
    }
    function zx(t) {
        switch(t.mode){
            case "proofstation":
                {
                    const e = {};
                    t.apiKey && (e["X-API-Key"] = t.apiKey), t.clientId && (e["X-Client-ID"] = t.clientId);
                    const n = Pit(t.url, e), r = DFe(n);
                    return {
                        prove (s) {
                            return Cn(r.prove(s));
                        }
                    };
                }
            case "wasm":
                return UFe({});
            case "local":
            case "custom":
            default:
                return zFe({
                    provingServerUrl: new URL(t.url)
                });
        }
    }
    xn = function(...t) {
        return Oie(oH(t));
    };
    const jb = (t, e)=>({
            indexerUrl: t.indexerWsUrl,
            networkId: t.networkId,
            costParameters: {
                additionalFeeOverhead: 300000000000000n,
                feeBlocksMargin: 5
            },
            indexerClientConnection: {
                indexerHttpUrl: t.indexerHttpUrl,
                indexerWsUrl: t.indexerWsUrl
            },
            txHistoryStorage: e ?? new id
        }), Oit = (t, e)=>t ? typeof t.environment == "string" ? t.environment === e : !0 : !1;
    let X1 = "0:0";
    let c_, ez, AP, Hh, gf, tz, Mit;
    c_ = (t, e)=>{
        X1 = `${t}:${e}`;
    };
    ez = ()=>X1;
    AP = (t, e)=>`${t}:${e}`;
    Hh = (t)=>AP(t, X1);
    gf = async (t)=>{
        await zt.setItem(Hh("local:txHistoryCache"), t);
    };
    tz = async ()=>{
        const t = await zt.getItem(Hh("local:txHistoryCache"));
        if (!t) return null;
        try {
            return id.fromSerialized(t);
        } catch  {
            return null;
        }
    };
    Mit = (t)=>new Uint8Array(Buffer.from(t, "base64"));
    zQ = (t)=>{
        const e = xne(t);
        return Buffer.from(e).toString("base64");
    };
    let My = null, Ry = null;
    const Rit = 1e3, Nit = 6e4;
    async function Vit() {
        const t = await zt.getItem("local:unlockFailCount") ?? 0, e = await zt.getItem("local:unlockLockedUntil") ?? 0;
        return {
            failCount: t,
            lockedUntil: e
        };
    }
    async function nz(t, e) {
        await zt.setItem("local:unlockFailCount", t), await zt.setItem("local:unlockLockedUntil", e);
    }
    let Qp, y9;
    Dit = async ()=>(await zt.getItem("local:encryptedVault"))?.version === 2 ? "locked" : "none";
    Qp = async (t)=>{
        await zt.setItem("local:encryptedVault", t);
    };
    y9 = async ()=>await zt.getItem("local:encryptedVault");
    g2t = async (t, e)=>{
        const n = await vne(t, e);
        await Qp(n);
    };
    sT = async (t)=>{
        const { failCount: e, lockedUntil: n } = await Vit(), r = Date.now();
        if (r < n) {
            const a = Math.ceil((n - r) / 1e3);
            throw new Error(`Too many failed attempts. Try again in ${a}s`);
        }
        const s = await y9();
        if (!s) throw new Error("No encrypted vault found");
        let i, o;
        try {
            ({ contents: i, key: o } = await wne(t, s));
        } catch  {
            const a = e + 1, c = Math.min(Rit * Math.pow(2, a - 1), Nit);
            throw await nz(a, Date.now() + c), new Error("Wrong password");
        }
        return await nz(0, 0), {
            contents: i,
            key: o,
            salt: s.salt
        };
    };
    let rz = !1;
    async function Bit() {
        if (!rz) {
            rz = !0;
            try {
                indexedDB.deleteDatabase("1am-session");
            } catch  {}
        }
    }
    let ji, PP, Lit, Nh;
    Fit = async (t, e)=>{
        My = t, Ry = e;
        const n = await _ne(t);
        await zt.setItem("session:vaultKeyBytes", n), await zt.setItem("session:vaultSalt", e), Bit();
    };
    ji = ()=>!My || !Ry ? null : {
            key: My,
            salt: Ry
        };
    PP = async ()=>{
        My = null, Ry = null, await zt.removeItem("session:vaultKeyBytes"), await zt.removeItem("session:vaultSalt");
    };
    Lit = async ()=>{
        try {
            return await zt.getItem("session:vaultKeyBytes") != null;
        } catch  {
            return !1;
        }
    };
    Nh = async ()=>{
        let t = ji();
        if (!t) {
            const n = await zt.getItem("session:vaultKeyBytes"), r = await zt.getItem("session:vaultSalt");
            if (n && r) {
                const s = await Sne(n, !0);
                My = s, Ry = r, t = {
                    key: s,
                    salt: r
                };
            }
        }
        if (!t) return null;
        const e = await y9();
        if (!e) return null;
        try {
            let n;
            if (e.version >= 2) {
                const s = CT(e.salt), i = new Uint8Array(1 + s.length);
                i[0] = e.version, i.set(s, 1), n = i;
            }
            const r = await ET(t.key, e.ciphertext, e.iv, n);
            return JSON.parse(r);
        } catch  {
            return PP(), null;
        }
    };
    let ha = Promise.resolve();
    const fm = async (t)=>{
        const e = ha;
        let n = ()=>{};
        ha = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ji();
            if (!r) throw new Error("Wallet is locked");
            const s = await y9();
            if (!s) throw new Error("No vault found");
            let i;
            if (s.version >= 2) {
                const l = CT(s.salt), u = new Uint8Array(1 + l.length);
                u[0] = s.version, u.set(l, 1), i = u;
            }
            const o = await ET(r.key, s.ciphertext, s.iv, i), a = JSON.parse(o);
            a.walletState = t;
            const c = await pg(r.key, r.salt, a);
            await Qp(c);
        } finally{
            n();
        }
    };
    function UQ(t) {
        if (!t || typeof t != "object") return !1;
        const e = t;
        return typeof e.id == "string" && (e.txHash === void 0 || typeof e.txHash == "string") && (e.txIdentifiers === void 0 || Array.isArray(e.txIdentifiers) && e.txIdentifiers.every((n)=>typeof n == "string")) && (e.type === "send" || e.type === "receive" || e.type === "dust_generation" || e.type === "dapp") && (e.chain === void 0 || e.chain === "midnight" || e.chain === "cardano") && typeof e.amount == "string" && typeof e.tokenType == "string" && (e.recipientAddress === void 0 || typeof e.recipientAddress == "string") && (e.status === "submitting" || e.status === "pending" || e.status === "confirmed" || e.status === "failed") && typeof e.createdAt == "number" && Number.isFinite(e.createdAt) && (e.error === void 0 || typeof e.error == "string");
    }
    let zit, qb, Uit, G1, Z1, HQ, Hit, jit, sz, qit, Wit, Kit, $it, Xit, iz, oz, Git, w9;
    zit = async ()=>{
        await zt.removeItem("local:encryptedVault"), await zt.removeItem("local:wallet"), await zt.removeItem("local:nightExternalKey"), await zt.removeItem("local:zswapKeys"), await zt.removeItem("local:dustKeys"), await zt.removeItem("local:environmentSettings"), await zt.removeItem("local:pendingTransactions"), await zt.removeItem("local:walletMetadata"), await zt.removeItem("local:unlockFailCount");
        try {
            const t = await zt.snapshot("local");
            for (const n of Object.keys(t))(n.startsWith("txHistoryCache") || n.startsWith("pendingTransactions")) && await zt.removeItem(`local:${n}`);
            const e = await zt.snapshot("session");
            for (const n of Object.keys(e))n.length > 0 && await zt.removeItem(`session:${n}`);
        } catch  {}
        await zt.removeItem("local:unlockLockedUntil"), await PP();
    };
    qb = {
        wallets: [
            {
                id: 0,
                name: "Wallet 1",
                accounts: [
                    {
                        index: 0,
                        name: "Account 1"
                    }
                ],
                activeAccountIndex: 0,
                nextAccountIndex: 1
            }
        ],
        activeId: 0,
        nextId: 1,
        walletKind: "password"
    };
    Uit = (t)=>{
        if (!t) return {
            ...qb,
            wallets: [
                ...qb.wallets
            ]
        };
        const e = t.walletKind ?? "password";
        return {
            ...t,
            wallets: Array.isArray(t.wallets) ? t.wallets : [
                ...qb.wallets
            ],
            activeId: typeof t.activeId == "number" ? t.activeId : qb.activeId,
            nextId: typeof t.nextId == "number" ? t.nextId : qb.nextId,
            walletKind: e,
            socialAuth: e === "social-web3auth" ? t.socialAuth : void 0
        };
    };
    zi = async ()=>{
        const t = await zt.getItem("local:walletMetadata"), e = Uit(t);
        return (!t || t.walletKind !== e.walletKind || t.socialAuth !== e.socialAuth) && await zt.setItem("local:walletMetadata", e), e;
    };
    fc = async (t)=>{
        await zt.setItem("local:walletMetadata", t);
    };
    G1 = async ()=>{
        const t = ji();
        if (!t) throw new Error("Wallet is locked");
        const e = await y9();
        if (!e) throw new Error("No vault found");
        let n;
        if (e.version >= 2) {
            const s = CT(e.salt), i = new Uint8Array(1 + s.length);
            i[0] = e.version, i.set(s, 1), n = i;
        }
        const r = await ET(t.key, e.ciphertext, e.iv, n);
        return JSON.parse(r);
    };
    Z1 = (t)=>{
        t.wallets || (t.wallets = [
            {
                id: 0,
                seed: t.seed,
                mnemonic: t.mnemonic
            }
        ]);
    };
    HQ = async (t, e, n)=>{
        const r = ha;
        let s;
        ha = new Promise((i)=>{
            s = i;
        });
        try {
            await r;
            const i = ji();
            if (!i) throw new Error("Wallet is locked");
            const o = await G1();
            Z1(o);
            const a = o.wallets.find((f)=>f.id === t);
            if (!a) throw new Error(`Wallet ${t} not found in vault`);
            if (n != null && o.walletState) {
                a.accountStates || (a.accountStates = {}), a.accountStates[String(n)] = o.walletState;
                const f = new Set;
                try {
                    const m = (await chrome.storage.local.get("walletMetadata")).walletMetadata?.wallets?.find((w)=>w.id === t);
                    if (m) for (const w of m.accounts)f.add(String(w.index));
                } catch  {}
                if (f.size > 0) for (const p of Object.keys(a.accountStates))f.has(p) || delete a.accountStates[p];
            }
            const c = jQ(a.seed, e);
            o.seed = a.seed, o.mnemonic = a.mnemonic, o.nightExternalKey = Buffer.from(c.nightExternalKey).toString("base64"), o.zswapKeys = Buffer.from(c.zswapKeys).toString("base64"), o.dustKeys = Buffer.from(c.dustKeys).toString("base64");
            const l = a.accountStates?.[String(e)], u = o.walletState?.environment ?? l?.environment;
            l && u && l.environment === u ? o.walletState = l : o.walletState = void 0;
            const d = await pg(i.key, i.salt, o);
            return await Qp(d), o;
        } finally{
            s();
        }
    };
    Hit = async (t, e)=>{
        const n = ha;
        let r;
        ha = new Promise((s)=>{
            r = s;
        });
        try {
            await n;
            const s = ji();
            if (!s) return;
            const i = await G1();
            if (Z1(i), !i.walletState) return;
            const o = i.wallets.find((c)=>c.id === t);
            if (!o) return;
            o.accountStates || (o.accountStates = {}), o.accountStates[String(e)] = i.walletState;
            const a = await pg(s.key, s.salt, i);
            await Qp(a);
        } finally{
            r();
        }
    };
    jit = async (t, e = 0)=>HQ(t, e);
    sz = async (t, e, n)=>HQ(t, e, n);
    qit = async (t, e, n)=>{
        const r = ha;
        let s;
        ha = new Promise((i)=>{
            s = i;
        });
        try {
            await r;
            const i = ji();
            if (!i) throw new Error("Wallet is locked");
            const o = await G1();
            Z1(o), o.wallets.push({
                id: t,
                seed: e,
                mnemonic: n
            });
            const a = jQ(e, 0);
            o.seed = e, o.mnemonic = n, o.nightExternalKey = Buffer.from(a.nightExternalKey).toString("base64"), o.zswapKeys = Buffer.from(a.zswapKeys).toString("base64"), o.dustKeys = Buffer.from(a.dustKeys).toString("base64"), o.walletState = void 0;
            const c = await pg(i.key, i.salt, o);
            return await Qp(c), o;
        } finally{
            s();
        }
    };
    Wit = async (t)=>{
        const e = ha;
        let n;
        ha = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ji();
            if (!r) throw new Error("Wallet is locked");
            const s = await G1();
            Z1(s), s.wallets = s.wallets.filter((o)=>o.id !== t);
            const i = await pg(r.key, r.salt, s);
            await Qp(i);
        } finally{
            n();
        }
    };
    Kit = async (t)=>{
        const e = ha;
        let n;
        ha = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ji();
            if (!r) throw new Error("Wallet is locked");
            const s = await G1();
            t(s);
            const i = await pg(r.key, r.salt, s);
            await Qp(i);
        } finally{
            n();
        }
    };
    $it = async (t, e, n, r, s)=>{
        const i = {
            configuration: {
                ...e,
                relayURL: new URL(n),
                ...s?.mode !== "wasm" && s?.mode !== "proofstation" ? {
                    provingServerUrl: new URL(r)
                } : {}
            },
            shielded: (a)=>Fx(a).restore(t.serializedShieldedWalletState),
            unshielded: (a)=>Bx(a).restore(t.serializedUnshieldedWalletState),
            dust: (a)=>Lx(a).restore(t.serializedDustWalletState)
        };
        return s && (s.mode === "proofstation" || s.mode === "wasm") && (i.provingService = ()=>zx(s)), await Bl.init(i);
    };
    Xit = async (t, e, n, r, s, i)=>{
        const o = Yl(e, n.networkId), a = {
            configuration: {
                ...n,
                relayURL: new URL(r),
                ...i?.mode !== "wasm" && i?.mode !== "proofstation" ? {
                    provingServerUrl: new URL(s)
                } : {}
            },
            shielded: (c)=>Fx(c).restore(t.serializedShieldedWalletState),
            unshielded: async (c)=>Bx(c).startWithPublicKey(kP.fromKeyStore(o)),
            dust: (c)=>Lx(c).restore(t.serializedDustWalletState)
        };
        return i && (i.mode === "proofstation" || i.mode === "wasm") && (a.provingService = ()=>zx(i)), await Bl.init(a);
    };
    jQ = (t, e)=>{
        const n = Mit(t), r = LT.fromSeed(n);
        if (r.type !== "seedOk") throw new Error("Failed to initialize HDWallet");
        const s = r.hdWallet.selectAccount(e).selectRoles([
            ph.Zswap,
            ph.NightExternal,
            ph.Dust
        ]).deriveKeysAt(0);
        if (s.type !== "keysDerived") throw new Error("Failed to derive keys");
        return r.hdWallet.clear(), {
            zswapKeys: s.keys[ph.Zswap],
            dustKeys: s.keys[ph.Dust],
            nightExternalKey: s.keys[ph.NightExternal]
        };
    };
    iz = async (t, e, n, r, s)=>{
        const i = new Uint8Array(Buffer.from(t.zswapKeys, "base64")), o = new Uint8Array(Buffer.from(t.dustKeys, "base64")), a = new Uint8Array(Buffer.from(t.nightExternalKey, "base64")), c = qi.fromSeed(i), l = Va.fromSeed(o), u = Yl(a, e.networkId), d = t.walletState, f = d?.environment;
        if (Oit(d, e.networkId)) {
            const m = {
                configuration: {
                    ...e,
                    relayURL: new URL(n),
                    ...s?.mode !== "wasm" && s?.mode !== "proofstation" ? {
                        provingServerUrl: new URL(r)
                    } : {}
                },
                shielded: (w)=>Fx(w).restore(t.walletState.serializedShieldedWalletState),
                unshielded: (w)=>Bx(w).restore(t.walletState.serializedUnshieldedWalletState),
                dust: (w)=>Lx(w).restore(t.walletState.serializedDustWalletState)
            };
            s && (s.mode === "proofstation" || s.mode === "wasm") && (m.provingService = ()=>zx(s));
            try {
                return {
                    wallet: await Bl.init(m),
                    dustSecretKey: l,
                    zswapSecretKeys: c,
                    nightExternalKeyBytes: a
                };
            } catch (w) {
                console.warn("[1AM] Wallet state restore failed — falling back to fresh sync", w), t.walletState = void 0;
                try {
                    await fm(void 0);
                } catch  {}
            }
        } else d && console.warn(`[1AM] Ignoring wallet state from ${f ?? "unknown network"} on ${e.networkId}`);
        const p = {
            configuration: {
                ...e,
                relayURL: new URL(n),
                ...s?.mode !== "wasm" && s?.mode !== "proofstation" ? {
                    provingServerUrl: new URL(r)
                } : {}
            },
            shielded: (m)=>Fx(m).startWithSecretKeys(c),
            unshielded: async (m)=>Bx(m).startWithPublicKey(kP.fromKeyStore(u)),
            dust: (m)=>Lx(m).startWithSecretKey(l, wi.initialParameters().dust)
        };
        return s && (s.mode === "proofstation" || s.mode === "wasm") && (p.provingService = ()=>zx(s)), {
            wallet: await Bl.init(p),
            dustSecretKey: l,
            zswapSecretKeys: c,
            nightExternalKeyBytes: a
        };
    };
    oz = async (t, e = X1)=>{
        const n = t ? `:${t}` : "", r = await zt.getItem(AP(`local:pendingTransactions${n}`, e));
        return Array.isArray(r) ? r.filter(UQ) : [];
    };
    Git = async (t, e, n = X1)=>{
        const r = e ? `:${e}` : "";
        await zt.setItem(AP(`local:pendingTransactions${r}`, n), t.filter(UQ));
    };
    w9 = aH("inline-flex items-center justify-center gap-8px whitespace-nowrap rounded-md type-text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-[1px] focus-visible:ring-ring focus-visible:ring-offset-[1px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
        variants: {
            variant: {
                default: "bg-primary text-primary-foreground hover:bg-primary/90",
                destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
                outline: "border border-input hover:bg-accent hover:text-accent-foreground",
                secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
                ghost: "hover:bg-accent hover:text-accent-foreground",
                link: "text-primary underline-offset-4 hover:underline",
                submit: "w-full border border-bg-primary-solid bg-bg-primary-solid text-fg-white rounded-none type-text-md font-semibold uppercase hover:opacity-90 disabled:bg-bg-disabled disabled:border-bg-quaternary disabled:text-fg-disabled disabled:hover:opacity-100 data-[disabled]:cursor-not-allowed"
            },
            size: {
                default: "h-10 px-16px py-8px",
                sm: "h-9 px-12px type-text-xs",
                lg: "h-11 px-12px2px",
                submit: "h-11 gap-1.5",
                icon: "size-10"
            }
        },
        defaultVariants: {
            variant: "default",
            size: "default"
        }
    });
    $r = (t)=>{
        const [e, n] = rt(t, [
            "variant",
            "size",
            "class",
            "label"
        ]), r = e.label;
        return I(jc, qe({
            get class () {
                return xn(w9({
                    variant: e.variant,
                    size: e.size
                }), e.class);
            }
        }, r && {
            title: r,
            "aria-label": r
        }, n));
    };
    $s = function(t) {
        return (e)=>(t(e), ()=>t(void 0));
    };
    qQ = [
        "id",
        "name",
        "validationState",
        "required",
        "disabled",
        "readOnly"
    ];
    WQ = function(t) {
        const e = `form-control-${ii()}`, n = qt({
            id: e
        }, t), [r, s] = pe(), [i, o] = pe(), [a, c] = pe(), [l, u] = pe(), d = (m, w, v)=>{
            const k = v != null || r() != null;
            return [
                v,
                r(),
                k && w != null ? m : void 0
            ].filter(Boolean).join(" ") || void 0;
        }, f = (m)=>[
                a(),
                l(),
                m
            ].filter(Boolean).join(" ") || void 0, p = Ct(()=>({
                "data-valid": Ae(n.validationState) === "valid" ? "" : void 0,
                "data-invalid": Ae(n.validationState) === "invalid" ? "" : void 0,
                "data-required": Ae(n.required) ? "" : void 0,
                "data-disabled": Ae(n.disabled) ? "" : void 0,
                "data-readonly": Ae(n.readOnly) ? "" : void 0
            }));
        return {
            formControlContext: {
                name: ()=>Ae(n.name) ?? Ae(n.id),
                dataset: p,
                validationState: ()=>Ae(n.validationState),
                isRequired: ()=>Ae(n.required),
                isDisabled: ()=>Ae(n.disabled),
                isReadOnly: ()=>Ae(n.readOnly),
                labelId: r,
                fieldId: i,
                descriptionId: a,
                errorMessageId: l,
                getAriaLabelledBy: d,
                getAriaDescribedBy: f,
                generateId: gu(()=>Ae(n.id)),
                registerLabel: $s(s),
                registerField: $s(o),
                registerDescription: $s(c),
                registerErrorMessage: $s(u)
            }
        };
    };
    OP = ds();
    Zd = function() {
        const t = fs(OP);
        if (t === void 0) throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");
        return t;
    };
    _9 = function(t) {
        const e = Zd(), n = qt({
            id: e.generateId("description")
        }, t);
        return lt(()=>It(e.registerDescription(n.id))), I(yn, qe({
            as: "div"
        }, ()=>e.dataset(), n));
    };
    x9 = function(t) {
        let e;
        const n = Zd(), r = qt({
            id: n.generateId("label")
        }, t), [s, i] = rt(r, [
            "ref"
        ]), o = Zx(()=>e, ()=>"label");
        return lt(()=>It(n.registerLabel(i.id))), I(yn, qe({
            as: "label",
            ref (a) {
                var c = yr((l)=>e = l, s.ref);
                typeof c == "function" && c(a);
            },
            get for () {
                return Ze(()=>o() === "label")() ? n.fieldId() : void 0;
            }
        }, ()=>n.dataset(), i));
    };
    KQ = function(t, e) {
        lt(Ji(t, (n)=>{
            if (n == null) return;
            const r = Zit(n);
            r != null && (r.addEventListener("reset", e, {
                passive: !0
            }), It(()=>{
                r.removeEventListener("reset", e);
            }));
        }));
    };
    function Zit(t) {
        return Jit(t) ? t.form : t.closest("form");
    }
    function Jit(t) {
        return t.matches("textarea, input, select, button");
    }
    v9 = function(t) {
        const e = Zd(), n = qt({
            id: e.generateId("error-message")
        }, t), [r, s] = rt(n, [
            "forceMount"
        ]), i = ()=>e.validationState() === "invalid";
        return lt(()=>{
            i() && It(e.registerErrorMessage(s.id));
        }), I(de, {
            get when () {
                return r.forceMount || i();
            },
            get children () {
                return I(yn, qe({
                    as: "div"
                }, ()=>e.dataset(), s));
            }
        });
    };
    eh = function(t) {
        const [e, n] = pe(t.defaultValue?.()), r = Ct(()=>t.value?.() !== void 0), s = Ct(()=>r() ? t.value?.() : e());
        return [
            s,
            (o)=>{
                ST(()=>{
                    const a = use(o, s());
                    return Object.is(a, s()) || (r() || n(a), t.onChange?.(a)), a;
                });
            }
        ];
    };
    function $Q(t) {
        const [e, n] = eh(t);
        return [
            ()=>e() ?? !1,
            n
        ];
    }
    function Yit(t) {
        const [e, n] = eh(t);
        return [
            ()=>e() ?? [],
            n
        ];
    }
    let Js, Qit, eot, XQ;
    Js = (t)=>typeof t == "function" ? t() : t;
    Qit = (t)=>{
        const e = Ct(()=>{
            const o = Js(t.element);
            if (o) return getComputedStyle(o);
        }), n = ()=>e()?.animationName ?? "none", [r, s] = pe(Js(t.show) ? "present" : "hidden");
        let i = "none";
        return lt((o)=>{
            const a = Js(t.show);
            return ST(()=>{
                if (o === a) return a;
                const c = i, l = n();
                a ? s("present") : l === "none" || e()?.display === "none" ? s("hidden") : s(o === !0 && c !== l ? "hiding" : "hidden");
            }), a;
        }), lt(()=>{
            const o = Js(t.element);
            if (!o) return;
            const a = (l)=>{
                l.target === o && (i = n());
            }, c = (l)=>{
                const d = n().includes(l.animationName);
                l.target === o && d && r() === "hiding" && s("hidden");
            };
            o.addEventListener("animationstart", a), o.addEventListener("animationcancel", c), o.addEventListener("animationend", c), It(()=>{
                o.removeEventListener("animationstart", a), o.removeEventListener("animationcancel", c), o.removeEventListener("animationend", c);
            });
        }), {
            present: ()=>r() === "present" || r() === "hiding",
            state: r,
            setState: s
        };
    };
    eot = Qit;
    Ny = eot;
    XQ = [
        "id",
        "aria-label",
        "aria-labelledby",
        "aria-describedby"
    ];
    function GQ(t) {
        const e = Zd(), n = qt({
            id: e.generateId("field")
        }, t);
        return lt(()=>It(e.registerField(Ae(n.id)))), {
            fieldProps: {
                id: ()=>Ae(n.id),
                ariaLabel: ()=>Ae(n["aria-label"]),
                ariaLabelledBy: ()=>e.getAriaLabelledBy(Ae(n.id), Ae(n["aria-label"]), Ae(n["aria-labelledby"])),
                ariaDescribedBy: ()=>e.getAriaDescribedBy(Ae(n["aria-describedby"]))
            }
        };
    }
    var tot = {};
    bu(tot, {
        Description: ()=>_9,
        ErrorMessage: ()=>v9,
        Input: ()=>RP,
        Label: ()=>x9,
        Root: ()=>NP,
        TextArea: ()=>VP,
        TextField: ()=>rot,
        useTextFieldContext: ()=>MP
    });
    var ZQ = ds();
    function MP() {
        const t = fs(ZQ);
        if (t === void 0) throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");
        return t;
    }
    function RP(t) {
        return I(JQ, qe({
            type: "text"
        }, t));
    }
    function JQ(t) {
        const e = Zd(), n = MP(), r = qt({
            id: n.generateId("input")
        }, t), [s, i, o] = rt(r, [
            "onInput"
        ], XQ), { fieldProps: a } = GQ(i);
        return I(yn, qe({
            as: "input",
            get id () {
                return a.id();
            },
            get name () {
                return e.name();
            },
            get value () {
                return n.value();
            },
            get required () {
                return e.isRequired();
            },
            get disabled () {
                return e.isDisabled();
            },
            get readonly () {
                return e.isReadOnly();
            },
            get "aria-label" () {
                return a.ariaLabel();
            },
            get "aria-labelledby" () {
                return a.ariaLabelledBy();
            },
            get "aria-describedby" () {
                return a.ariaDescribedBy();
            },
            get "aria-invalid" () {
                return e.validationState() === "invalid" || void 0;
            },
            get "aria-required" () {
                return e.isRequired() || void 0;
            },
            get "aria-disabled" () {
                return e.isDisabled() || void 0;
            },
            get "aria-readonly" () {
                return e.isReadOnly() || void 0;
            },
            get onInput () {
                return Yt([
                    s.onInput,
                    n.onInput
                ]);
            }
        }, ()=>e.dataset(), o));
    }
    function NP(t) {
        let e;
        const n = `textfield-${ii()}`, r = qt({
            id: n
        }, t), [s, i, o] = rt(r, [
            "ref",
            "value",
            "defaultValue",
            "onChange"
        ], qQ), a = s.value, [c, l] = eh({
            value: ()=>a === void 0 ? void 0 : s.value ?? "",
            defaultValue: ()=>s.defaultValue,
            onChange: (p)=>s.onChange?.(p)
        }), { formControlContext: u } = WQ(i);
        KQ(()=>e, ()=>l(s.defaultValue ?? ""));
        const d = (p)=>{
            if (u.isReadOnly() || u.isDisabled()) return;
            const h = p.target;
            l(h.value), h.value = c() ?? "";
        }, f = {
            value: c,
            generateId: gu(()=>Ae(i.id)),
            onInput: d
        };
        return I(OP.Provider, {
            value: u,
            get children () {
                return I(ZQ.Provider, {
                    value: f,
                    get children () {
                        return I(yn, qe({
                            as: "div",
                            ref (p) {
                                var h = yr((m)=>e = m, s.ref);
                                typeof h == "function" && h(p);
                            },
                            role: "group",
                            get id () {
                                return Ae(i.id);
                            }
                        }, ()=>u.dataset(), o));
                    }
                });
            }
        });
    }
    function VP(t) {
        let e;
        const n = MP(), r = qt({
            id: n.generateId("textarea")
        }, t), [s, i] = rt(r, [
            "ref",
            "autoResize",
            "submitOnEnter",
            "onKeyPress"
        ]);
        lt(Ji([
            ()=>e,
            ()=>s.autoResize,
            ()=>n.value()
        ], ([a, c])=>{
            !a || !c || not(a);
        }));
        const o = (a)=>{
            e && s.submitOnEnter && a.key === "Enter" && !a.shiftKey && e.form && (e.form.requestSubmit(), a.preventDefault());
        };
        return I(JQ, qe({
            as: "textarea",
            get "aria-multiline" () {
                return s.submitOnEnter ? "false" : void 0;
            },
            get onKeyPress () {
                return Yt([
                    s.onKeyPress,
                    o
                ]);
            },
            ref (a) {
                var c = yr((l)=>e = l, s.ref);
                typeof c == "function" && c(a);
            }
        }, i));
    }
    function not(t) {
        const e = t.style.alignSelf, n = t.style.overflow;
        "MozAppearance" in t.style || (t.style.overflow = "hidden"), t.style.alignSelf = "start", t.style.height = "auto", t.style.height = `${t.scrollHeight + (t.offsetHeight - t.clientHeight)}px`, t.style.overflow = n, t.style.alignSelf = e;
    }
    var rot = Object.assign(NP, {
        Description: _9,
        ErrorMessage: v9,
        Input: RP,
        Label: x9,
        TextArea: VP
    });
    let sot, iot, YQ, oot, aot, od, cot, iT, lot, uot, dot, fot, pot, eee, az, hot, DP;
    og = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(NP, qe({
            get class () {
                return xn("flex flex-col gap-1", e.class);
            }
        }, n));
    };
    Vy = (t)=>{
        const e = qe({
            type: "text"
        }, t), [n, r] = rt(e, [
            "type",
            "class",
            "unstyled"
        ]);
        return I(RP, qe({
            get type () {
                return n.type;
            },
            get class () {
                return xn(!n.unstyled && "flex h-[44px] w-full border border-[var(--color-grey-light-300,#D5D7DA)] bg-[var(--colors-background-bg-primary,white)] px-[14px] py-[10px] type-text-md text-[var(--color-grey-light-900,#181D27)] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[var(--color-grey-light-500,#717680)] placeholder:normal-case focus-visible:outline-none focus-visible:border-2 focus-visible:border-[#0064D6] disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-[var(--color-grey-light-50,#FAFAFA)] data-[invalid]:border-error-foreground data-[invalid]:text-error-foreground", n.class);
            }
        }, r));
    };
    sot = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(VP, qe({
            get class () {
                return xn("flex min-h-[80px] w-full border border-[var(--color-grey-light-300,#D5D7DA)] bg-[var(--colors-background-bg-primary,white)] px-[14px] py-[10px] type-text-md text-[var(--color-grey-light-900,#181D27)] placeholder:text-[var(--color-grey-light-500,#717680)] placeholder:normal-case focus-visible:outline-none focus-visible:border-2 focus-visible:border-[#0064D6] disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-[var(--color-grey-light-50,#FAFAFA)]", e.class);
            }
        }, n));
    };
    iot = aH("type-text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", {
        variants: {
            variant: {
                label: "data-[invalid]:text-destructive",
                description: "font-normal text-muted-foreground",
                error: "type-text-xs text-destructive"
            }
        },
        defaultVariants: {
            variant: "label"
        }
    });
    YQ = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(x9, qe({
            get class () {
                return xn(iot(), e.class);
            }
        }, n));
    };
    oot = {
        BASE_URL: "/",
        BROWSER: "chrome",
        CHROME: !0,
        COMMAND: "build",
        DEV: !1,
        EDGE: !1,
        ENTRYPOINT: "html",
        FIREFOX: !1,
        MANIFEST_VERSION: 3,
        MODE: "production",
        OPERA: !1,
        PROD: !0,
        SAFARI: !1,
        SSR: !1,
        WXT_WEB3AUTH_CLIENT_ID: "BDqUfHYFYr7CcFxdniI-H4RwAIWxjrgRnpr9hXbN3q58vq-SP52Fv7wGQWeeuAOYkF6sDbck39RPnAHz3jxfnjQ",
        WXT_WEB3AUTH_MFA_LEVEL: "optional",
        WXT_WEB3AUTH_NETWORK: "sapphire_mainnet"
    };
    aot = oot;
    od = (t)=>{
        const e = aot[t]?.trim();
        return e || void 0;
    };
    cot = (t)=>{
        const e = od(t)?.toLowerCase();
        if (e) {
            if (e === "true" || e === "1" || e === "yes") return !0;
            if (e === "false" || e === "0" || e === "no") return !1;
        }
    };
    iT = od("WXT_WEB3AUTH_CLIENT_ID");
    QQ = cot("WXT_SOCIAL_WALLET_ENABLED") ?? !!iT;
    lot = od("WXT_WEB3AUTH_NETWORK") ?? "sapphire_mainnet";
    uot = od("WXT_WEB3AUTH_MFA_LEVEL") ?? "optional";
    dot = {
        google: od("WXT_WEB3AUTH_GOOGLE_AUTH_CONNECTION_ID"),
        apple: od("WXT_WEB3AUTH_APPLE_AUTH_CONNECTION_ID"),
        discord: od("WXT_WEB3AUTH_DISCORD_AUTH_CONNECTION_ID"),
        x: od("WXT_WEB3AUTH_X_AUTH_CONNECTION_ID")
    };
    oT = {
        google: "Google",
        apple: "Apple",
        discord: "Discord",
        x: "X"
    };
    fot = new TextEncoder().encode("1am-social-web3auth-hkdf-v1");
    pot = (t)=>{
        const e = new Uint8Array(t.length / 2);
        for(let n = 0; n < t.length; n += 2)e[n / 2] = Number.parseInt(t.slice(n, n + 2), 16);
        return e;
    };
    eee = (t)=>{
        if (t instanceof Uint8Array) return new Uint8Array(t);
        const e = t.trim(), n = e.startsWith("0x") ? e.slice(2) : e;
        return n.length > 0 && n.length % 2 === 0 && /^[\da-fA-F]+$/.test(n) ? pot(n) : new TextEncoder().encode(e);
    };
    az = async (t, e, n)=>{
        const r = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength), s = await crypto.subtle.importKey("raw", r, "HKDF", !1, [
            "deriveBits"
        ]), i = await crypto.subtle.deriveBits({
            name: "HKDF",
            hash: "SHA-256",
            salt: fot,
            info: new TextEncoder().encode(e)
        }, s, n * 8);
        return new Uint8Array(i);
    };
    hot = async (t)=>{
        const e = eee(t);
        try {
            const n = await az(e, "1am-mnemonic-v1", 32), r = await az(e, "1am-vault-unlock-v1", 32);
            return {
                mnemonic: kne(n, IT),
                vaultUnlockKey: r
            };
        } finally{
            e.fill(0);
        }
    };
    DP = "1am-social-wallet-pending-provider";
    let f7 = null, l_ = null;
    let tee, nee, ree, got, see, bot, mot, iee;
    tee = (t)=>{
        if (t instanceof Error) {
            const e = t.cause instanceof Error ? `
Cause: ${t.cause.message}${t.cause.stack ? `
${t.cause.stack}` : ""}` : t.cause ? `
Cause: ${String(t.cause)}` : "";
            return `${t.message}${t.stack ? `
${t.stack}` : ""}${e}`;
        }
        try {
            return JSON.stringify(t);
        } catch  {
            return String(t);
        }
    };
    nee = async ()=>(f7 || (f7 = sr(()=>import("./index-CvUp9klu.js").then(async (m)=>{
                await m.__tla;
                return m;
            }).then((t)=>t.i), __vite__mapDeps([0,1,2,3,4]))), f7);
    ree = ()=>{
        if (!iT) throw new Error("Social wallets are not configured yet. Set WXT_WEB3AUTH_CLIENT_ID to enable this flow.");
        return iT;
    };
    got = ()=>{
        const t = new URL(window.location.href);
        return t.hash = "", t.toString();
    };
    see = async ()=>(l_ || (l_ = (async ()=>{
            try {
                const t = await nee(), e = new t.Auth({
                    clientId: ree(),
                    network: lot,
                    storage: "session",
                    uxMode: t.UX_MODE.REDIRECT,
                    replaceUrlOnRedirect: !0,
                    redirectUrl: got()
                });
                return await e.init(), e;
            } catch (t) {
                throw new Error(`Web3Auth init failed.
${tee(t)}`, {
                    cause: t instanceof Error ? t : void 0
                });
            }
        })().catch((t)=>{
            throw l_ = null, t;
        })), l_);
    bot = async (t)=>{
        const e = await nee();
        switch(t){
            case "google":
                return e.AUTH_CONNECTION.GOOGLE;
            case "apple":
                return e.AUTH_CONNECTION.APPLE;
            case "discord":
                return e.AUTH_CONNECTION.DISCORD;
            case "x":
                return e.AUTH_CONNECTION.TWITTER;
        }
    };
    mot = (t, e)=>t === "google" ? "google" : t === "apple" ? "apple" : t === "discord" ? "discord" : t === "twitter" ? "x" : e ?? "google";
    iee = (t, e)=>{
        const n = t.coreKitKey || t.privKey;
        if (typeof n != "string" || n.trim().length === 0) throw new Error("Web3Auth did not return a recoverable key for this session.");
        const r = t.getUserInfo(), s = mot(r.authConnection, e);
        return {
            loginProvider: s,
            userId: r.userId || r.email || oT[s],
            email: r.email,
            name: r.name,
            profileImage: r.profileImage,
            secret: eee(n)
        };
    };
    b2t = ()=>{
        const t = window.sessionStorage.getItem(DP);
        return t === "google" || t === "apple" || t === "discord" || t === "x" ? t : null;
    };
    m2t = ()=>{
        window.sessionStorage.removeItem(DP);
    };
    yot = async (t)=>{
        QQ || ree();
        const e = await see(), n = await bot(t);
        window.sessionStorage.setItem(DP, t);
        try {
            await e.login({
                authConnection: n,
                authConnectionId: dot[t],
                mfaLevel: uot
            });
        } catch (r) {
            throw new Error(`Web3Auth login failed for ${t}.
${tee(r)}`, {
                cause: r instanceof Error ? r : void 0
            });
        }
        return !e.sessionId || !e.coreKitKey && !e.privKey ? null : iee(e, t);
    };
    wot = async (t)=>{
        if (!QQ) return null;
        const e = await see();
        return !e.sessionId || !e.coreKitKey && !e.privKey ? null : iee(e, t);
    };
    _ot = async (t)=>{
        try {
            return await hot(t.secret);
        } finally{
            t.secret.fill(0);
        }
    };
    var xot = Q('<div class="min-h-screen flex flex-col bg-background"><div class="absolute inset-0 opacity-[0.08]"style="background-image:linear-gradient(color-mix(in srgb, var(--border-secondary) 72%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border-secondary) 72%, transparent) 1px, transparent 1px);background-size:40px 40px"></div><header class="relative z-10 flex-none h-20 bg-header border-b border-header-border"><div class="h-full max-w-6xl mx-auto px-6 border-x border-header-divider flex items-center justify-between"><div class="flex items-center gap-4"></div></div></header><main class="relative z-10 flex flex-1 items-center px-6"><div class="w-full max-w-6xl mx-auto self-stretch border-x border-[var(--border-secondary)] flex items-center"><div class="w-full px-0 py-8 md:py-12 -translate-y-[10%]"><div class="border-b border-[var(--border-secondary)] bg-[var(--bg-primary)]"><div class="grid border-t border-[var(--border-secondary)] border-b border-[var(--border-secondary)] md:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]"><section class="relative overflow-hidden border-b border-[var(--border-secondary)] p-8 md:border-b-0 md:border-r md:p-12"><div aria-hidden=true class="pointer-events-none absolute inset-0"style="background-image:var(--color-diagonal-pattern);opacity:calc(var(--shielded-pattern-opacity, 0.68) * 0.45)"></div><div class="relative flex flex-col gap-8"><div class="flex items-center gap-2 px-2 py-1.5 w-fit bg-[var(--bg-primary)] border-y border-[var(--border-secondary)]"><span class="w-2 h-2 rounded-full bg-[var(--fg-brand-secondary)]"></span><span class="text-[12px] md:text-sm font-medium uppercase text-content-muted">NEW WALLET SETUP</span></div><div class="max-w-2xl space-y-4"><h1 class="type-display-md md:type-display-lg font-semibold text-foreground uppercase leading-none">ENTER THE 1AM WALLET</h1><p class="max-w-xl type-text-sm md:type-text-md uppercase tracking-[0.14em] text-content-muted-dark">THE WALLET FOR MIDNIGHT NETWORK</p><p class="max-w-xl type-text-sm text-content-muted">Create a new wallet or restore an existing one inside the same product system you will use after setup.</p></div></div></section><aside class="flex flex-col justify-between bg-[var(--bg-primary)]"><div class="border-b border-[var(--border-secondary)] p-8 md:p-10"><div class=space-y-2><p class="type-text-xs uppercase tracking-[0.22em] text-content-muted-light">START HERE</p><p class="type-text-sm text-content-muted">Choose how you want to enter 1AM.</p></div></div><div class="p-8 md:p-10 space-y-3"></div></aside></div><div class="grid gap-0 md:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]"><div class="px-8 py-5 md:px-12 md:py-6 border-b md:border-b-0 md:border-r border-[var(--border-secondary)] flex items-center"><p class="text-[11px] uppercase tracking-[0.18em] text-content-muted-light">Your keys, your coins. Everything stays encrypted on your device.</p></div><div class="px-8 py-5 md:px-10 md:py-6 text-left flex items-center"><p class="w-full text-[11px] text-content-muted-light">By continuing, you agree to our <a href=https://1am.xyz/terms target=_blank rel="noopener noreferrer"class="underline transition-colors hover:text-content-muted">Terms of Service</a> and <a href=https://1am.xyz/privacy target=_blank rel="noopener noreferrer"class="underline transition-colors hover:text-content-muted">Privacy Policy'), vot = Q('<div class="flex flex-col h-full bg-background"><div class="flex-1 flex flex-col items-center justify-center gap-8 px-6"><div class="flex flex-col items-center gap-4"><p class="type-text-xs uppercase tracking-wide text-muted-foreground">THE WALLET FOR MIDNIGHT NETWORK</p></div><div class="w-full space-y-2.5"></div></div><div class="px-6 py-4 text-center"><p class="text-muted-foreground/50 text-[10px]">By continuing, you agree to our <a href=https://1am.xyz/terms target=_blank class="underline hover:text-foreground/60">Terms');
    let kot, Tot;
    Sot = (t)=>{
        const e = (n)=>{
            t.fullpage ? window.location.href = `/fullpage.html?mode=${n.mode}` : (xi.tabs.create({
                url: xi.runtime.getURL(`/fullpage.html?mode=${n.mode}`)
            }), window.close());
        };
        return I(de, {
            get when () {
                return t.fullpage;
            },
            get fallback () {
                return I(Tot, {
                    openFullPageApp: e
                });
            },
            get children () {
                return I(kot, {
                    openFullPageApp: e
                });
            }
        });
    };
    kot = (t)=>{
        const [e, n] = pe(!1);
        return ga(async ()=>{
            const s = (await Nm()).theme === "dark";
            n(s), document.documentElement.setAttribute("data-theme", s ? "dark" : "light");
        }), (()=>{
            var r = xot(), s = r.firstChild, i = s.nextSibling, o = i.firstChild, a = o.firstChild, c = i.nextSibling, l = c.firstChild, u = l.firstChild, d = u.firstChild, f = d.firstChild, p = f.firstChild;
            p.firstChild;
            var h = p.nextSibling, m = h.firstChild, w = m.nextSibling;
            return F(a, I(Vm, {
                class: "h-8 w-auto",
                animated: !0
            })), F(w, I($r, {
                onClick: ()=>t.openFullPageApp({
                        mode: "create"
                    }),
                class: "w-full h-14 rounded-none border border-bg-primary-solid bg-bg-primary-solid type-text-md font-semibold uppercase tracking-wide text-fg-white hover:opacity-90",
                children: "Create a new wallet"
            }), null), F(w, I($r, {
                variant: "secondary",
                onClick: ()=>t.openFullPageApp({
                        mode: "recover"
                    }),
                class: "w-full h-14 rounded-none border border-[var(--border-secondary)] type-text-md font-semibold uppercase tracking-wide text-fg-primary",
                children: "I already have a wallet"
            }), null), F(w, I($r, {
                variant: "secondary",
                onClick: ()=>t.openFullPageApp({
                        mode: "social"
                    }),
                class: "w-full h-14 rounded-none border border-[var(--border-secondary)] type-text-md font-semibold uppercase tracking-wide text-fg-primary",
                children: "Continue with Social Wallet"
            }), null), r;
        })();
    };
    Tot = (t)=>(()=>{
            var e = vot(), n = e.firstChild, r = n.firstChild, s = r.firstChild, i = r.nextSibling;
            return F(r, I(Vm, {
                class: "h-10 w-auto",
                animated: !0
            }), s), F(i, I($r, {
                class: "w-full h-12 rounded-none bg-foreground text-background hover:bg-foreground/90 type-text-sm font-semibold uppercase tracking-wide",
                onClick: ()=>t.openFullPageApp({
                        mode: "create"
                    }),
                children: "Create a new wallet"
            }), null), F(i, I($r, {
                variant: "outline",
                class: "w-full h-12 rounded-none type-text-sm font-semibold uppercase tracking-wide",
                onClick: ()=>t.openFullPageApp({
                        mode: "recover"
                    }),
                children: "I already have a wallet"
            }), null), F(i, I($r, {
                variant: "outline",
                class: "w-full h-12 rounded-none type-text-sm font-semibold uppercase tracking-wide",
                onClick: ()=>t.openFullPageApp({
                        mode: "social"
                    }),
                children: "Continue with Social Wallet"
            }), null), e;
        })();
    let Aa = null, n0 = [], ed = !1, u_ = 0;
    const Cot = 10;
    async function oee() {
        if (ed) return null;
        try {
            Aa = chrome.runtime.connect({
                name: Vte
            }), ed = !0, u_ = 0, Aa.onMessage.addListener((t)=>{
                if (t.type === "WALLET_STATE_UPDATE") for (const e of n0)try {
                    e(t.state);
                } catch  {}
            }), Aa.onDisconnect.addListener(()=>{
                if (ed = !1, Aa = null, u_++, u_ <= Cot && n0.length > 0) {
                    const t = Math.min(1e3 * Math.pow(2, u_ - 1), 3e4);
                    setTimeout(()=>{
                        ed || oee().catch(()=>{});
                    }, t);
                }
            });
        } catch  {
            ed = !1, Aa = null;
        }
        return Dte();
    }
    function Eot(t) {
        return n0.push(t), ()=>{
            n0 = n0.filter((e)=>e !== t);
        };
    }
    function cz(t) {
        if (!(!Aa || !ed)) try {
            Aa.postMessage({
                type: "CMD_WALLET_STATE_BROADCAST",
                state: {
                    ...t,
                    timestamp: Date.now()
                }
            });
        } catch  {
            ed = !1, Aa = null;
        }
    }
    function Iot() {
        if (Aa) {
            try {
                Aa.disconnect();
            } catch  {}
            Aa = null;
        }
        ed = !1, n0 = [];
    }
    async function Aot(t) {
        const { password: e, activeWalletId: n, trySessionUnlock: r, unlockVault: s, extractMnemonic: i } = t;
        if (e != null) {
            const { contents: a } = await s(e);
            return i(a, n);
        }
        const o = await r();
        if (!o) throw new Error("Wallet session expired. Unlock the wallet and try again.");
        return i(o, n);
    }
    function lz(t) {
        return {
            tokenType: t.tokenType,
            value: t.value.toString(),
            owner: t.owner,
            intentHash: t.intentHash,
            outputIndex: t.outputIndex
        };
    }
    function uz(t) {
        return t.map((e)=>({
                id: e.id,
                hash: e.hash,
                protocolVersion: e.protocolVersion,
                identifiers: [
                    ...e.identifiers
                ],
                timestamp: e.timestamp.getTime(),
                fees: e.fees?.toString() ?? null,
                status: e.status,
                createdUtxos: e.createdUtxos.map(lz),
                spentUtxos: e.spentUtxos.map(lz)
            }));
    }
    function Pot(t) {
        return t?.length ? t.map((e)=>({
                id: e.id,
                hash: e.hash,
                protocolVersion: e.protocolVersion,
                identifiers: [
                    ...e.identifiers
                ],
                timestamp: new Date(e.timestamp),
                fees: e.fees == null ? null : BigInt(e.fees),
                status: e.status,
                createdUtxos: e.createdUtxos.map((n)=>({
                        tokenType: n.tokenType,
                        value: BigInt(n.value),
                        owner: n.owner,
                        intentHash: n.intentHash,
                        outputIndex: n.outputIndex
                    })),
                spentUtxos: e.spentUtxos.map((n)=>({
                        tokenType: n.tokenType,
                        value: BigInt(n.value),
                        owner: n.owner,
                        intentHash: n.intentHash,
                        outputIndex: n.outputIndex
                    }))
            })) : [];
    }
    const Oot = ({ appliedId: t, highestTransactionId: e, transactions: n })=>{
        const r = n.map((a)=>Number(a.id)).filter((a)=>Number.isFinite(a) && a >= 0);
        if (r.length === 0) return Number(t ?? 0) > 0 || Number(e ?? 0) > 0 ? "no_history_entries_after_synced_progress" : null;
        const s = Math.min(...r), i = Math.max(...r), o = r.length;
        return s > 1 ? "missing_leading_history_entries" : i - s + 1 > o ? "history_id_gap_detected" : null;
    };
    function Mot(t, e) {
        let n = null, r = null;
        const s = (...i)=>{
            r = i, n && clearTimeout(n), n = setTimeout(()=>{
                n = null, t(...i);
            }, e);
        };
        return s.cancel = ()=>{
            n && clearTimeout(n), n = null, r = null;
        }, s.flush = ()=>{
            if (n) {
                if (clearTimeout(n), n = null, r) {
                    const i = t(...r);
                    return r = null, i;
                }
                r = null;
            }
        }, s;
    }
    const dz = "local:clientIdSalt";
    async function Rot() {
        const t = await zt.getItem(dz);
        if (t && /^[0-9a-f]+$/i.test(t) && t.length === 32) return Uint8Array.from(t.match(/.{1,2}/g).map((r)=>parseInt(r, 16)));
        const e = crypto.getRandomValues(new Uint8Array(16)), n = Array.from(e, (r)=>r.toString(16).padStart(2, "0")).join("");
        return await zt.setItem(dz, n), e;
    }
    async function aT(t) {
        const e = await Rot(), n = new Uint8Array(e.length + t.length);
        n.set(e, 0), n.set(t, e.length);
        const r = await crypto.subtle.digest("SHA-256", n.buffer);
        return Array.from(new Uint8Array(r)).map((s)=>s.toString(16).padStart(2, "0")).join("");
    }
    const d_ = (t, e)=>({
            mode: t.proofServerMode || "proofstation",
            url: t.proofServerUrl,
            apiKey: t.proofStationApiKey,
            clientId: e
        }), f_ = 10, aee = ds();
    let Om = !1, Z_ = [];
    let Sh, kh, Not;
    Sh = async (t = 3e4)=>Om ? t <= 0 ? !1 : new Promise((e)=>{
            const n = setTimeout(()=>{
                Z_ = Z_.filter((s)=>s !== r), e(!1);
            }, t), r = ()=>{
                clearTimeout(n), Om = !0, e(!0);
            };
            Z_.push(r);
        }) : (Om = !0, !0);
    kh = ()=>{
        const t = Z_.shift();
        t ? t() : Om = !1;
    };
    Not = (t)=>{
        const [e, n] = pe(!0), [r, s] = pe(!1), [i, o] = pe(!1), [a, c] = pe({
            shielded: {
                current: 0,
                total: 0
            },
            unshielded: {
                current: 0,
                total: 0
            },
            dust: {
                current: 0,
                total: 0
            },
            percent: 0
        }), [l, u] = pe(null);
        let d = 0, f = null;
        const p = ()=>{
            f && (clearTimeout(f), f = null);
        }, h = (ue, xe = 0n)=>{
            if (typeof ue != "string" || !/^-?\d+$/.test(ue)) return xe;
            try {
                return BigInt(ue);
            } catch  {
                return xe;
            }
        }, [m, w] = pe({
            indexer: "checking",
            rpc: "checking",
            overall: "checking",
            lastChecked: 0
        }), [v, k] = pe({
            status: "checking",
            availableWallets: 0,
            totalWallets: 0,
            totalBalance: 0n,
            totalUtxos: 0,
            pendingTxs: 0,
            lastChecked: 0
        }), [_, A] = pe({}), [P, U] = pe(new Map), [K, X] = pe(0n), [G, ce] = pe(""), [ie, Y] = pe(""), [M, g] = pe(""), [y, C] = pe(new Map), R = Ct(()=>Array.from(y().values())), [N, L] = pe(0), [z, B] = pe(!1), [x, O] = pe(null), [q, H] = pe(null), [Z, te] = pe(""), [J, se] = pe({
            environment: FO,
            proofServerUrl: Bte,
            proofServerMode: "proofstation",
            showDropdownAddresses: !1
        }), [fe, ge] = pe([]), [Ce, Ue] = pe(1), [Ie, Le] = pe([]), Ge = Ct(()=>Ie().filter((ue)=>ue.status === "submitting" || ue.status === "pending").length), Ve = new Map;
        let Ne = "";
        const [be, Qe] = pe([
            {
                id: 0,
                name: "Wallet 1",
                accounts: [
                    {
                        index: 0,
                        name: "Account 1"
                    }
                ],
                activeAccountIndex: 0,
                nextAccountIndex: 1
            }
        ]), [le, De] = pe(0), [Re, ee] = pe(!1), [oe, ye] = pe(0), [D, S] = pe(""), [E, $] = pe(null), [re, ae] = pe(!1), [me, Oe] = pe(null), [ut, dt] = pe(!1), [Ut, at] = pe(!1);
        let Qt = null, ci = !1, Sn = 0;
        const [Hn, Qc] = pe([]), jn = new Map, An = (ue)=>{
            const xe = crypto.randomUUID();
            Qc((Pe)=>[
                    ...Pe,
                    {
                        ...ue,
                        id: xe
                    }
                ]);
            const Ee = ue.type === "error" ? 8e3 : 5e3, we = setTimeout(()=>{
                jn.delete(xe), ya(xe);
            }, Ee);
            jn.set(xe, we);
        }, ya = (ue)=>{
            const xe = jn.get(ue);
            xe && (clearTimeout(xe), jn.delete(ue)), Qc((Ee)=>Ee.filter((we)=>we.id !== ue));
        }, ar = Ct(()=>fe().length), Ln = Ct(()=>Math.max(1, Math.ceil(fe().length / f_))), el = Ct(()=>{
            const ue = (Ce() - 1) * f_;
            return fe().slice(ue, ue + f_);
        }), Gn = "0000000000000000000000000000000000000000000000000000000000000000";
        let _e = null, an = null, kt = null, je = null, Lt = null, pn = !1, hn = !1, nr = null, gn, Wt = jb(ir[FO]), li = !1, rn = null, Pn = null, Qa = !1, ec = !1, tl = !1;
        const Bs = Mot(async (ue)=>{
            if (!tl && !(li && !ji())) {
                tl = !0;
                try {
                    const xe = {
                        environment: Wt.networkId,
                        serializedDustWalletState: await ue.dust.serializeState(),
                        serializedShieldedWalletState: await ue.shielded.serializeState(),
                        serializedUnshieldedWalletState: await ue.unshielded.serializeState()
                    };
                    if (rn) try {
                        await gf(rn.serialize());
                    } catch  {}
                    li && await fm(xe);
                } catch (xe) {
                    console.error("[Wallet] Checkpoint save failed:", xe instanceof Error ? xe.message : xe);
                } finally{
                    tl = !1;
                }
            }
        }, 5e3), Qd = (ue)=>ue === void 0 || ue === "" || ue === Gn, Pu = 15, ef = (ue)=>ue === "DUST" || ue === "tDUST", to = (ue, xe = 4, Ee)=>{
            const we = (Pe, ot, Tt)=>{
                const We = 10n ** BigInt(ot), gt = Pe / We, Et = Pe % We;
                if (Tt <= 0) return gt.toString();
                const sn = Et.toString().padStart(ot, "0").slice(0, Tt);
                return `${gt}.${sn}`;
            };
            return Qd(Ee) ? we(ue, 6, xe) : ef(Ee) ? we(ue, Pu, xe) : ue.toString();
        }, nl = ()=>_e;
        let tc = Promise.resolve();
        const ui = ()=>{
            const ue = Ie().filter((we)=>!(we.chain === "cardano" && we.id.startsWith("cardano-"))), xe = J().environment, Ee = ez();
            return tc = tc.then(()=>Git(ue, xe, Ee)).catch((we)=>console.error("[Wallet] persistPending failed:", we)), tc;
        }, nc = async (ue)=>{
            Le((xe)=>[
                    ue,
                    ...xe
                ]), await ui();
        }, Vi = async (ue, xe)=>{
            Le((Ee)=>Ee.map((we)=>we.id === ue ? {
                        ...we,
                        ...xe
                    } : we)), await ui();
        }, rc = async (ue)=>{
            try {
                const { fetchCardanoNightBalance: xe } = await sr(async ()=>{
                    const { fetchCardanoNightBalance: we } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    }).then((Pe)=>Pe.ah);
                    return {
                        fetchCardanoNightBalance: we
                    };
                }, __vite__mapDeps([3,4])), Ee = await xe(ue, void 0, J().environment);
                $(Ee), Oe(null);
            } catch  {}
        }, Ou = async (ue)=>{
            try {
                const xe = Ie().filter((Pe)=>Pe.chain === "cardano" && typeof Pe.txHash == "string" && !Pe.id.startsWith("cardano-")).map((Pe)=>Pe.txHash), { fetchRecentCardanoTransactions: Ee } = await sr(async ()=>{
                    const { fetchRecentCardanoTransactions: Pe } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    }).then((ot)=>ot.ah);
                    return {
                        fetchRecentCardanoTransactions: Pe
                    };
                }, __vite__mapDeps([3,4])), we = await Ee(ue, xe, void 0, J().environment);
                if (we.length === 0) return;
                Le((Pe)=>{
                    const ot = Pe.filter((We)=>We.chain !== "cardano" || !We.id.startsWith("cardano-")), Tt = new Set(ot.map((We)=>We.txHash).filter((We)=>typeof We == "string"));
                    for (const We of we){
                        if (Tt.has(We.txHash)) continue;
                        const gt = We.direction || "receive", Et = gt === "dust_generation" ? "dust_generation" : gt === "send" ? "send" : "receive";
                        ot.unshift({
                            id: `cardano-${gt}:${We.txHash}`,
                            txHash: We.txHash,
                            type: Et,
                            chain: "cardano",
                            amount: We.amount.toString(),
                            tokenType: gt === "dust_generation" ? "DUST" : We.tokenType,
                            status: "confirmed",
                            createdAt: We.timestamp,
                            ...We.fee ? {
                                fee: We.fee.toString()
                            } : {}
                        }), Tt.add(We.txHash);
                    }
                    return ot.sort((We, gt)=>gt.createdAt - We.createdAt), ot;
                });
            } catch (xe) {
                console.warn("[1AM] Failed to sync Cardano transactions:", xe);
            }
        }, Mu = async (ue)=>{
            const { extractMnemonic: xe } = await sr(async ()=>{
                const { extractMnemonic: Ee } = await import("./export-mnemonic-96pGaLLi.js");
                return {
                    extractMnemonic: Ee
                };
            }, []);
            return Aot({
                password: ue,
                activeWalletId: le(),
                trySessionUnlock: Nh,
                unlockVault: async (Ee)=>{
                    const { contents: we } = await sT(Ee);
                    return {
                        contents: we
                    };
                },
                extractMnemonic: xe
            });
        }, sc = async (ue)=>{
            const xe = Ie(), Ee = Date.now();
            let we = !1;
            const Pe = new Map, ot = xe.filter((We)=>(We.status === "submitting" || We.status === "pending") && !We.txHash && We.type === "dapp" && We.chain !== "cardano" && Array.isArray(We.txIdentifiers) && We.txIdentifiers.length > 0 && Ee - (Ve.get(We.id) ?? 0) >= 1e4);
            if (ot.length > 0) try {
                const { lookupMidnightTxByIdentifiers: We } = await sr(async ()=>{
                    const { lookupMidnightTxByIdentifiers: gt } = await import("./midnight-tx-recovery-hUiL_-xC.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    });
                    return {
                        lookupMidnightTxByIdentifiers: gt
                    };
                }, __vite__mapDeps([5,4,6,7,8,3]));
                for (const gt of ot){
                    Ve.set(gt.id, Ee);
                    const Et = await We(ir[J().environment]?.indexerHttpUrl, gt.txIdentifiers);
                    Et && (Ve.delete(gt.id), Pe.set(gt.id, {
                        txHash: Et.hash,
                        status: Et.status === "FAILURE" ? "failed" : "confirmed",
                        error: Et.status === "FAILURE" ? "Transaction failed on-chain" : void 0
                    }));
                }
            } catch (We) {
                console.warn("[Wallet] Interrupted DApp tx recovery lookup failed:", We);
            }
            const Tt = xe.map((We)=>{
                const gt = Pe.get(We.id);
                return gt ? (we = !0, {
                    ...We,
                    ...gt
                }) : (We.status === "submitting" || We.status === "pending") && We.txHash && ue.has(We.txHash) ? (we = !0, {
                    ...We,
                    status: "confirmed"
                }) : (We.status === "submitting" || We.status === "pending") && Ee - We.createdAt > 1800 * 1e3 ? (Ve.delete(We.id), we = !0, {
                    ...We,
                    status: "failed",
                    error: "Transaction timed out"
                }) : We;
            });
            we && (Le(Tt), await ui());
        }, Ru = (ue)=>ue === "FAILURE" ? "failed" : ue === "SUCCESS" || ue === "PARTIAL_SUCCESS" ? "confirmed" : "pending", rl = (ue, xe)=>{
            const Ee = new Map;
            for (const Pe of ue)Ee.set(Pe.hash, Pe);
            for (const Pe of xe)Ee.set(Pe.hash, Pe);
            const we = Array.from(Ee.values());
            return we.sort((Pe, ot)=>ot.timestamp.getTime() - Pe.timestamp.getTime()), we;
        }, lb = (ue)=>rl(fe(), ue), L9 = async (ue)=>{
            const xe = iU("DUST", J().environment);
            if (!_e || !nr) {
                O("Wallet not initialized");
                return;
            }
            if (await Sh(15e3)) {
                B(!0), O(null);
                try {
                    const Pe = (await Dn(_e.state().pipe(vu((Et)=>Et.isSynced)))).unshielded.availableCoins.filter((Et)=>Et.utxo.type === Gn && !Et.meta.registeredForDustGeneration);
                    if (Pe.length === 0) {
                        O(`No NIGHT UTXOs available for ${xe} generation`);
                        return;
                    }
                    const ot = Yl(nr, Wt.networkId), Tt = await _e.registerNightUtxosForDustGeneration(Pe, ot.getPublicKey(), (Et)=>ot.signData(Et), await _e.dust.getAddress()), We = await _e.finalizeRecipe(Tt), gt = await _e.submitTransaction(We);
                    An({
                        type: "success",
                        title: "Dust generation submitted",
                        txHash: gt
                    });
                } catch (we) {
                    console.error(`${xe} generation failed:`, we), O(we instanceof Error ? we.message : `Failed to generate ${xe}`);
                } finally{
                    B(!1), kh();
                }
            }
        }, z9 = async (ue, xe, Ee, we)=>{
            if (!await Sh(0)) throw new Error("A transaction is already in progress");
            try {
                return await uw(ue, xe, Ee, we);
            } finally{
                kh();
            }
        }, uw = async (ue, xe, Ee, we)=>{
            if (!_e) throw new Error("Wallet not initialized");
            if (!kt && !je && !nr) throw new Error("Secret keys not found");
            const Pe = crypto.randomUUID();
            await nc({
                id: Pe,
                type: "send",
                amount: xe.toString(),
                tokenType: Ee,
                recipientAddress: ue,
                status: "submitting",
                createdAt: Date.now()
            });
            let ot = !1;
            try {
                const Tt = Jr.parse(ue), We = Wt.networkId;
                let gt;
                try {
                    gt = we === "shielded" ? {
                        type: "shielded",
                        outputs: [
                            {
                                type: Ee,
                                receiverAddress: Tt.decode(Zl, We),
                                amount: xe
                            }
                        ]
                    } : {
                        type: "unshielded",
                        outputs: [
                            {
                                type: Ee,
                                receiverAddress: Tt.decode(Wi, We),
                                amount: xe
                            }
                        ]
                    };
                } catch  {
                    throw new Error(`Invalid ${we} address — make sure you're using a ${we} address`);
                }
                let Et = await _e.transferTransaction([
                    gt
                ], {
                    shieldedSecretKeys: je,
                    dustSecretKey: kt
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3),
                    payFees: !1
                });
                const sn = J();
                if (sn.dustSponsorship) {
                    const { proveAndBalance: Di, confirmSubmitted: _t } = await sr(async ()=>{
                        const { proveAndBalance: ic, confirmSubmitted: tt } = await import("./balance-client-oZC5QpAj.js");
                        return {
                            proveAndBalance: ic,
                            confirmSubmitted: tt
                        };
                    }, []);
                    te("Signing transaction...");
                    const on = (ic)=>Yl(nr, Wt.networkId).signData(ic), qn = await _e.signUnprovenTransaction(Et.transaction, on);
                    te("Proving & balancing (server)...");
                    const fr = await Di(sn.proofServerUrl, qn.serialize(), sn.proofStationApiKey, gn), { fromHex: di, toHex: Wn } = await sr(async ()=>{
                        const { fromHex: ic, toHex: tt } = await import("./index-Dudsifbi.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        });
                        return {
                            fromHex: ic,
                            toHex: tt
                        };
                    }, __vite__mapDeps([9,1,4,6,7,8,3])), ks = _n.deserialize("signature", "proof", "binding", di(fr.txBytes)), Rn = ks.serialize(), Lr = Wn(Rn);
                    if (!Lr || Lr.length < 10) throw new Error("Proof server returned invalid transaction");
                    const No = await crypto.subtle.digest("SHA-256", Uint8Array.from(Rn)), fi = Wn(new Uint8Array(No));
                    if (fr.txHash && fi !== fr.txHash) throw new Error("Proof server txHash does not match actual transaction hash");
                    await Vi(Pe, {
                        txHash: fr.txHash,
                        status: "pending"
                    }), te("Broadcasting transaction..."), ot = !0;
                    const uh = await _e.submitTransaction(ks);
                    return await Vi(Pe, {
                        txHash: fr.txHash,
                        status: "pending"
                    }), te(""), An({
                        type: "success",
                        title: "Transaction submitted",
                        txHash: fr.txHash
                    }), await _t(sn.proofServerUrl, fr.txHash, sn.proofStationApiKey, gn).catch(()=>{}), uh;
                }
                let Zn = await _e.balanceUnprovenTransaction(Et.transaction, {
                    shieldedSecretKeys: je,
                    dustSecretKey: kt
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3)
                }), dr = await _e.signRecipe(Zn, (Di)=>Yl(nr, Wt.networkId).signData(Di)), wa = await _e.finalizeRecipe(dr);
                ot = !0;
                let Fs = await _e.submitTransaction(wa);
                return await Vi(Pe, {
                    status: "pending"
                }), An({
                    type: "success",
                    title: "Transaction submitted",
                    txHash: Fs
                }), Fs;
            } catch (Tt) {
                const We = Tt instanceof Error ? Tt.message : "Unknown error";
                throw ot ? (await Vi(Pe, {
                    status: "pending",
                    error: "Submission uncertain — waiting for confirmation"
                }), te(""), H("Transaction status is uncertain — please wait for confirmation before retrying"), An({
                    type: "info",
                    title: "Transaction status unknown",
                    message: "Waiting for network confirmation — do not retry yet"
                }), new Error("Transaction status is uncertain — please wait for confirmation before retrying")) : (await Vi(Pe, {
                    status: "failed",
                    error: We
                }), H(We), An({
                    type: "error",
                    title: "Transaction failed",
                    message: We
                }), new Error(We));
            }
        }, U9 = async (ue)=>{
            if (!ut() || !D()) throw new Error("Enable Cardano NIGHT first before sending on Cardano.");
            if (!await Sh(5e3)) throw new Error("Wallet busy — another transaction is in progress. Please try again.");
            const Ee = crypto.randomUUID();
            try {
                if (await nc({
                    id: Ee,
                    type: "send",
                    chain: "cardano",
                    amount: ue.amount.toString(),
                    tokenType: ue.asset,
                    recipientAddress: ue.toAddress,
                    status: "submitting",
                    createdAt: Date.now()
                }), !Pn) throw new Error("Cardano keys not initialized — please refresh");
                const { sendCardanoTransaction: we } = await sr(async ()=>{
                    const { sendCardanoTransaction: ot } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    }).then((Tt)=>Tt.ah);
                    return {
                        sendCardanoTransaction: ot
                    };
                }, __vite__mapDeps([3,4])), Pe = await we({
                    fromAddress: D(),
                    toAddress: ue.toAddress,
                    nightAmount: ue.asset === "ADA" ? 0n : ue.amount,
                    adaAmount: ue.asset === "ADA" ? ue.amount : void 0,
                    adaOnly: ue.asset === "ADA",
                    signingKeys: Pn,
                    network: J().environment
                });
                return await Vi(Ee, {
                    txHash: Pe.txHash,
                    status: "confirmed",
                    error: void 0
                }), An({
                    type: "success",
                    title: "Cardano transaction submitted",
                    txHash: Pe.txHash
                }), await rc(D()), Pe.txHash;
            } catch (we) {
                const { normalizeCardanoSendErrorMessage: Pe } = await sr(async ()=>{
                    const { normalizeCardanoSendErrorMessage: We } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    }).then((gt)=>gt.ah);
                    return {
                        normalizeCardanoSendErrorMessage: We
                    };
                }, __vite__mapDeps([3,4])), ot = we instanceof Error ? we.message : "Failed to send Cardano transaction", Tt = Pe(ot);
                throw await Vi(Ee, {
                    status: "failed",
                    error: Tt
                }), new Error(Tt);
            } finally{
                kh();
            }
        }, H9 = async (ue, xe)=>{
            const Ee = J(), we = ue.environment !== Ee.environment, Pe = xe?.reload !== !1;
            if (we) {
                Lte(i());
                try {
                    Bs.cancel();
                } catch  {}
                try {
                    an?.unsubscribe();
                } catch  {}
                if (_e) {
                    try {
                        await Promise.race([
                            _e.stop(),
                            new Promise((ot)=>setTimeout(ot, 2e3))
                        ]);
                    } catch  {}
                    _e = null;
                }
            }
            if (await n5(ue), se(ue), we) {
                Le([]), Ue(1), await gf(""), await r5();
                try {
                    await zt.removeItem(Hh("session:encryptedSnapshot"));
                } catch  {}
                if (li) try {
                    await fm(void 0);
                } catch  {}
                Pe && window.location.reload();
            }
        }, dw = ()=>{
            A({}), U(new Map), X(0n), ce(""), Y(""), g(""), C(new Map), L(0), ge([]), Ue(1), Le([]), B(!1), O(null), H(null), te(""), s(!1), u(null);
        }, nh = (ue)=>{
            if (!(!ue || typeof ue != "object")) for (const xe of Object.getOwnPropertyNames(ue))try {
                const Ee = ue[xe];
                Ee instanceof Uint8Array ? Ee.fill(0) : Ee instanceof ArrayBuffer && new Uint8Array(Ee).fill(0);
            } catch  {}
        }, rh = ()=>{
            if (nr) {
                try {
                    nr.fill(0);
                } catch  {}
                nr = null;
            }
            gn = void 0, nh(kt), kt = null, nh(je), je = null, Pn && (Pn.paymentExtendedPrivateKey.fill(0), Pn.stakeExtendedPrivateKey.fill(0), Pn = null), li = !1, Qa = !1, ec = !1;
        }, ub = async ()=>{
            try {
                await navigator.clipboard.writeText("");
            } catch  {}
            try {
                Bs.cancel();
            } catch  {}
            if (rn) try {
                await gf(rn.serialize());
            } catch  {}
            if (_e && li && ji()) try {
                const ue = {
                    environment: Wt.networkId,
                    serializedDustWalletState: await _e.dust.serializeState(),
                    serializedShieldedWalletState: await _e.shielded.serializeState(),
                    serializedUnshieldedWalletState: await _e.unshielded.serializeState()
                };
                await fm(ue);
            } catch  {}
            try {
                an?.unsubscribe();
            } catch  {}
            if (_e) {
                try {
                    await Promise.race([
                        _e.stop(),
                        new Promise((ue)=>setTimeout(ue, 2e3))
                    ]);
                } catch  {}
                _e = null;
            }
            rh(), await r5(), await PP(), window.location.reload();
        }, j9 = async ()=>{
            try {
                Bs.cancel();
            } catch  {}
            try {
                an?.unsubscribe();
            } catch  {}
            if (_e) {
                try {
                    await Promise.race([
                        _e.stop(),
                        new Promise((ue)=>setTimeout(ue, 2e3))
                    ]);
                } catch  {}
                _e = null;
            }
            rh(), await r5(), await zit(), window.location.reload();
        }, Nu = async (ue, xe = !1)=>{
            try {
                Bs.cancel();
            } catch  {}
            if (!xe && _e && li && ji()) try {
                const Tt = {
                    environment: Wt.networkId,
                    serializedDustWalletState: await _e.dust.serializeState(),
                    serializedShieldedWalletState: await _e.shielded.serializeState(),
                    serializedUnshieldedWalletState: await _e.unshielded.serializeState()
                };
                await fm(Tt);
            } catch  {}
            try {
                an?.unsubscribe();
            } catch  {}
            if (an = null, _e) {
                try {
                    await Promise.race([
                        _e.stop(),
                        new Promise((Tt)=>setTimeout(Tt, 3e3))
                    ]);
                } catch  {}
                _e = null;
            }
            rh(), li = !1, ah(), Pn && (Pn.paymentExtendedPrivateKey.fill(0), Pn.stakeExtendedPrivateKey.fill(0), Pn = null), S(""), $(null), Oe(null), ci = !1, dw(), await gf("");
            try {
                await zt.removeItem(Hh("session:encryptedSnapshot"));
            } catch  {}
            li = !0;
            const Ee = J(), we = ir[Ee.environment];
            rn = new id, Wt = jb(we, rn);
            const Pe = await iz(ue, Wt, we.nodeUrl, Ee.proofServerUrl, d_(Ee, gn));
            if (_e = Pe.wallet, je = Pe.zswapSecretKeys, kt = Pe.dustSecretKey, nr = Pe.nightExternalKeyBytes, gn = nr ? await aT(nr) : void 0, je && G() === "") try {
                const Tt = je.coinPublicKey, We = je.encryptionPublicKey;
                if (Tt && We && /^[0-9a-f]+$/i.test(Tt) && /^[0-9a-f]+$/i.test(We)) {
                    const gt = Tt.match(/.{2}/g), Et = We.match(/.{2}/g);
                    if (gt && Et) {
                        const sn = new Uint8Array(gt.map((Fs)=>parseInt(Fs, 16))), Zn = new Uint8Array(Et.map((Fs)=>parseInt(Fs, 16))), dr = new Uint8Array(sn.length + Zn.length);
                        dr.set(sn, 0), dr.set(Zn, sn.length);
                        const wa = Wt.networkId === "mainnet" ? "mn_shield-addr" : `mn_shield-addr_${Wt.networkId}`;
                        ce(Pa.encode(wa, Pa.toWords(dr), !1));
                    }
                }
            } catch (Tt) {
                console.error("[Wallet] Shielded address derivation failed:", Tt);
            }
            const ot = await oz(J().environment);
            ot.length > 0 && Le(ot), nf(), je && kt && await _e.start(je, kt), Ee.cardanoEnabled && ue.mnemonic && tf(ue.mnemonic).catch(()=>{});
        }, sh = async (ue)=>{
            if (ue !== le() && !Re()) {
                ee(!0), n(!0);
                try {
                    await ui(), await Bs.flush(), await Hit(le(), oe());
                    const xe = await zi(), Ee = xe.wallets.find((ot)=>ot.id === ue);
                    if (!Ee) throw new Error("Wallet not found");
                    const we = Ee.activeAccountIndex ?? 0, Pe = await jit(ue, we);
                    xe.activeId = ue, await fc(xe), De(ue), ye(we), c_(ue, we), await Nu(Pe, !0);
                } catch (xe) {
                    u(xe instanceof Error ? xe.message : "Failed to switch wallet");
                } finally{
                    n(!1), ee(!1);
                }
            }
        }, q9 = async (ue, xe, Ee)=>{
            ee(!0), n(!0);
            try {
                const we = await zi(), Pe = we.nextId, ot = xe || `Wallet ${we.wallets.length + 1}`, Tt = await qit(Pe, ue, Ee);
                we.wallets.push({
                    id: Pe,
                    name: ot,
                    accounts: [
                        {
                            index: 0,
                            name: "Account 1"
                        }
                    ],
                    activeAccountIndex: 0,
                    nextAccountIndex: 1
                }), we.activeId = Pe, we.nextId = Pe + 1, await fc(we), Qe([
                    ...we.wallets
                ]), De(Pe), ye(0), c_(Pe, 0), await Nu(Tt);
            } catch (we) {
                u(we instanceof Error ? we.message : "Failed to add wallet");
            } finally{
                n(!1), ee(!1);
            }
        }, W9 = async (ue, xe)=>{
            const Ee = await zi(), we = Ee.wallets.find((Pe)=>Pe.id === ue);
            we && (we.name = xe.trim() || we.name, await fc(Ee), Qe([
                ...Ee.wallets
            ]));
        }, K9 = async (ue)=>{
            if (ue === 0 || !(await zi()).wallets.some((we)=>we.id === ue)) return;
            ue === le() && await sh(0), await Wit(ue), await Fte(ue);
            const Ee = await zi();
            Ee.wallets = Ee.wallets.filter((we)=>we.id !== ue), await fc(Ee), Qe([
                ...Ee.wallets
            ]);
        }, ih = async (ue)=>{
            if (ue !== oe() && !Re()) {
                ee(!0), n(!0);
                try {
                    await ui(), await Bs.flush();
                    const xe = await sz(le(), ue, oe()), Ee = await zi(), we = Ee.wallets.find((Pe)=>Pe.id === le());
                    we && (we.activeAccountIndex = ue, await fc(Ee), Qe([
                        ...Ee.wallets
                    ])), ye(ue), c_(le(), ue), await Nu(xe, !0);
                } catch (xe) {
                    u(xe instanceof Error ? xe.message : "Failed to switch account");
                } finally{
                    n(!1), ee(!1);
                }
            }
        }, db = async ()=>{
            const ue = await zi(), xe = ue.wallets.find((Pe)=>Pe.id === le());
            if (!xe) return;
            const Ee = xe.nextAccountIndex, we = `Account ${xe.accounts.length + 1}`;
            xe.accounts.push({
                index: Ee,
                name: we
            }), xe.nextAccountIndex = Ee + 1, await fc(ue), Qe([
                ...ue.wallets
            ]), await ih(Ee);
        }, oh = async ()=>{
            const ue = ie(), xe = G();
            if (!ue && !xe) return;
            const Ee = await zi(), we = Ee.wallets.find((ot)=>ot.id === le());
            if (!we) return;
            const Pe = we.accounts.find((ot)=>ot.index === oe());
            Pe && (Pe.cachedUnshieldedAddress === ue && Pe.cachedShieldedAddress === xe || (Pe.cachedUnshieldedAddress = ue || void 0, Pe.cachedShieldedAddress = xe || void 0, await fc(Ee), Qe([
                ...Ee.wallets
            ])));
        }, fw = async (ue, xe)=>{
            const Ee = await zi(), we = Ee.wallets.find((ot)=>ot.id === le());
            if (!we) return;
            const Pe = we.accounts.find((ot)=>ot.index === ue);
            Pe && (Pe.name = xe.trim() || Pe.name, await fc(Ee), Qe([
                ...Ee.wallets
            ]));
        }, $9 = async (ue)=>{
            if (ue === 0) return;
            const xe = await zi(), Ee = xe.wallets.find((Pe)=>Pe.id === le());
            if (!Ee) return;
            const we = Ee.accounts.find((Pe)=>Pe.index === ue);
            if (we) {
                if (ue === oe()) {
                    const Pe = Ee.accounts.find((ot)=>ot.index !== ue && !ot.hidden);
                    await ih(Pe?.index ?? 0);
                }
                we.hidden = !0, await fc(xe), Qe([
                    ...xe.wallets
                ]);
            }
        }, pw = async (ue)=>{
            const xe = await zi(), Ee = xe.wallets.find((Pe)=>Pe.id === le());
            if (!Ee) return;
            const we = Ee.accounts.find((Pe)=>Pe.index === ue);
            we && (we.hidden = !1, await fc(xe), Qe([
                ...xe.wallets
            ]));
        }, tf = async (ue)=>{
            if (!ci) {
                ci = !0, ae(!0), Oe(null);
                try {
                    const { deriveCardanoAddress: xe, deriveCardanoSigningKeys: Ee, fetchCardanoNightBalance: we } = await sr(async ()=>{
                        const { deriveCardanoAddress: gt, deriveCardanoSigningKeys: Et, fetchCardanoNightBalance: sn } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }).then((Zn)=>Zn.ah);
                        return {
                            deriveCardanoAddress: gt,
                            deriveCardanoSigningKeys: Et,
                            fetchCardanoNightBalance: sn
                        };
                    }, __vite__mapDeps([3,4])), Pe = oe(), ot = J().environment, Tt = await xe(ue, Pe, ot);
                    S(Tt), Pn = await Ee(ue, Pe);
                    try {
                        const gt = await we(Tt, void 0, ot);
                        $(gt), Sn = 0;
                    } catch (gt) {
                        Sn++, Oe(gt instanceof Error ? gt.message : "Failed to fetch Cardano balance");
                    }
                    await Ou(Tt), ah();
                    const We = ()=>{
                        if (Sn >= 5) return;
                        const gt = Math.min(3e5, 6e4 * Math.pow(2, Sn));
                        Qt = setTimeout(async ()=>{
                            try {
                                const { fetchCardanoNightBalance: Et } = await sr(async ()=>{
                                    const { fetchCardanoNightBalance: Zn } = await import("./cardano-e2kMgYtl.js").then(async (m)=>{
                                        await m.__tla;
                                        return m;
                                    }).then((dr)=>dr.ah);
                                    return {
                                        fetchCardanoNightBalance: Zn
                                    };
                                }, __vite__mapDeps([3,4])), sn = await Et(Tt, void 0, ot);
                                $(sn), Oe(null), Sn = 0;
                            } catch (Et) {
                                Sn++, Oe(Et instanceof Error ? Et.message : "Failed to fetch Cardano balance");
                            }
                            await Ou(Tt), We();
                        }, gt);
                    };
                    We();
                } catch (xe) {
                    console.error("[1AM] initCardano failed:", xe), Oe(xe instanceof Error ? xe.message : "Failed to derive Cardano address");
                } finally{
                    ae(!1), ci = !1;
                }
            }
        }, ah = ()=>{
            Qt && (clearTimeout(Qt), Qt = null), Sn = 0;
        }, X9 = async (ue)=>{
            const xe = le();
            await Kit((we)=>{
                if (we.mnemonic = ue, we.wallets) {
                    const Pe = we.wallets.find((ot)=>ot.id === xe);
                    Pe && (Pe.mnemonic = ue);
                }
            }), at(!0);
            const Ee = J();
            await n5({
                ...Ee,
                cardanoEnabled: !0
            }), se({
                ...Ee,
                cardanoEnabled: !0
            }), dt(!0), await tf(ue);
        }, G9 = async (ue)=>{
            const xe = J();
            if (await n5({
                ...xe,
                cardanoEnabled: ue
            }), se({
                ...xe,
                cardanoEnabled: ue
            }), dt(ue), !ue) ah(), S(""), $(null), Oe(null);
            else try {
                const Ee = await Nh();
                Ee?.mnemonic && await tf(Ee.mnemonic);
            } catch (Ee) {
                console.error("[1AM] Cardano enable failed:", Ee), Oe(Ee instanceof Error ? Ee.message : "Failed to enable Cardano");
            }
        }, hw = async (ue)=>{
            if (J().environment !== "mainnet") throw new Error("Cardano dust generation is currently supported on mainnet only.");
            if (!ut() || !D()) throw new Error("Enable Cardano NIGHT first before generating DUST.");
            if (!await Sh(5e3)) throw new Error("Wallet busy — another transaction is in progress. Please try again.");
            try {
                const { getCardanoDustRegistrationLockMessage: Ee, loadCardanoDustRegistrationLock: we, registerCardanoDustGeneration: Pe } = await sr(async ()=>{
                    const { getCardanoDustRegistrationLockMessage: sn, loadCardanoDustRegistrationLock: Zn, registerCardanoDustGeneration: dr } = await import("./cardano-dust-Dtj1ts72.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    });
                    return {
                        getCardanoDustRegistrationLockMessage: sn,
                        loadCardanoDustRegistrationLock: Zn,
                        registerCardanoDustGeneration: dr
                    };
                }, __vite__mapDeps([10,4,8,2,11,3,6,7])), ot = D(), Tt = await we(ot);
                if (Tt) throw new Error(Ee(Tt));
                const We = await Mu(ue);
                if (!M()) throw new Error("Midnight DUST address not ready yet. Wait for wallet to finish syncing.");
                const gt = await Pe({
                    mnemonic: We,
                    dustAddress: M()
                }), Et = crypto.randomUUID();
                return await nc({
                    id: Et,
                    txHash: gt,
                    type: "dust_generation",
                    chain: "cardano",
                    amount: "0",
                    tokenType: "DUST",
                    recipientAddress: M(),
                    status: "confirmed",
                    createdAt: Date.now()
                }), An({
                    type: "success",
                    title: "Cardano DUST registration submitted",
                    txHash: gt
                }), await rc(ot), gt;
            } finally{
                kh();
            }
        }, Z9 = async (ue)=>{
            if (J().environment !== "mainnet") throw new Error("Cardano dust generation is currently supported on mainnet only.");
            if (!ut() || !D()) throw new Error("Enable Cardano NIGHT first.");
            if (!M()) throw new Error("Midnight DUST address not ready yet. Wait for wallet to finish syncing.");
            if (!await Sh(5e3)) throw new Error("Wallet busy — another transaction is in progress.");
            try {
                const Ee = await Mu(ue), { updateCardanoDustRegistration: we } = await sr(async ()=>{
                    const { updateCardanoDustRegistration: ot } = await import("./cardano-dust-Dtj1ts72.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    });
                    return {
                        updateCardanoDustRegistration: ot
                    };
                }, __vite__mapDeps([10,4,8,2,11,3,6,7])), Pe = await we({
                    mnemonic: Ee,
                    dustAddress: M()
                });
                return An({
                    type: "success",
                    title: "DUST registration updated",
                    txHash: Pe
                }), await rc(D()), Pe;
            } finally{
                kh();
            }
        }, nf = ()=>{
            if (!_e) return;
            an?.unsubscribe();
            const ue = Wt.networkId, xe = (we)=>{
                if (console.error("[1AM] Wallet state subscription error:", we), s(!1), u(we instanceof Error ? we.message : "Wallet connection lost"), !i()) {
                    pn = !0;
                    const Pe = (ot)=>{
                        const Tt = Math.min(3e3 * Math.pow(2, ot), 3e4);
                        Lt && clearTimeout(Lt), Lt = setTimeout(async ()=>{
                            if (Lt = null, !(r() || hn || !_e || !je || !kt)) {
                                hn = !0;
                                try {
                                    u(null), await fb();
                                } catch (We) {
                                    console.warn("[1AM] Auto-reconnect attempt failed:", We), ot < 5 ? (u("Reconnecting..."), Pe(ot + 1)) : u("Connection lost. Please refresh to reconnect.");
                                } finally{
                                    hn = !1;
                                }
                            }
                        }, Tt);
                    };
                    Pe(0);
                }
            }, Ee = async (we)=>{
                pn = !1, hn = !1, s(we.isSynced);
                const Pe = we.shielded?.progress, ot = we.unshielded?.progress, Tt = we.dust?.progress, We = Number(Pe?.appliedIndex ?? 0), gt = Number(Pe?.highestRelevantWalletIndex ?? 0), Et = Number(ot?.appliedId ?? 0), sn = Number(ot?.highestTransactionId ?? 0), Zn = Number(Tt?.appliedIndex ?? 0), dr = Number(Tt?.highestRelevantWalletIndex ?? 0), wa = We + Et + Zn, Fs = gt + sn + dr, Di = Fs > 0 ? Math.min(100, Math.round(wa / Fs * 100)) : 0;
                if (c({
                    shielded: {
                        current: We,
                        total: gt
                    },
                    unshielded: {
                        current: Et,
                        total: sn
                    },
                    dust: {
                        current: Zn,
                        total: dr
                    },
                    percent: we.isSynced ? 100 : Di
                }), !we.isSynced && _e && Di > 0 && Bs(_e), ie() === "") try {
                    const _t = we.unshielded.address?.data, on = _t ? new Wi(_t) : we.unshielded.address;
                    Y(Jr.encode(ue, on).toString());
                } catch  {}
                if (M() === "") try {
                    g(Jr.encode(ue, we.dust.address).toString());
                } catch  {}
                if (G() === "") try {
                    ce(Jr.encode(ue, we.shielded.address).toString());
                } catch  {}
                if ((ie() || G()) && oh(), !we.isSynced) {
                    const _t = uz(fe());
                    cz({
                        shieldedBalances: {},
                        unshieldedBalances: {},
                        dustBalance: "0",
                        shieldedAddress: G(),
                        unshieldedAddress: ie(),
                        dustAddress: M(),
                        dustCoins: 0,
                        availableUtxoForDustGeneration: 0,
                        pendingTransactions: [],
                        transactions: _t,
                        totalTransactions: _t.length,
                        isLoading: !1,
                        isSynced: !1,
                        syncProgress: Di,
                        error: null,
                        networkHealth: "ok",
                        wallets: be().map((on)=>({
                                id: on.id,
                                name: on.name
                            })),
                        activeWalletId: le(),
                        activeAccountIndex: oe(),
                        cardanoAddress: D(),
                        cardanoEnabled: ut(),
                        environment: J().environment,
                        timestamp: Date.now()
                    });
                }
                if (we.isSynced && _e) {
                    const _t = {};
                    for (const { coin: ct } of we.shielded.totalCoins){
                        const Vn = ct.type;
                        _t[Vn] = (_t[Vn] ?? 0n) + ct.value;
                    }
                    A(_t);
                    const on = {};
                    for (const { utxo: ct } of we.unshielded.totalCoins){
                        const Vn = ct.type;
                        on[Vn] = (on[Vn] ?? 0n) + ct.value;
                    }
                    U(new Map(Object.entries(on)));
                    const qn = new Map;
                    for (const ct of we.dust.availableCoinsWithFullInfo(new Date))ct.dtime === void 0 && qn.set(ct.token.nonce, ct);
                    C(qn);
                    let fr = 0n;
                    for (const ct of qn.values())fr += ct.generatedNow;
                    X(fr);
                    const di = [];
                    for await (const ct of we.unshielded.transactionHistory.getAll())di.push(ct);
                    const Wn = Oot({
                        appliedId: Et,
                        highestTransactionId: sn,
                        transactions: di
                    });
                    Wn && !i() && J9(Wn);
                    const ks = [
                        ...di
                    ];
                    try {
                        if (we.shielded?.transactionHistory) for await (const ct of we.shielded.transactionHistory.getAll())ks.push(ct);
                    } catch  {}
                    const Rn = lb(ks);
                    ge(Rn), Ce() > Math.max(1, Math.ceil(Rn.length / f_)) && Ue(1);
                    const Lr = we.unshielded.availableCoins.filter((ct)=>!ct.meta.registeredForDustGeneration && ct.utxo.type === Gn).length, No = Object.fromEntries(Object.entries(_t).map(([ct, Vn])=>[
                            ct,
                            Vn.toString()
                        ])), fi = Object.fromEntries(Object.entries(on).map(([ct, Vn])=>[
                            ct,
                            Vn.toString()
                        ])), uh = fr.toString(), ic = Ie().map((ct)=>({
                            id: ct.id,
                            txHash: ct.txHash,
                            type: ct.type,
                            chain: ct.chain,
                            amount: ct.amount,
                            tokenType: ct.tokenType,
                            status: ct.status,
                            createdAt: ct.createdAt,
                            recipientAddress: ct.recipientAddress,
                            error: ct.error
                        })), tt = be().map((ct)=>({
                            id: ct.id,
                            name: ct.name
                        })), Nn = uz(Rn);
                    if (L(Lr), cz({
                        shieldedBalances: No,
                        unshieldedBalances: fi,
                        dustBalance: uh,
                        shieldedAddress: G(),
                        unshieldedAddress: ie(),
                        dustAddress: M(),
                        dustCoins: qn.size,
                        availableUtxoForDustGeneration: Lr,
                        pendingTransactions: ic,
                        transactions: Nn,
                        totalTransactions: Nn.length,
                        isLoading: !1,
                        isSynced: we.isSynced,
                        syncProgress: a().percent,
                        error: null,
                        networkHealth: "ok",
                        wallets: tt,
                        activeWalletId: le(),
                        activeAccountIndex: oe(),
                        cardanoAddress: D(),
                        cardanoEnabled: ut(),
                        environment: J().environment,
                        timestamp: Date.now()
                    }), we.isSynced && _e) {
                        Bs(_e), p();
                        const ct = _e, Vn = ++d;
                        f = setTimeout(async ()=>{
                            f = null;
                            try {
                                if (_e !== ct) return;
                                const zn = {
                                    ts: Date.now(),
                                    seq: Vn,
                                    shielded: No,
                                    unshielded: fi,
                                    dust: uh,
                                    shieldedAddr: G(),
                                    unshieldedAddr: ie(),
                                    dustAddr: M(),
                                    dustCoinsCount: qn.size,
                                    availUtxo: Lr,
                                    walletState: {
                                        environment: Wt.networkId,
                                        serializedDustWalletState: await ct.dust.serializeState(),
                                        serializedShieldedWalletState: await ct.shielded.serializeState(),
                                        serializedUnshieldedWalletState: await ct.unshielded.serializeState()
                                    }
                                }, Ts = ji();
                                if (Ts) {
                                    const hs = crypto.getRandomValues(new Uint8Array(12)), rr = new TextEncoder().encode(`snapshot-v1:${J().environment}`), gs = new TextEncoder().encode(JSON.stringify(zn)), Bi = await crypto.subtle.encrypt({
                                        name: "AES-GCM",
                                        iv: hs,
                                        additionalData: rr
                                    }, Ts.key, gs), Ls = (Vu)=>{
                                        const sl = new Uint8Array(Vu);
                                        let il = "";
                                        for(let t5 = 0; t5 < sl.length; t5++)il += String.fromCharCode(sl[t5]);
                                        return btoa(il);
                                    };
                                    zt.setItem(Hh("session:encryptedSnapshot"), JSON.stringify({
                                        iv: Ls(hs),
                                        ct: Ls(Bi)
                                    }));
                                }
                            } catch (zn) {
                                console.error("[Wallet] Snapshot save failed:", zn);
                            }
                        }, 1e3);
                    }
                    const zr = new Set(Rn.map((ct)=>ct.hash));
                    await sc(zr);
                }
            };
            an = _e.state().subscribe(Ee, xe);
        }, fb = async ()=>{
            if (!(!_e || !je || !kt)) {
                s(!1), c({
                    shielded: {
                        current: 0,
                        total: 0
                    },
                    unshielded: {
                        current: 0,
                        total: 0
                    },
                    dust: {
                        current: 0,
                        total: 0
                    },
                    percent: 0
                }), u(null);
                try {
                    if (Bs.flush(), p(), an?.unsubscribe(), an = null, rn) try {
                        await gf(rn.serialize());
                    } catch  {}
                    const ue = {
                        environment: Wt.networkId,
                        serializedDustWalletState: await _e.dust.serializeState(),
                        serializedShieldedWalletState: await _e.shielded.serializeState(),
                        serializedUnshieldedWalletState: await _e.unshielded.serializeState()
                    };
                    try {
                        await Promise.race([
                            _e.stop(),
                            new Promise((Pe)=>setTimeout(Pe, 3e3))
                        ]);
                    } catch  {}
                    const xe = J(), Ee = ir[xe.environment];
                    rn = await tz() ?? new id, _e = await $it(ue, jb(Ee, rn), Ee.nodeUrl, xe.proofServerUrl, d_(xe, gn)), nf(), await _e.start(je, kt);
                } catch (ue) {
                    console.error("Failed to refresh sync:", ue), u("Failed to refresh sync. Try again.");
                }
            }
        }, pb = async ()=>{
            try {
                const ue = await sz(le(), oe());
                await Nu(ue);
            } catch (ue) {
                console.error("[Wallet] Full resync failed:", ue), u(ue instanceof Error ? ue.message : "Failed to resync");
            }
        }, J9 = async (ue)=>{
            if (!(!_e || !je || !kt || !nr) && !(Qa || ec)) {
                Qa = !0, ec = !0, console.warn("[1AM] Rebuilding unshielded transaction history from indexer", {
                    reason: ue
                }), s(!1), u(null);
                try {
                    Bs.flush(), p(), an?.unsubscribe(), an = null;
                    const xe = {
                        environment: Wt.networkId,
                        serializedDustWalletState: await _e.dust.serializeState(),
                        serializedShieldedWalletState: await _e.shielded.serializeState()
                    };
                    try {
                        await Promise.race([
                            _e.stop(),
                            new Promise((Pe)=>setTimeout(Pe, 3e3))
                        ]);
                    } catch  {}
                    const Ee = J(), we = ir[Ee.environment];
                    rn = new id;
                    try {
                        await gf(rn.serialize());
                    } catch  {}
                    _e = await Xit(xe, nr, jb(we, rn), we.nodeUrl, Ee.proofServerUrl, d_(Ee, gn)), nf(), await _e.start(je, kt);
                } catch (xe) {
                    console.error("[1AM] Failed to rebuild unshielded transaction history:", xe), u("Failed to rebuild transaction history. Try refreshing sync.");
                } finally{
                    Qa = !1;
                }
            }
        };
        ga(async ()=>{
            try {
                const ue = (_t)=>{
                    if (_t.shieldedBalances) {
                        const on = {};
                        for (const [qn, fr] of Object.entries(_t.shieldedBalances))on[qn] = h(fr);
                        A(on);
                    }
                    if (_t.unshieldedBalances) {
                        const on = {};
                        for (const [qn, fr] of Object.entries(_t.unshieldedBalances))on[qn] = h(fr);
                        U(new Map(Object.entries(on)));
                    }
                    if (_t.dustBalance != null && X(h(_t.dustBalance)), _t.shieldedAddress && ce(_t.shieldedAddress), _t.unshieldedAddress && Y(_t.unshieldedAddress), _t.dustAddress && g(_t.dustAddress), _t.availableUtxoForDustGeneration != null && L(_t.availableUtxoForDustGeneration), _t.pendingTransactions?.length > 0 && Le((on)=>{
                        const qn = new Map(_t.pendingTransactions.map((Wn)=>[
                                Wn.id,
                                {
                                    id: Wn.id,
                                    txHash: Wn.txHash,
                                    type: Wn.type,
                                    chain: Wn.chain,
                                    amount: Wn.amount,
                                    tokenType: Wn.tokenType,
                                    recipientAddress: Wn.recipientAddress,
                                    status: Wn.status,
                                    createdAt: Wn.createdAt,
                                    error: Wn.error
                                }
                            ])), fr = on.map((Wn)=>{
                            const ks = qn.get(Wn.id);
                            return ks ? (qn.delete(Wn.id), {
                                ...Wn,
                                ...ks,
                                amount: ks.amount || Wn.amount,
                                tokenType: ks.tokenType || Wn.tokenType
                            }) : Wn;
                        }), di = Array.from(qn.values());
                        return di.length > 0 ? [
                            ...di,
                            ...fr
                        ] : fr;
                    }), (_t.transactions?.length ?? 0) > 0 || _t.totalTransactions === 0 && fe().length === 0) {
                        const on = Pot(_t.transactions);
                        ge((qn)=>rl(qn, on));
                    }
                    _t.cardanoAddress && S(_t.cardanoAddress), typeof _t.activeWalletId == "number" && Number.isInteger(_t.activeWalletId) && De(_t.activeWalletId), _t.isSynced && !r() && s(!0), typeof _t.syncProgress == "number" && _t.syncProgress > a().percent && c((on)=>({
                            ...on,
                            percent: _t.syncProgress
                        }));
                }, xe = await Nm();
                se(xe);
                const Ee = xe.environment, we = await oee();
                we && we.environment === Ee ? (ue(we), we.isSynced && s(!0), n(!1)) : we && `${we.environment}${Ee}`, Eot((_t)=>{
                    _t.environment === Ee && ue(_t);
                });
                const Pe = window.__ONE_AM_SHELL__ === "sidepanel" ? "sidepanel" : window.__ONE_AM_SHELL__ === "popup" ? "popup" : "fullpage", ot = await zte(Pe, ()=>{
                    o(!1), (async ()=>{
                        try {
                            const _t = await Nh();
                            if (_t) {
                                await Nu(_t);
                                return;
                            }
                            _e && je && kt && (nf(), await _e.start(je, kt));
                        } catch (_t) {
                            console.error("[1AM] Promotion sync failed:", _t);
                        }
                    })();
                }), Tt = ot.role === "secondary";
                o(Tt), Tt || ot.role;
                let We;
                const gt = async ()=>{
                    try {
                        const _t = await zt.getItem(Hh("session:encryptedSnapshot"));
                        if (!_t) return;
                        const on = JSON.parse(_t), qn = ji();
                        if (!qn) return;
                        const fr = Uint8Array.from(atob(on.iv), (Lr)=>Lr.charCodeAt(0)), di = Uint8Array.from(atob(on.ct), (Lr)=>Lr.charCodeAt(0)), Wn = new TextEncoder().encode(`snapshot-v1:${xe.environment}`), ks = await crypto.subtle.decrypt({
                            name: "AES-GCM",
                            iv: fr,
                            additionalData: Wn
                        }, qn.key, di), Rn = JSON.parse(new TextDecoder().decode(ks));
                        if (typeof Rn.seq == "number" && Rn.seq < d) return;
                        if (typeof Rn.seq == "number" && (d = Rn.seq), Rn.shielded) {
                            const Lr = {};
                            for (const [No, fi] of Object.entries(Rn.shielded))Lr[No] = h(fi);
                            A(Lr);
                        }
                        if (Rn.unshielded) {
                            const Lr = {};
                            for (const [No, fi] of Object.entries(Rn.unshielded))Lr[No] = h(fi);
                            U(new Map(Object.entries(Lr)));
                        }
                        Rn.dust && X(BigInt(Rn.dust)), Rn.shieldedAddr && ce(Rn.shieldedAddr), Rn.unshieldedAddr && Y(Rn.unshieldedAddr), Rn.dustAddr && g(Rn.dustAddr), Rn.availUtxo != null && L(Rn.availUtxo), Rn.walletState && (We = Rn.walletState), n(!1);
                    } catch  {}
                }, Et = ir[xe.environment], [sn, Zn] = await Promise.all([
                    zi(),
                    t.initialVaultContents ? Promise.resolve(t.initialVaultContents) : Nh()
                ]);
                Qe(sn.wallets), De(sn.activeId);
                const dr = sn.wallets.find((_t)=>_t.id === sn.activeId);
                dr && ye(dr.activeAccountIndex ?? 0), c_(sn.activeId, dr?.activeAccountIndex ?? 0);
                const wa = ez(), Fs = await oz(xe.environment, wa), Di = await tz();
                if (rn = Di ?? new id, Di) {
                    const _t = [];
                    for await (const on of Di.getAll())_t.push(on);
                    _t.sort((on, qn)=>qn.timestamp.getTime() - on.timestamp.getTime()), ge(_t);
                }
                if (Fs.length > 0 && Le(Fs), Wt = jb(Et, rn), Zn) {
                    li = !0, Z1(Zn), at(!!Zn.mnemonic), dt(!!xe.cardanoEnabled), Tt || await gt(), !Zn.walletState && We && (Zn.walletState = We);
                    const _t = async ()=>{
                        const on = await iz(Zn, Wt, Et.nodeUrl, xe.proofServerUrl, d_(xe, gn));
                        if (_e = on.wallet, je = on.zswapSecretKeys, kt = on.dustSecretKey, nr = on.nightExternalKeyBytes, gn = nr ? await aT(nr) : void 0, je && G() === "") try {
                            const qn = je.coinPublicKey, fr = je.encryptionPublicKey;
                            if (qn && fr && /^[0-9a-f]+$/i.test(qn) && /^[0-9a-f]+$/i.test(fr)) {
                                const di = qn.match(/.{2}/g), Wn = fr.match(/.{2}/g);
                                if (di && Wn) {
                                    const ks = new Uint8Array(di.map((fi)=>parseInt(fi, 16))), Rn = new Uint8Array(Wn.map((fi)=>parseInt(fi, 16))), Lr = new Uint8Array(ks.length + Rn.length);
                                    Lr.set(ks, 0), Lr.set(Rn, ks.length);
                                    const No = Wt.networkId === "mainnet" ? "mn_shield-addr" : `mn_shield-addr_${Wt.networkId}`;
                                    ce(Pa.encode(No, Pa.toWords(Lr), !1));
                                }
                            }
                        } catch (qn) {
                            console.error("[Wallet] Shielded address derivation failed:", qn);
                        }
                    };
                    Tt ? (we?.isSynced && s(!0), n(!1), _t().then(()=>{}).catch((on)=>console.error("[1AM] Secondary: deferred wallet init failed:", on))) : (await _t(), nf(), _e && je && kt && await _e.start(je, kt)), xe.cardanoEnabled && Zn.mnemonic && tf(Zn.mnemonic).catch(()=>{}), n(!1);
                    return;
                }
                u("No wallet found. Please create one first."), n(!1);
            } catch (ue) {
                u(ue instanceof Error ? ue.message : "Failed to initialize wallet"), n(!1);
            }
        });
        let gw = !1;
        lt(async ()=>{
            if (!(!r() || gw)) {
                gw = !0;
                try {
                    const { getRecoverableTxs: ue, removeInflightTx: xe } = await sr(async ()=>{
                        const { getRecoverableTxs: We, removeInflightTx: gt } = await Promise.resolve().then(()=>cwt);
                        return {
                            getRecoverableTxs: We,
                            removeInflightTx: gt
                        };
                    }, void 0), Ee = `${le()}:${oe()}`, we = J().environment, Pe = await ue(Ee, we), { extractMidnightTxIdentifiers: ot, lookupMidnightTxByIdentifiers: Tt } = await sr(async ()=>{
                        const { extractMidnightTxIdentifiers: We, lookupMidnightTxByIdentifiers: gt } = await import("./midnight-tx-recovery-hUiL_-xC.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        });
                        return {
                            extractMidnightTxIdentifiers: We,
                            lookupMidnightTxByIdentifiers: gt
                        };
                    }, __vite__mapDeps([5,4,6,7,8,3]));
                    for (const We of Pe){
                        const gt = We.txType === "dapp" ? ot(We.txHex) : [], Et = gt.length > 0 ? await Tt(ir[J().environment]?.indexerHttpUrl, gt) : null;
                        Le((sn)=>sn.some((Zn)=>Zn.id === We.id) ? sn : [
                                {
                                    id: We.id,
                                    type: We.txType,
                                    amount: "0",
                                    tokenType: "",
                                    status: Et?.status === "FAILURE" ? "failed" : Et ? "confirmed" : "submitting",
                                    createdAt: We.createdAt,
                                    recipientAddress: We.dappOrigin ? `DApp via ${We.dappOrigin}` : void 0,
                                    txHash: Et?.hash,
                                    txIdentifiers: gt.length > 0 ? gt : void 0,
                                    error: Et?.status === "FAILURE" ? "Transaction failed on-chain" : Et ? void 0 : "Interrupted — checking if transaction was confirmed"
                                },
                                ...sn
                            ]), await xe(We.id);
                    }
                    Pe.length > 0 && ui().catch(()=>{});
                } catch (ue) {
                    console.error("[1AM] Inflight check failed:", ue);
                }
            }
        }), lt(async ()=>{
            const ue = ie();
            if (!r() || !ue) return;
            const xe = `${le()}:${oe()}`, Ee = `${J().environment}:${xe}:${ue}`;
            if (Ee !== Ne) {
                Ne = Ee;
                try {
                    const { buildMidnightPublicActivityIdentifier: we, fetchMidnightPublicContractInteractions: Pe } = await sr(async ()=>{
                        const { buildMidnightPublicActivityIdentifier: We, fetchMidnightPublicContractInteractions: gt } = await import("./midnight-tx-recovery-hUiL_-xC.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        });
                        return {
                            buildMidnightPublicActivityIdentifier: We,
                            fetchMidnightPublicContractInteractions: gt
                        };
                    }, __vite__mapDeps([5,4,6,7,8,3])), ot = we(ue);
                    if (!ot) return;
                    const Tt = await Pe(ir[J().environment]?.indexerHttpUrl, ot);
                    if (Tt.length === 0) return;
                    Le((We)=>{
                        const gt = [
                            ...We
                        ];
                        for (const Et of Tt.slice(0, 50)){
                            const sn = gt.findIndex((dr)=>dr.type === "dapp" && (dr.txHash === Et.hash || Array.isArray(dr.txIdentifiers) && dr.txIdentifiers.some((wa)=>Et.identifiers.includes(wa)))), Zn = {
                                id: sn >= 0 ? gt[sn].id : `midnight-dapp:${Et.hash}`,
                                txHash: Et.hash,
                                txIdentifiers: Et.identifiers.length > 0 ? Et.identifiers : void 0,
                                type: "dapp",
                                chain: "midnight",
                                amount: "0",
                                tokenType: "Contract interaction",
                                recipientAddress: Et.entryPoint ? `${Et.entryPoint} • ${Et.contractAddress ?? "contract"}` : Et.contractAddress,
                                status: Ru(Et.status),
                                createdAt: Et.createdAt,
                                error: Et.status === "FAILURE" ? "Transaction failed on-chain" : void 0
                            };
                            if (sn >= 0) {
                                const dr = gt[sn];
                                gt[sn] = {
                                    ...dr,
                                    ...Zn,
                                    recipientAddress: dr.recipientAddress ?? Zn.recipientAddress
                                };
                            } else gt.push(Zn);
                        }
                        return gt;
                    }), ui().catch(()=>{});
                } catch (we) {
                    console.warn("[Wallet] Public DApp activity hydration failed:", we);
                }
            }
        });
        let ch = Date.now();
        const lh = ()=>{
            ch = Date.now();
        }, Y9 = setInterval(async ()=>{
            if (!_e || !ji() || Om) return;
            if (!await Lit()) {
                ub();
                return;
            }
            const xe = (J().autoLockMinutes ?? 30) * 60 * 1e3;
            Date.now() - ch > xe && ub();
        }, 5e3);
        typeof document < "u" && (document.addEventListener("click", lh), document.addEventListener("keydown", lh));
        const hb = setInterval(async ()=>{
            if (!r()) {
                const { checkNetworkHealth: ue } = await sr(async ()=>{
                    const { checkNetworkHealth: Ee } = await Promise.resolve().then(()=>Y_);
                    return {
                        checkNetworkHealth: Ee
                    };
                }, void 0), xe = await ue(J().environment);
                w(xe);
            }
        }, 3e4);
        (async ()=>{
            try {
                const { checkNetworkHealth: ue } = await sr(async ()=>{
                    const { checkNetworkHealth: Ee } = await Promise.resolve().then(()=>Y_);
                    return {
                        checkNetworkHealth: Ee
                    };
                }, void 0), xe = await ue(J().environment);
                w(xe);
            } catch (ue) {
                console.error("[1AM] Initial health check failed:", ue);
            }
        })();
        const bw = async ()=>{
            const ue = J();
            if (!ue.dustSponsorship || ue.proofServerMode !== "proofstation") {
                k((xe)=>({
                        ...xe,
                        status: "off"
                    }));
                return;
            }
            try {
                const { checkSponsorHealth: xe } = await sr(async ()=>{
                    const { checkSponsorHealth: we } = await Promise.resolve().then(()=>Y_);
                    return {
                        checkSponsorHealth: we
                    };
                }, void 0), Ee = await xe(ue.proofServerUrl);
                k(Ee);
            } catch  {}
        };
        bw();
        const Q9 = setInterval(bw, 6e4);
        let mw = 0;
        const gb = 5e3, yw = ()=>{
            if (!pn || hn || i() || !_e || !je || !kt || r()) return;
            const ue = Date.now();
            ue - mw < gb || (mw = ue, Lt && (clearTimeout(Lt), Lt = null), hn = !0, fb().finally(()=>{
                hn = !1;
            }));
        }, ww = ()=>{
            document.visibilityState === "visible" && yw();
        }, _w = ()=>yw();
        document.addEventListener("visibilitychange", ww), window.addEventListener("focus", _w), It(async ()=>{
            if (document.removeEventListener("visibilitychange", ww), window.removeEventListener("focus", _w), Lt && (clearTimeout(Lt), Lt = null), Iot(), ah(), p(), clearInterval(hb), clearInterval(Q9), clearInterval(Y9), jn.forEach((ue)=>clearTimeout(ue)), jn.clear(), typeof document < "u" && (document.removeEventListener("click", lh), document.removeEventListener("keydown", lh)), rn) try {
                await gf(rn.serialize());
            } catch  {}
            Bs.flush(), an?.unsubscribe(), await _e?.stop();
        });
        const e5 = {
            isLoading: e,
            isSynced: r,
            syncProgress: a,
            error: l,
            networkHealth: m,
            sponsorHealth: v,
            shieldedBalances: _,
            unshieldedBalances: P,
            dustBalance: K,
            shieldedAddress: G,
            unshieldedAddress: ie,
            dustAddress: M,
            dustCoins: R,
            availableUtxoForDustGeneration: N,
            transactions: fe,
            paginatedTransactions: el,
            currentPage: Ce,
            totalPages: Ln,
            totalTransactions: ar,
            setCurrentPage: Ue,
            pendingTransactions: Ie,
            pendingCount: Ge,
            toasts: Hn,
            dismissToast: ya,
            addToast: An,
            isGeneratingDust: z,
            dustGenerationError: x,
            startDustGeneration: L9,
            sendTokens: z9,
            sendCardanoTokens: U9,
            refreshSync: fb,
            fullResync: pb,
            trackDAppTx: (ue, xe)=>{
                const Ee = crypto.randomUUID(), we = {
                    id: Ee,
                    type: "dapp",
                    amount: "0",
                    tokenType: "",
                    status: "submitting",
                    createdAt: Date.now(),
                    recipientAddress: `${ue} via ${xe}`
                };
                return Le((Pe)=>[
                        we,
                        ...Pe
                    ]), ui().catch((Pe)=>console.error("[Wallet] trackDAppTx persist failed:", Pe)), Ee;
            },
            resolveDAppTx: (ue, xe, Ee, we)=>{
                const Pe = Ee ? {
                    status: "failed",
                    error: Ee,
                    txHash: xe
                } : {
                    status: we ?? "pending",
                    txHash: xe
                };
                Le((ot)=>ot.map((Tt)=>Tt.id === ue ? {
                            ...Tt,
                            ...Pe
                        } : Tt)), ui().catch((ot)=>console.error("[Wallet] resolveDAppTx persist failed:", ot));
            },
            acquireTxLock: Sh,
            releaseTxLock: kh,
            isSecondaryContext: i,
            lockWallet: ub,
            deleteWallet: j9,
            formatBalance: to,
            getWallet: nl,
            getDustSecretKey: async ()=>{
                if (!kt) throw new Error("Wallet is locked");
                return kt;
            },
            getZswapSecretKeys: async ()=>{
                if (!je) throw new Error("Wallet is locked");
                return je;
            },
            getNightExternalKey: async ()=>{
                if (!nr) throw new Error("Wallet is locked");
                return nr;
            },
            get configuration () {
                return Wt;
            },
            sendTokensError: q,
            sendTokensStatus: Z,
            environmentSettings: J,
            updateSettings: H9,
            wallets: be,
            activeWalletId: le,
            switchWallet: sh,
            addWallet: q9,
            renameWallet: W9,
            removeWallet: K9,
            isSwitchingWallet: Re,
            activeAccountIndex: oe,
            switchAccount: ih,
            addAccount: db,
            renameAccount: fw,
            hideAccount: $9,
            unhideAccount: pw,
            cardanoAddress: D,
            cardanoBalance: E,
            cardanoLoading: re,
            cardanoError: me,
            cardanoEnabled: ut,
            cardanoHasMnemonic: Ut,
            setCardanoEnabled: G9,
            enableCardanoWithMnemonic: X9,
            generateCardanoDust: hw,
            updateCardanoDustReg: Z9,
            getVaultSeed: async ()=>(await Nh())?.seed ?? "",
            exportMnemonic: async (ue)=>{
                const xe = typeof ue == "string" ? new TextEncoder().encode(ue) : ue;
                try {
                    const { extractMnemonic: Ee } = await sr(async ()=>{
                        const { extractMnemonic: Pe } = await import("./export-mnemonic-96pGaLLi.js");
                        return {
                            extractMnemonic: Pe
                        };
                    }, []), { contents: we } = await sT(xe);
                    return Ee(we, le());
                } finally{
                    xe.fill(0);
                }
            }
        };
        return I(aee.Provider, {
            value: e5,
            get children () {
                return t.children;
            }
        });
    };
    lr = ()=>{
        const t = fs(aee);
        if (!t) throw new Error("useWallet must be used within a WalletProvider");
        return t;
    };
    var Vot = class {
        collection;
        direction;
        orientation;
        constructor(t, e, n){
            this.collection = t, this.direction = e, this.orientation = n;
        }
        flipDirection() {
            return this.direction() === "rtl" && this.orientation() === "horizontal";
        }
        getKeyLeftOf(t) {
            if (this.flipDirection()) return this.getNextKey(t);
            if (this.orientation() === "horizontal") return this.getPreviousKey(t);
        }
        getKeyRightOf(t) {
            if (this.flipDirection()) return this.getPreviousKey(t);
            if (this.orientation() === "horizontal") return this.getNextKey(t);
        }
        getKeyAbove(t) {
            if (this.orientation() === "vertical") return this.getPreviousKey(t);
        }
        getKeyBelow(t) {
            if (this.orientation() === "vertical") return this.getNextKey(t);
        }
        getFirstKey() {
            let t = this.collection().getFirstKey();
            return t == null ? void 0 : (this.collection().getItem(t)?.disabled && (t = this.getNextKey(t)), t);
        }
        getLastKey() {
            let t = this.collection().getLastKey();
            return t == null ? void 0 : (this.collection().getItem(t)?.disabled && (t = this.getPreviousKey(t)), t);
        }
        getNextKey(t) {
            let e = t, n;
            do if (e = this.collection().getKeyAfter(e) ?? this.collection().getFirstKey(), e == null || (n = this.collection().getItem(e), n == null)) return;
            while (n.disabled);
            return e;
        }
        getPreviousKey(t) {
            let e = t, n;
            do if (e = this.collection().getKeyBefore(e) ?? this.collection().getLastKey(), e == null || (n = this.collection().getItem(e), n == null)) return;
            while (n.disabled);
            return e;
        }
    };
    function cee(t) {
        let e = t.startIndex ?? 0;
        const n = t.startLevel ?? 0, r = [], s = (c)=>{
            if (c == null) return "";
            const l = t.getKey ?? "key", u = Ph(l) ? c[l] : l(c);
            return u != null ? String(u) : "";
        }, i = (c)=>{
            if (c == null) return "";
            const l = t.getTextValue ?? "textValue", u = Ph(l) ? c[l] : l(c);
            return u != null ? String(u) : "";
        }, o = (c)=>{
            if (c == null) return !1;
            const l = t.getDisabled ?? "disabled";
            return (Ph(l) ? c[l] : l(c)) ?? !1;
        }, a = (c)=>{
            if (c != null) return Ph(t.getSectionChildren) ? c[t.getSectionChildren] : t.getSectionChildren?.(c);
        };
        for (const c of t.dataSource){
            if (Ph(c) || wse(c)) {
                r.push({
                    type: "item",
                    rawValue: c,
                    key: String(c),
                    textValue: String(c),
                    disabled: o(c),
                    level: n,
                    index: e
                }), e++;
                continue;
            }
            if (a(c) != null) {
                r.push({
                    type: "section",
                    rawValue: c,
                    key: "",
                    textValue: "",
                    disabled: !1,
                    level: n,
                    index: e
                }), e++;
                const l = a(c) ?? [];
                if (l.length > 0) {
                    const u = cee({
                        dataSource: l,
                        getKey: t.getKey,
                        getTextValue: t.getTextValue,
                        getDisabled: t.getDisabled,
                        getSectionChildren: t.getSectionChildren,
                        startIndex: e,
                        startLevel: n + 1
                    });
                    r.push(...u), e += u.length;
                }
            } else r.push({
                type: "item",
                rawValue: c,
                key: s(c),
                textValue: i(c),
                disabled: o(c),
                level: n,
                index: e
            }), e++;
        }
        return r;
    }
    function Dot(t, e = []) {
        return Ct(()=>{
            const n = cee({
                dataSource: Ae(t.dataSource),
                getKey: Ae(t.getKey),
                getTextValue: Ae(t.getTextValue),
                getDisabled: Ae(t.getDisabled),
                getSectionChildren: Ae(t.getSectionChildren)
            });
            for(let r = 0; r < e.length; r++)e[r]();
            return t.factory(n);
        });
    }
    var Bot = new Set([
        "Avst",
        "Arab",
        "Armi",
        "Syrc",
        "Samr",
        "Mand",
        "Thaa",
        "Mend",
        "Nkoo",
        "Adlm",
        "Rohg",
        "Hebr"
    ]), Fot = new Set([
        "ae",
        "ar",
        "arc",
        "bcc",
        "bqi",
        "ckb",
        "dv",
        "fa",
        "glk",
        "he",
        "ku",
        "mzn",
        "nqo",
        "pnb",
        "ps",
        "sd",
        "ug",
        "ur",
        "yi"
    ]);
    function Lot(t) {
        if (Intl.Locale) {
            const n = new Intl.Locale(t).maximize().script ?? "";
            return Bot.has(n);
        }
        const e = t.split("-")[0];
        return Fot.has(e);
    }
    function zot(t) {
        return Lot(t) ? "rtl" : "ltr";
    }
    function lee() {
        let t = typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
        try {
            Intl.DateTimeFormat.supportedLocalesOf([
                t
            ]);
        } catch  {
            t = "en-US";
        }
        return {
            locale: t,
            direction: zot(t)
        };
    }
    var cT = lee(), pm = new Set;
    function fz() {
        cT = lee();
        for (const t of pm)t(cT);
    }
    function Uot() {
        const [t, e] = pe(cT), n = Ct(()=>t());
        return ga(()=>{
            pm.size === 0 && window.addEventListener("languagechange", fz), pm.add(e), It(()=>{
                pm.delete(e), pm.size === 0 && window.removeEventListener("languagechange", fz);
            });
        }), {
            locale: ()=>n().locale,
            direction: ()=>n().direction
        };
    }
    var Hot = ds();
    function Zc() {
        const t = Uot();
        return fs(Hot) || t;
    }
    var p7 = new Map;
    function uee(t) {
        const { locale: e } = Zc(), n = Ct(()=>e() + (t ? Object.entries(t).sort((r, s)=>r[0] < s[0] ? -1 : 1).join() : ""));
        return Ct(()=>{
            const r = n();
            let s;
            return p7.has(r) && (s = p7.get(r)), s || (s = new Intl.Collator(e(), t), p7.set(r, s)), s;
        });
    }
    var vc = class dee extends Set {
        anchorKey;
        currentKey;
        constructor(e, n, r){
            super(e), e instanceof dee ? (this.anchorKey = n || e.anchorKey, this.currentKey = r || e.currentKey) : (this.anchorKey = n, this.currentKey = r);
        }
    };
    function jot(t) {
        const [e, n] = eh(t);
        return [
            ()=>e() ?? new vc,
            n
        ];
    }
    function fee(t) {
        return kse() ? t.altKey : t.ctrlKey;
    }
    function Vh(t) {
        return Uy() ? t.metaKey : t.ctrlKey;
    }
    function pz(t) {
        return new vc(t);
    }
    function pee(t, e) {
        if (t.size !== e.size) return !1;
        for (const n of t)if (!e.has(n)) return !1;
        return !0;
    }
    function qot(t) {
        const e = qt({
            selectionMode: "none",
            selectionBehavior: "toggle"
        }, t), [n, r] = pe(!1), [s, i] = pe(), o = Ct(()=>{
            const m = Ae(e.selectedKeys);
            return m != null ? pz(m) : m;
        }), a = Ct(()=>{
            const m = Ae(e.defaultSelectedKeys);
            return m != null ? pz(m) : new vc;
        }), [c, l] = jot({
            value: o,
            defaultValue: a,
            onChange: (m)=>e.onSelectionChange?.(m)
        }), [u, d] = pe(Ae(e.selectionBehavior)), f = ()=>Ae(e.selectionMode), p = ()=>Ae(e.disallowEmptySelection) ?? !1, h = (m)=>{
            (Ae(e.allowDuplicateSelectionEvents) || !pee(m, c())) && l(m);
        };
        return lt(()=>{
            const m = c();
            Ae(e.selectionBehavior) === "replace" && u() === "toggle" && typeof m == "object" && m.size === 0 && d("replace");
        }), lt(()=>{
            d(Ae(e.selectionBehavior) ?? "toggle");
        }), {
            selectionMode: f,
            disallowEmptySelection: p,
            selectionBehavior: u,
            setSelectionBehavior: d,
            isFocused: n,
            setFocused: r,
            focusedKey: s,
            setFocusedKey: i,
            selectedKeys: c,
            setSelectedKeys: h
        };
    }
    function hee(t) {
        const [e, n] = pe(""), [r, s] = pe(-1);
        return {
            typeSelectHandlers: {
                onKeyDown: (o)=>{
                    if (Ae(t.isDisabled)) return;
                    const a = Ae(t.keyboardDelegate), c = Ae(t.selectionManager);
                    if (!a.getKeyForSearch) return;
                    const l = Wot(o.key);
                    if (!l || o.ctrlKey || o.metaKey) return;
                    l === " " && e().trim().length > 0 && (o.preventDefault(), o.stopPropagation());
                    let u = n((f)=>f + l), d = a.getKeyForSearch(u, c.focusedKey()) ?? a.getKeyForSearch(u);
                    d == null && Kot(u) && (u = u[0], d = a.getKeyForSearch(u, c.focusedKey()) ?? a.getKeyForSearch(u)), d != null && (c.setFocusedKey(d), t.onTypeSelect?.(d)), clearTimeout(r()), s(window.setTimeout(()=>n(""), 500));
                }
            }
        };
    }
    function Wot(t) {
        return t.length === 1 || !/^[A-Z]/i.test(t) ? t : "";
    }
    function Kot(t) {
        return t.split("").every((e)=>e === t[0]);
    }
    function gee(t, e, n) {
        const s = qe({
            selectOnFocus: ()=>Ae(t.selectionManager).selectionBehavior() === "replace"
        }, t), i = ()=>n?.() ?? e(), { direction: o } = Zc();
        let a = {
            top: 0,
            left: 0
        };
        hse(()=>Ae(s.isVirtualized) ? void 0 : i(), "scroll", ()=>{
            const w = i();
            w && (a = {
                top: w.scrollTop,
                left: w.scrollLeft
            });
        });
        const { typeSelectHandlers: c } = hee({
            isDisabled: ()=>Ae(s.disallowTypeAhead),
            keyboardDelegate: ()=>Ae(s.keyboardDelegate),
            selectionManager: ()=>Ae(s.selectionManager)
        }), l = ()=>Ae(s.orientation) ?? "vertical", u = (w)=>{
            $n(w, c.onKeyDown), w.altKey && w.key === "Tab" && w.preventDefault();
            const v = e();
            if (!v?.contains(w.target)) return;
            const k = Ae(s.selectionManager), _ = Ae(s.selectOnFocus), A = (X)=>{
                X != null && (k.setFocusedKey(X), w.shiftKey && k.selectionMode() === "multiple" ? k.extendSelection(X) : _ && !fee(w) && k.replaceSelection(X));
            }, P = Ae(s.keyboardDelegate), U = Ae(s.shouldFocusWrap), K = k.focusedKey();
            switch(w.key){
                case (l() === "vertical" ? "ArrowDown" : "ArrowRight"):
                    {
                        if (P.getKeyBelow) {
                            w.preventDefault();
                            let X;
                            K != null ? X = P.getKeyBelow(K) : X = P.getFirstKey?.(), X == null && U && (X = P.getFirstKey?.(K)), A(X);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowUp" : "ArrowLeft"):
                    {
                        if (P.getKeyAbove) {
                            w.preventDefault();
                            let X;
                            K != null ? X = P.getKeyAbove(K) : X = P.getLastKey?.(), X == null && U && (X = P.getLastKey?.(K)), A(X);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowLeft" : "ArrowUp"):
                    {
                        if (P.getKeyLeftOf) {
                            w.preventDefault();
                            const X = o() === "rtl";
                            let G;
                            K != null ? G = P.getKeyLeftOf(K) : G = X ? P.getFirstKey?.() : P.getLastKey?.(), A(G);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowRight" : "ArrowDown"):
                    {
                        if (P.getKeyRightOf) {
                            w.preventDefault();
                            const X = o() === "rtl";
                            let G;
                            K != null ? G = P.getKeyRightOf(K) : G = X ? P.getLastKey?.() : P.getFirstKey?.(), A(G);
                        }
                        break;
                    }
                case "Home":
                    if (P.getFirstKey) {
                        w.preventDefault();
                        const X = P.getFirstKey(K, Vh(w));
                        X != null && (k.setFocusedKey(X), Vh(w) && w.shiftKey && k.selectionMode() === "multiple" ? k.extendSelection(X) : _ && k.replaceSelection(X));
                    }
                    break;
                case "End":
                    if (P.getLastKey) {
                        w.preventDefault();
                        const X = P.getLastKey(K, Vh(w));
                        X != null && (k.setFocusedKey(X), Vh(w) && w.shiftKey && k.selectionMode() === "multiple" ? k.extendSelection(X) : _ && k.replaceSelection(X));
                    }
                    break;
                case "PageDown":
                    if (P.getKeyPageBelow && K != null) {
                        w.preventDefault();
                        const X = P.getKeyPageBelow(K);
                        A(X);
                    }
                    break;
                case "PageUp":
                    if (P.getKeyPageAbove && K != null) {
                        w.preventDefault();
                        const X = P.getKeyPageAbove(K);
                        A(X);
                    }
                    break;
                case "a":
                    Vh(w) && k.selectionMode() === "multiple" && Ae(s.disallowSelectAll) !== !0 && (w.preventDefault(), k.selectAll());
                    break;
                case "Escape":
                    w.defaultPrevented || (w.preventDefault(), Ae(s.disallowEmptySelection) || k.clearSelection());
                    break;
                case "Tab":
                    if (!Ae(s.allowsTabNavigation)) {
                        if (w.shiftKey) v.focus();
                        else {
                            const X = rH(v, {
                                tabbable: !0
                            });
                            let G, ce;
                            do ce = X.lastChild(), ce && (G = ce);
                            while (ce);
                            G && !G.contains(document.activeElement) && jr(G);
                        }
                        break;
                    }
            }
        }, d = (w)=>{
            const v = Ae(s.selectionManager), k = Ae(s.keyboardDelegate), _ = Ae(s.selectOnFocus);
            if (v.isFocused()) {
                w.currentTarget.contains(w.target) || v.setFocused(!1);
                return;
            }
            if (w.currentTarget.contains(w.target)) {
                if (v.setFocused(!0), v.focusedKey() == null) {
                    const A = (U)=>{
                        U != null && (v.setFocusedKey(U), _ && v.replaceSelection(U));
                    }, P = w.relatedTarget;
                    P && w.currentTarget.compareDocumentPosition(P) & Node.DOCUMENT_POSITION_FOLLOWING ? A(v.lastSelectedKey() ?? k.getLastKey?.()) : A(v.firstSelectedKey() ?? k.getFirstKey?.());
                } else if (!Ae(s.isVirtualized)) {
                    const A = i();
                    if (A) {
                        A.scrollTop = a.top, A.scrollLeft = a.left;
                        const P = A.querySelector(`[data-key="${v.focusedKey()}"]`);
                        P && (jr(P), Z7(A, P));
                    }
                }
            }
        }, f = (w)=>{
            const v = Ae(s.selectionManager);
            w.currentTarget.contains(w.relatedTarget) || v.setFocused(!1);
        }, p = (w)=>{
            i() === w.target && w.preventDefault();
        }, h = ()=>{
            const w = Ae(s.autoFocus);
            if (!w) return;
            const v = Ae(s.selectionManager), k = Ae(s.keyboardDelegate);
            let _;
            w === "first" && (_ = k.getFirstKey?.()), w === "last" && (_ = k.getLastKey?.());
            const A = v.selectedKeys();
            A.size && (_ = A.values().next().value), v.setFocused(!0), v.setFocusedKey(_);
            const P = e();
            P && _ == null && !Ae(s.shouldUseVirtualFocus) && jr(P);
        };
        return ga(()=>{
            s.deferAutoFocus ? setTimeout(h, 0) : h();
        }), lt(Ji([
            i,
            ()=>Ae(s.isVirtualized),
            ()=>Ae(s.selectionManager).focusedKey()
        ], (w)=>{
            const [v, k, _] = w;
            if (k) _ && s.scrollToKey?.(_);
            else if (_ && v) {
                const A = v.querySelector(`[data-key="${_}"]`);
                A && Z7(v, A);
            }
        })), {
            tabIndex: Ct(()=>{
                if (!Ae(s.shouldUseVirtualFocus)) return Ae(s.selectionManager).focusedKey() == null ? 0 : -1;
            }),
            onKeyDown: u,
            onMouseDown: p,
            onFocusIn: d,
            onFocusOut: f
        };
    }
    function S9(t, e) {
        const n = ()=>Ae(t.selectionManager), r = ()=>Ae(t.key), s = ()=>Ae(t.shouldUseVirtualFocus), i = (k)=>{
            n().selectionMode() !== "none" && (n().selectionMode() === "single" ? n().isSelected(r()) && !n().disallowEmptySelection() ? n().toggleSelection(r()) : n().replaceSelection(r()) : k?.shiftKey ? n().extendSelection(r()) : n().selectionBehavior() === "toggle" || Vh(k) || "pointerType" in k && k.pointerType === "touch" ? n().toggleSelection(r()) : n().replaceSelection(r()));
        }, o = ()=>n().isSelected(r()), a = ()=>Ae(t.disabled) || n().isDisabled(r()), c = ()=>!a() && n().canSelectItem(r());
        let l = null;
        const u = (k)=>{
            c() && (l = k.pointerType, k.pointerType === "mouse" && k.button === 0 && !Ae(t.shouldSelectOnPressUp) && i(k));
        }, d = (k)=>{
            c() && k.pointerType === "mouse" && k.button === 0 && Ae(t.shouldSelectOnPressUp) && Ae(t.allowsDifferentPressOrigin) && i(k);
        }, f = (k)=>{
            c() && (Ae(t.shouldSelectOnPressUp) && !Ae(t.allowsDifferentPressOrigin) || l !== "mouse") && i(k);
        }, p = (k)=>{
            !c() || ![
                "Enter",
                " "
            ].includes(k.key) || (fee(k) ? n().toggleSelection(r()) : i(k));
        }, h = (k)=>{
            a() && k.preventDefault();
        }, m = (k)=>{
            const _ = e();
            s() || a() || !_ || k.target === _ && n().setFocusedKey(r());
        }, w = Ct(()=>{
            if (!(s() || a())) return r() === n().focusedKey() ? 0 : -1;
        }), v = Ct(()=>Ae(t.virtualized) ? void 0 : r());
        return lt(Ji([
            e,
            r,
            s,
            ()=>n().focusedKey(),
            ()=>n().isFocused()
        ], ([k, _, A, P, U])=>{
            k && _ === P && U && !A && document.activeElement !== k && (t.focus ? t.focus() : jr(k));
        })), {
            isSelected: o,
            isDisabled: a,
            allowsSelection: c,
            tabIndex: w,
            dataKey: v,
            onPointerDown: u,
            onPointerUp: d,
            onClick: f,
            onKeyDown: p,
            onMouseDown: h,
            onFocus: m
        };
    }
    var $ot = class {
        collection;
        state;
        constructor(t, e){
            this.collection = t, this.state = e;
        }
        selectionMode() {
            return this.state.selectionMode();
        }
        disallowEmptySelection() {
            return this.state.disallowEmptySelection();
        }
        selectionBehavior() {
            return this.state.selectionBehavior();
        }
        setSelectionBehavior(t) {
            this.state.setSelectionBehavior(t);
        }
        isFocused() {
            return this.state.isFocused();
        }
        setFocused(t) {
            this.state.setFocused(t);
        }
        focusedKey() {
            return this.state.focusedKey();
        }
        setFocusedKey(t) {
            (t == null || this.collection().getItem(t)) && this.state.setFocusedKey(t);
        }
        selectedKeys() {
            return this.state.selectedKeys();
        }
        isSelected(t) {
            if (this.state.selectionMode() === "none") return !1;
            const e = this.getKey(t);
            return e == null ? !1 : this.state.selectedKeys().has(e);
        }
        isEmpty() {
            return this.state.selectedKeys().size === 0;
        }
        isSelectAll() {
            if (this.isEmpty()) return !1;
            const t = this.state.selectedKeys();
            return this.getAllSelectableKeys().every((e)=>t.has(e));
        }
        firstSelectedKey() {
            let t;
            for (const e of this.state.selectedKeys()){
                const n = this.collection().getItem(e), r = n?.index != null && t?.index != null && n.index < t.index;
                (!t || r) && (t = n);
            }
            return t?.key;
        }
        lastSelectedKey() {
            let t;
            for (const e of this.state.selectedKeys()){
                const n = this.collection().getItem(e), r = n?.index != null && t?.index != null && n.index > t.index;
                (!t || r) && (t = n);
            }
            return t?.key;
        }
        extendSelection(t) {
            if (this.selectionMode() === "none") return;
            if (this.selectionMode() === "single") {
                this.replaceSelection(t);
                return;
            }
            const e = this.getKey(t);
            if (e == null) return;
            const n = this.state.selectedKeys(), r = n.anchorKey || e, s = new vc(n, r, e);
            for (const i of this.getKeyRange(r, n.currentKey || e))s.delete(i);
            for (const i of this.getKeyRange(e, r))this.canSelectItem(i) && s.add(i);
            this.state.setSelectedKeys(s);
        }
        getKeyRange(t, e) {
            const n = this.collection().getItem(t), r = this.collection().getItem(e);
            return n && r ? n.index != null && r.index != null && n.index <= r.index ? this.getKeyRangeInternal(t, e) : this.getKeyRangeInternal(e, t) : [];
        }
        getKeyRangeInternal(t, e) {
            const n = [];
            let r = t;
            for(; r != null;){
                const s = this.collection().getItem(r);
                if (s && s.type === "item" && n.push(r), r === e) return n;
                r = this.collection().getKeyAfter(r);
            }
            return [];
        }
        getKey(t) {
            const e = this.collection().getItem(t);
            return e ? !e || e.type !== "item" ? null : e.key : t;
        }
        toggleSelection(t) {
            if (this.selectionMode() === "none") return;
            if (this.selectionMode() === "single" && !this.isSelected(t)) {
                this.replaceSelection(t);
                return;
            }
            const e = this.getKey(t);
            if (e == null) return;
            const n = new vc(this.state.selectedKeys());
            n.has(e) ? n.delete(e) : this.canSelectItem(e) && (n.add(e), n.anchorKey = e, n.currentKey = e), !(this.disallowEmptySelection() && n.size === 0) && this.state.setSelectedKeys(n);
        }
        replaceSelection(t) {
            if (this.selectionMode() === "none") return;
            const e = this.getKey(t);
            if (e == null) return;
            const n = this.canSelectItem(e) ? new vc([
                e
            ], e, e) : new vc;
            this.state.setSelectedKeys(n);
        }
        setSelectedKeys(t) {
            if (this.selectionMode() === "none") return;
            const e = new vc;
            for (const n of t){
                const r = this.getKey(n);
                if (r != null && (e.add(r), this.selectionMode() === "single")) break;
            }
            this.state.setSelectedKeys(e);
        }
        selectAll() {
            this.selectionMode() === "multiple" && this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()));
        }
        clearSelection() {
            const t = this.state.selectedKeys();
            !this.disallowEmptySelection() && t.size > 0 && this.state.setSelectedKeys(new vc);
        }
        toggleSelectAll() {
            this.isSelectAll() ? this.clearSelection() : this.selectAll();
        }
        select(t, e) {
            this.selectionMode() !== "none" && (this.selectionMode() === "single" ? this.isSelected(t) && !this.disallowEmptySelection() ? this.toggleSelection(t) : this.replaceSelection(t) : this.selectionBehavior() === "toggle" || e && e.pointerType === "touch" ? this.toggleSelection(t) : this.replaceSelection(t));
        }
        isSelectionEqual(t) {
            if (t === this.state.selectedKeys()) return !0;
            const e = this.selectedKeys();
            if (t.size !== e.size) return !1;
            for (const n of t)if (!e.has(n)) return !1;
            for (const n of e)if (!t.has(n)) return !1;
            return !0;
        }
        canSelectItem(t) {
            if (this.state.selectionMode() === "none") return !1;
            const e = this.collection().getItem(t);
            return e != null && !e.disabled;
        }
        isDisabled(t) {
            const e = this.collection().getItem(t);
            return !e || e.disabled;
        }
        getAllSelectableKeys() {
            const t = [];
            return ((n)=>{
                for(; n != null;){
                    if (this.canSelectItem(n)) {
                        const r = this.collection().getItem(n);
                        if (!r) continue;
                        r.type === "item" && t.push(n);
                    }
                    n = this.collection().getKeyAfter(n);
                }
            })(this.collection().getFirstKey()), t;
        }
    }, hz = class {
        keyMap = new Map;
        iterable;
        firstKey;
        lastKey;
        constructor(t){
            this.iterable = t;
            for (const r of t)this.keyMap.set(r.key, r);
            if (this.keyMap.size === 0) return;
            let e, n = 0;
            for (const [r, s] of this.keyMap)e ? (e.nextKey = r, s.prevKey = e.key) : (this.firstKey = r, s.prevKey = void 0), s.type === "item" && (s.index = n++), e = s, e.nextKey = void 0;
            this.lastKey = e.key;
        }
        *[Symbol.iterator]() {
            yield* this.iterable;
        }
        getSize() {
            return this.keyMap.size;
        }
        getKeys() {
            return this.keyMap.keys();
        }
        getKeyBefore(t) {
            return this.keyMap.get(t)?.prevKey;
        }
        getKeyAfter(t) {
            return this.keyMap.get(t)?.nextKey;
        }
        getFirstKey() {
            return this.firstKey;
        }
        getLastKey() {
            return this.lastKey;
        }
        getItem(t) {
            return this.keyMap.get(t);
        }
        at(t) {
            const e = [
                ...this.getKeys()
            ];
            return this.getItem(e[t]);
        }
    };
    function k9(t) {
        const e = qot(t), r = Dot({
            dataSource: ()=>Ae(t.dataSource),
            getKey: ()=>Ae(t.getKey),
            getTextValue: ()=>Ae(t.getTextValue),
            getDisabled: ()=>Ae(t.getDisabled),
            getSectionChildren: ()=>Ae(t.getSectionChildren),
            factory: (i)=>t.filter ? new hz(t.filter(i)) : new hz(i)
        }, [
            ()=>t.filter
        ]), s = new $ot(r, e);
        return Kte(()=>{
            const i = e.focusedKey();
            i != null && !r().getItem(i) && e.setFocusedKey(void 0);
        }), {
            collection: r,
            selectionManager: ()=>s
        };
    }
    var bee = ds();
    function mee() {
        return fs(bee);
    }
    function Xot() {
        const t = mee();
        if (t === void 0) throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");
        return t;
    }
    function yee(t, e) {
        return !!(e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_PRECEDING);
    }
    function Got(t, e) {
        const n = e.ref();
        if (!n) return -1;
        let r = t.length;
        if (!r) return -1;
        for(; r--;){
            const s = t[r]?.ref();
            if (s && yee(s, n)) return r + 1;
        }
        return 0;
    }
    function Zot(t) {
        const e = t.map((r, s)=>[
                s,
                r
            ]);
        let n = !1;
        return e.sort(([r, s], [i, o])=>{
            const a = s.ref(), c = o.ref();
            return a === c || !a || !c ? 0 : yee(a, c) ? (r > i && (n = !0), -1) : (r < i && (n = !0), 1);
        }), n ? e.map(([r, s])=>s) : t;
    }
    function wee(t, e) {
        const n = Zot(t);
        t !== n && e(n);
    }
    function Jot(t) {
        const e = t[0], n = t[t.length - 1]?.ref();
        let r = e?.ref()?.parentElement;
        for(; r;){
            if (n && r.contains(n)) return r;
            r = r.parentElement;
        }
        return Bc(r).body;
    }
    function Yot(t, e) {
        lt(()=>{
            const n = setTimeout(()=>{
                wee(t(), e);
            });
            It(()=>clearTimeout(n));
        });
    }
    function Qot(t, e) {
        if (typeof IntersectionObserver != "function") {
            Yot(t, e);
            return;
        }
        let n = [];
        lt(()=>{
            const r = ()=>{
                const o = !!n.length;
                n = t(), o && wee(t(), e);
            }, s = Jot(t()), i = new IntersectionObserver(r, {
                root: s
            });
            for (const o of t()){
                const a = o.ref();
                a && i.observe(a);
            }
            It(()=>i.disconnect());
        });
    }
    function _ee(t = {}) {
        const [e, n] = Yit({
            value: ()=>Ae(t.items),
            onChange: (i)=>t.onItemsChange?.(i)
        });
        Qot(e, n);
        const r = (i)=>(n((o)=>{
                const a = Got(o, i);
                return yse(o, i, a);
            }), ()=>{
                n((o)=>{
                    const a = o.filter((c)=>c.ref() !== i.ref());
                    return o.length === a.length ? o : a;
                });
            });
        return {
            DomCollectionProvider: (i)=>I(bee.Provider, {
                    value: {
                        registerItem: r
                    },
                    get children () {
                        return i.children;
                    }
                })
        };
    }
    function xee(t) {
        const e = Xot(), n = qt({
            shouldRegisterItem: !0
        }, t);
        lt(()=>{
            if (!n.shouldRegisterItem) return;
            const r = e.registerItem(n.getItem());
            It(r);
        });
    }
    function eat(t, e) {
        const n = new ResizeObserver(t);
        return It(n.disconnect.bind(n)), {
            observe: (r)=>n.observe(r, e),
            unobserve: n.unobserve.bind(n)
        };
    }
    function tat(t, e, n) {
        const r = new WeakMap, { observe: s, unobserve: i } = eat((o)=>{
            for (const a of o){
                const { contentRect: c, target: l } = a, u = Math.round(c.width), d = Math.round(c.height), f = r.get(l);
                (!f || f.width !== u || f.height !== d) && (e(c, l, a), r.set(l, {
                    width: u,
                    height: d
                }));
            }
        }, n);
        lt((o)=>{
            const a = cse(X7(Ae(t)));
            return fse(a, o, s, i), a;
        }, []);
    }
    var nat = {};
    bu(nat, {
        Content: ()=>BP,
        Indicator: ()=>FP,
        List: ()=>LP,
        Root: ()=>zP,
        Tabs: ()=>sat,
        Trigger: ()=>UP,
        useTabsContext: ()=>J1
    });
    var vee = ds();
    function J1() {
        const t = fs(vee);
        if (t === void 0) throw new Error("[kobalte]: `useTabsContext` must be used within a `Tabs` component");
        return t;
    }
    function BP(t) {
        const [e, n] = pe(), r = J1(), [s, i] = rt(t, [
            "ref",
            "id",
            "value",
            "forceMount"
        ]), [o, a] = pe(0), c = ()=>s.id ?? r.generateContentId(s.value), l = ()=>r.listState().selectedKey() === s.value, { present: u } = Ny({
            show: ()=>s.forceMount || l(),
            element: ()=>e() ?? null
        });
        return lt(Ji([
            ()=>e(),
            ()=>u()
        ], ([d, f])=>{
            if (d == null || !f) return;
            const p = ()=>{
                const m = rH(d, {
                    tabbable: !0
                });
                a(m.nextNode() ? void 0 : 0);
            };
            p();
            const h = new MutationObserver(p);
            h.observe(d, {
                subtree: !0,
                childList: !0,
                attributes: !0,
                attributeFilter: [
                    "tabindex",
                    "disabled"
                ]
            }), It(()=>{
                h.disconnect();
            });
        })), lt(Ji([
            ()=>s.value,
            c
        ], ([d, f])=>{
            r.contentIdsMap().set(d, f);
        })), I(de, {
            get when () {
                return u();
            },
            get children () {
                return I(yn, qe({
                    as: "div",
                    ref (d) {
                        var f = yr(n, s.ref);
                        typeof f == "function" && f(d);
                    },
                    get id () {
                        return c();
                    },
                    role: "tabpanel",
                    get tabIndex () {
                        return o();
                    },
                    get "aria-labelledby" () {
                        return r.triggerIdsMap().get(s.value);
                    },
                    get "data-orientation" () {
                        return r.orientation();
                    },
                    get "data-selected" () {
                        return l() ? "" : void 0;
                    }
                }, i));
            }
        });
    }
    function FP(t) {
        const e = J1(), [n, r] = rt(t, [
            "style"
        ]), [s, i] = pe({
            width: void 0,
            height: void 0
        }), { direction: o } = Zc(), a = ()=>{
            const f = e.selectedTab();
            if (f == null) return;
            const p = {
                transform: void 0,
                width: void 0,
                height: void 0
            }, h = o() === "rtl" ? -1 * (f.offsetParent?.offsetWidth - f.offsetWidth - f.offsetLeft) : f.offsetLeft;
            p.transform = e.orientation() === "vertical" ? `translateY(${f.offsetTop}px)` : `translateX(${h}px)`, e.orientation() === "horizontal" ? p.width = `${f.offsetWidth}px` : p.height = `${f.offsetHeight}px`, i(p);
        };
        ga(()=>{
            queueMicrotask(()=>{
                a();
            });
        }), lt(Ji([
            e.selectedTab,
            e.orientation,
            o
        ], ()=>{
            a();
        }, {
            defer: !0
        }));
        const [c, l] = pe(!1);
        let u = null, d = null;
        return tat(e.selectedTab, (f, p)=>{
            if (d !== p) {
                d = p;
                return;
            }
            l(!0), u && clearTimeout(u), u = setTimeout(()=>{
                u = null, l(!1);
            }, 1), a();
        }), I(yn, qe({
            as: "div",
            role: "presentation",
            get style () {
                return hg(s(), n.style);
            },
            get "data-orientation" () {
                return e.orientation();
            },
            get "data-resizing" () {
                return c();
            }
        }, r));
    }
    function LP(t) {
        let e;
        const n = J1(), [r, s] = rt(t, [
            "ref",
            "onKeyDown",
            "onMouseDown",
            "onFocusIn",
            "onFocusOut"
        ]), { direction: i } = Zc(), o = new Vot(()=>n.listState().collection(), i, n.orientation), a = gee({
            selectionManager: ()=>n.listState().selectionManager(),
            keyboardDelegate: ()=>o,
            selectOnFocus: ()=>n.activationMode() === "automatic",
            shouldFocusWrap: !1,
            disallowEmptySelection: !0
        }, ()=>e);
        return lt(()=>{
            if (e == null) return;
            const c = e.querySelector(`[data-key="${n.listState().selectedKey()}"]`);
            c != null && n.setSelectedTab(c);
        }), I(yn, qe({
            as: "div",
            ref (c) {
                var l = yr((u)=>e = u, r.ref);
                typeof l == "function" && l(c);
            },
            role: "tablist",
            get "aria-orientation" () {
                return n.orientation();
            },
            get "data-orientation" () {
                return n.orientation();
            },
            get onKeyDown () {
                return Yt([
                    r.onKeyDown,
                    a.onKeyDown
                ]);
            },
            get onMouseDown () {
                return Yt([
                    r.onMouseDown,
                    a.onMouseDown
                ]);
            },
            get onFocusIn () {
                return Yt([
                    r.onFocusIn,
                    a.onFocusIn
                ]);
            },
            get onFocusOut () {
                return Yt([
                    r.onFocusOut,
                    a.onFocusOut
                ]);
            }
        }, s));
    }
    function rat(t) {
        const [e, n] = eh({
            value: ()=>Ae(t.selectedKey),
            defaultValue: ()=>Ae(t.defaultSelectedKey),
            onChange: (l)=>t.onSelectionChange?.(l)
        }), r = Ct(()=>{
            const l = e();
            return l != null ? [
                l
            ] : [];
        }), [, s] = rt(t, [
            "onSelectionChange"
        ]), i = qe(s, {
            selectionMode: "single",
            disallowEmptySelection: !0,
            allowDuplicateSelectionEvents: !0,
            selectedKeys: r,
            onSelectionChange: (l)=>{
                const u = l.values().next().value;
                u === e() && t.onSelectionChange?.(u), n(u);
            }
        }), { collection: o, selectionManager: a } = k9(i), c = Ct(()=>{
            const l = e();
            return l != null ? o().getItem(l) : void 0;
        });
        return {
            collection: o,
            selectionManager: a,
            selectedKey: e,
            setSelectedKey: n,
            selectedItem: c
        };
    }
    function zP(t) {
        const e = `tabs-${ii()}`, n = qt({
            id: e,
            orientation: "horizontal",
            activationMode: "automatic"
        }, t), [r, s] = rt(n, [
            "value",
            "defaultValue",
            "onChange",
            "orientation",
            "activationMode",
            "disabled"
        ]), [i, o] = pe([]), [a, c] = pe(), { DomCollectionProvider: l } = _ee({
            items: i,
            onItemsChange: o
        }), u = rat({
            selectedKey: ()=>r.value,
            defaultSelectedKey: ()=>r.defaultValue,
            onSelectionChange: (m)=>r.onChange?.(String(m)),
            dataSource: i
        });
        let d = u.selectedKey();
        lt(Ji([
            ()=>u.selectionManager(),
            ()=>u.collection(),
            ()=>u.selectedKey()
        ], ([m, w, v])=>{
            let k = v;
            if (m.isEmpty() || k == null || !w.getItem(k)) {
                k = w.getFirstKey();
                let _ = k != null ? w.getItem(k) : void 0;
                for(; _?.disabled && _.key !== w.getLastKey();)k = w.getKeyAfter(_.key), _ = k != null ? w.getItem(k) : void 0;
                _?.disabled && k === w.getLastKey() && (k = w.getFirstKey()), k != null && m.setSelectedKeys([
                    k
                ]);
            }
            (m.focusedKey() == null || !m.isFocused() && k !== d) && m.setFocusedKey(k), d = k;
        }));
        const f = new Map, p = new Map, h = {
            isDisabled: ()=>r.disabled ?? !1,
            orientation: ()=>r.orientation,
            activationMode: ()=>r.activationMode,
            triggerIdsMap: ()=>f,
            contentIdsMap: ()=>p,
            listState: ()=>u,
            selectedTab: a,
            setSelectedTab: c,
            generateTriggerId: (m)=>`${s.id}-trigger-${m}`,
            generateContentId: (m)=>`${s.id}-content-${m}`
        };
        return I(l, {
            get children () {
                return I(vee.Provider, {
                    value: h,
                    get children () {
                        return I(yn, qe({
                            as: "div",
                            get "data-orientation" () {
                                return h.orientation();
                            }
                        }, s));
                    }
                });
            }
        });
    }
    function UP(t) {
        let e;
        const n = J1(), r = qt({
            type: "button"
        }, t), [s, i] = rt(r, [
            "ref",
            "id",
            "value",
            "disabled",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]), o = ()=>s.id ?? n.generateTriggerId(s.value), a = ()=>n.listState().selectionManager().focusedKey() === s.value, c = ()=>s.disabled || n.isDisabled(), l = ()=>n.contentIdsMap().get(s.value);
        xee({
            getItem: ()=>({
                    ref: ()=>e,
                    type: "item",
                    key: s.value,
                    textValue: "",
                    disabled: c()
                })
        });
        const u = S9({
            key: ()=>s.value,
            selectionManager: ()=>n.listState().selectionManager(),
            disabled: c
        }, ()=>e), d = (f)=>{
            QU() && jr(f.currentTarget);
        };
        return lt(Ji([
            ()=>s.value,
            o
        ], ([f, p])=>{
            n.triggerIdsMap().set(f, p);
        })), I(yn, qe({
            as: "button",
            ref (f) {
                var p = yr((h)=>e = h, s.ref);
                typeof p == "function" && p(f);
            },
            get id () {
                return o();
            },
            role: "tab",
            get tabIndex () {
                return Ze(()=>!c())() ? u.tabIndex() : void 0;
            },
            get disabled () {
                return c();
            },
            get "aria-selected" () {
                return u.isSelected();
            },
            get "aria-disabled" () {
                return c() || void 0;
            },
            get "aria-controls" () {
                return Ze(()=>!!u.isSelected())() ? l() : void 0;
            },
            get "data-key" () {
                return u.dataKey();
            },
            get "data-orientation" () {
                return n.orientation();
            },
            get "data-selected" () {
                return u.isSelected() ? "" : void 0;
            },
            get "data-highlighted" () {
                return a() ? "" : void 0;
            },
            get "data-disabled" () {
                return c() ? "" : void 0;
            },
            get onPointerDown () {
                return Yt([
                    s.onPointerDown,
                    u.onPointerDown
                ]);
            },
            get onPointerUp () {
                return Yt([
                    s.onPointerUp,
                    u.onPointerUp
                ]);
            },
            get onClick () {
                return Yt([
                    s.onClick,
                    u.onClick,
                    d
                ]);
            },
            get onKeyDown () {
                return Yt([
                    s.onKeyDown,
                    u.onKeyDown
                ]);
            },
            get onMouseDown () {
                return Yt([
                    s.onMouseDown,
                    u.onMouseDown
                ]);
            },
            get onFocus () {
                return Yt([
                    s.onFocus,
                    u.onFocus
                ]);
            }
        }, i));
    }
    var sat = Object.assign(zP, {
        Content: BP,
        Indicator: FP,
        List: LP,
        Trigger: UP
    });
    const iat = zP, oat = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(LP, qe({
            get class () {
                return xn("relative inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", e.class);
            }
        }, n));
    }, h7 = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "label"
        ]), r = e.label;
        return I(UP, qe({
            get class () {
                return xn("relative z-10 inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-[1px] focus-visible:ring-ring focus-visible:ring-offset-[1px] disabled:pointer-events-none disabled:opacity-50 data-[selected]:text-foreground", e.class);
            }
        }, r && {
            title: r,
            "aria-label": r
        }, n));
    }, g7 = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(BP, qe({
            get class () {
                return xn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-[1px] focus-visible:ring-ring focus-visible:ring-offset-[1px]", e.class);
            }
        }, n));
    }, aat = {
        line: "absolute bottom-0 left-0 z-0 h-[2px] rounded-none bg-foreground transition-[transform,width] duration-200 ease-out",
        pill: "absolute inset-y-1 left-0 z-0 rounded-md bg-background shadow-sm transition-[transform,width] duration-200 ease-out"
    }, cat = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "variant"
        ]), r = ()=>e.variant ?? "line";
        return I(FP, qe({
            get class () {
                return xn(aat[r()], e.class);
            }
        }, n));
    }, lat = [
        "top",
        "right",
        "bottom",
        "left"
    ], Ld = Math.min, uo = Math.max, Ux = Math.round, p_ = Math.floor, Vc = (t)=>({
            x: t,
            y: t
        }), uat = {
        left: "right",
        right: "left",
        bottom: "top",
        top: "bottom"
    };
    function lT(t, e, n) {
        return uo(t, Ld(e, n));
    }
    function th(t, e) {
        return typeof t == "function" ? t(e) : t;
    }
    function zd(t) {
        return t.split("-")[0];
    }
    function ib(t) {
        return t.split("-")[1];
    }
    function See(t) {
        return t === "x" ? "y" : "x";
    }
    function HP(t) {
        return t === "y" ? "height" : "width";
    }
    function Ll(t) {
        const e = t[0];
        return e === "t" || e === "b" ? "y" : "x";
    }
    function jP(t) {
        return See(Ll(t));
    }
    function dat(t, e, n) {
        n === void 0 && (n = !1);
        const r = ib(t), s = jP(t), i = HP(s);
        let o = s === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
        return e.reference[i] > e.floating[i] && (o = Hx(o)), [
            o,
            Hx(o)
        ];
    }
    function fat(t) {
        const e = Hx(t);
        return [
            uT(t),
            e,
            uT(e)
        ];
    }
    function uT(t) {
        return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
    }
    const gz = [
        "left",
        "right"
    ], bz = [
        "right",
        "left"
    ], pat = [
        "top",
        "bottom"
    ], hat = [
        "bottom",
        "top"
    ];
    function gat(t, e, n) {
        switch(t){
            case "top":
            case "bottom":
                return n ? e ? bz : gz : e ? gz : bz;
            case "left":
            case "right":
                return e ? pat : hat;
            default:
                return [];
        }
    }
    function bat(t, e, n, r) {
        const s = ib(t);
        let i = gat(zd(t), n === "start", r);
        return s && (i = i.map((o)=>o + "-" + s), e && (i = i.concat(i.map(uT)))), i;
    }
    function Hx(t) {
        const e = zd(t);
        return uat[e] + t.slice(e.length);
    }
    function mat(t) {
        return {
            top: 0,
            right: 0,
            bottom: 0,
            left: 0,
            ...t
        };
    }
    function kee(t) {
        return typeof t != "number" ? mat(t) : {
            top: t,
            right: t,
            bottom: t,
            left: t
        };
    }
    function jx(t) {
        const { x: e, y: n, width: r, height: s } = t;
        return {
            width: r,
            height: s,
            top: n,
            left: e,
            right: e + r,
            bottom: n + s,
            x: e,
            y: n
        };
    }
    function mz(t, e, n) {
        let { reference: r, floating: s } = t;
        const i = Ll(e), o = jP(e), a = HP(o), c = zd(e), l = i === "y", u = r.x + r.width / 2 - s.width / 2, d = r.y + r.height / 2 - s.height / 2, f = r[a] / 2 - s[a] / 2;
        let p;
        switch(c){
            case "top":
                p = {
                    x: u,
                    y: r.y - s.height
                };
                break;
            case "bottom":
                p = {
                    x: u,
                    y: r.y + r.height
                };
                break;
            case "right":
                p = {
                    x: r.x + r.width,
                    y: d
                };
                break;
            case "left":
                p = {
                    x: r.x - s.width,
                    y: d
                };
                break;
            default:
                p = {
                    x: r.x,
                    y: r.y
                };
        }
        switch(ib(e)){
            case "start":
                p[o] -= f * (n && l ? -1 : 1);
                break;
            case "end":
                p[o] += f * (n && l ? -1 : 1);
                break;
        }
        return p;
    }
    async function yat(t, e) {
        var n;
        e === void 0 && (e = {});
        const { x: r, y: s, platform: i, rects: o, elements: a, strategy: c } = t, { boundary: l = "clippingAncestors", rootBoundary: u = "viewport", elementContext: d = "floating", altBoundary: f = !1, padding: p = 0 } = th(e, t), h = kee(p), w = a[f ? d === "floating" ? "reference" : "floating" : d], v = jx(await i.getClippingRect({
            element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
            boundary: l,
            rootBoundary: u,
            strategy: c
        })), k = d === "floating" ? {
            x: r,
            y: s,
            width: o.floating.width,
            height: o.floating.height
        } : o.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), A = await (i.isElement == null ? void 0 : i.isElement(_)) ? await (i.getScale == null ? void 0 : i.getScale(_)) || {
            x: 1,
            y: 1
        } : {
            x: 1,
            y: 1
        }, P = jx(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
            elements: a,
            rect: k,
            offsetParent: _,
            strategy: c
        }) : k);
        return {
            top: (v.top - P.top + h.top) / A.y,
            bottom: (P.bottom - v.bottom + h.bottom) / A.y,
            left: (v.left - P.left + h.left) / A.x,
            right: (P.right - v.right + h.right) / A.x
        };
    }
    const wat = 50, _at = async (t, e, n)=>{
        const { placement: r = "bottom", strategy: s = "absolute", middleware: i = [], platform: o } = n, a = o.detectOverflow ? o : {
            ...o,
            detectOverflow: yat
        }, c = await (o.isRTL == null ? void 0 : o.isRTL(e));
        let l = await o.getElementRects({
            reference: t,
            floating: e,
            strategy: s
        }), { x: u, y: d } = mz(l, r, c), f = r, p = 0;
        const h = {};
        for(let m = 0; m < i.length; m++){
            const w = i[m];
            if (!w) continue;
            const { name: v, fn: k } = w, { x: _, y: A, data: P, reset: U } = await k({
                x: u,
                y: d,
                initialPlacement: r,
                placement: f,
                strategy: s,
                middlewareData: h,
                rects: l,
                platform: a,
                elements: {
                    reference: t,
                    floating: e
                }
            });
            u = _ ?? u, d = A ?? d, h[v] = {
                ...h[v],
                ...P
            }, U && p < wat && (p++, typeof U == "object" && (U.placement && (f = U.placement), U.rects && (l = U.rects === !0 ? await o.getElementRects({
                reference: t,
                floating: e,
                strategy: s
            }) : U.rects), { x: u, y: d } = mz(l, f, c)), m = -1);
        }
        return {
            x: u,
            y: d,
            placement: f,
            strategy: s,
            middlewareData: h
        };
    }, xat = (t)=>({
            name: "arrow",
            options: t,
            async fn (e) {
                const { x: n, y: r, placement: s, rects: i, platform: o, elements: a, middlewareData: c } = e, { element: l, padding: u = 0 } = th(t, e) || {};
                if (l == null) return {};
                const d = kee(u), f = {
                    x: n,
                    y: r
                }, p = jP(s), h = HP(p), m = await o.getDimensions(l), w = p === "y", v = w ? "top" : "left", k = w ? "bottom" : "right", _ = w ? "clientHeight" : "clientWidth", A = i.reference[h] + i.reference[p] - f[p] - i.floating[h], P = f[p] - i.reference[p], U = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
                let K = U ? U[_] : 0;
                (!K || !await (o.isElement == null ? void 0 : o.isElement(U))) && (K = a.floating[_] || i.floating[h]);
                const X = A / 2 - P / 2, G = K / 2 - m[h] / 2 - 1, ce = Ld(d[v], G), ie = Ld(d[k], G), Y = ce, M = K - m[h] - ie, g = K / 2 - m[h] / 2 + X, y = lT(Y, g, M), C = !c.arrow && ib(s) != null && g !== y && i.reference[h] / 2 - (g < Y ? ce : ie) - m[h] / 2 < 0, R = C ? g < Y ? g - Y : g - M : 0;
                return {
                    [p]: f[p] + R,
                    data: {
                        [p]: y,
                        centerOffset: g - y - R,
                        ...C && {
                            alignmentOffset: R
                        }
                    },
                    reset: C
                };
            }
        }), vat = function(t) {
        return t === void 0 && (t = {}), {
            name: "flip",
            options: t,
            async fn (e) {
                var n, r;
                const { placement: s, middlewareData: i, rects: o, initialPlacement: a, platform: c, elements: l } = e, { mainAxis: u = !0, crossAxis: d = !0, fallbackPlacements: f, fallbackStrategy: p = "bestFit", fallbackAxisSideDirection: h = "none", flipAlignment: m = !0, ...w } = th(t, e);
                if ((n = i.arrow) != null && n.alignmentOffset) return {};
                const v = zd(s), k = Ll(a), _ = zd(a) === a, A = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), P = f || (_ || !m ? [
                    Hx(a)
                ] : fat(a)), U = h !== "none";
                !f && U && P.push(...bat(a, m, h, A));
                const K = [
                    a,
                    ...P
                ], X = await c.detectOverflow(e, w), G = [];
                let ce = ((r = i.flip) == null ? void 0 : r.overflows) || [];
                if (u && G.push(X[v]), d) {
                    const g = dat(s, o, A);
                    G.push(X[g[0]], X[g[1]]);
                }
                if (ce = [
                    ...ce,
                    {
                        placement: s,
                        overflows: G
                    }
                ], !G.every((g)=>g <= 0)) {
                    var ie, Y;
                    const g = (((ie = i.flip) == null ? void 0 : ie.index) || 0) + 1, y = K[g];
                    if (y && (!(d === "alignment" ? k !== Ll(y) : !1) || ce.every((N)=>Ll(N.placement) === k ? N.overflows[0] > 0 : !0))) return {
                        data: {
                            index: g,
                            overflows: ce
                        },
                        reset: {
                            placement: y
                        }
                    };
                    let C = (Y = ce.filter((R)=>R.overflows[0] <= 0).sort((R, N)=>R.overflows[1] - N.overflows[1])[0]) == null ? void 0 : Y.placement;
                    if (!C) switch(p){
                        case "bestFit":
                            {
                                var M;
                                const R = (M = ce.filter((N)=>{
                                    if (U) {
                                        const L = Ll(N.placement);
                                        return L === k || L === "y";
                                    }
                                    return !0;
                                }).map((N)=>[
                                        N.placement,
                                        N.overflows.filter((L)=>L > 0).reduce((L, z)=>L + z, 0)
                                    ]).sort((N, L)=>N[1] - L[1])[0]) == null ? void 0 : M[0];
                                R && (C = R);
                                break;
                            }
                        case "initialPlacement":
                            C = a;
                            break;
                    }
                    if (s !== C) return {
                        reset: {
                            placement: C
                        }
                    };
                }
                return {};
            }
        };
    };
    function yz(t, e) {
        return {
            top: t.top - e.height,
            right: t.right - e.width,
            bottom: t.bottom - e.height,
            left: t.left - e.width
        };
    }
    function wz(t) {
        return lat.some((e)=>t[e] >= 0);
    }
    const Sat = function(t) {
        return t === void 0 && (t = {}), {
            name: "hide",
            options: t,
            async fn (e) {
                const { rects: n, platform: r } = e, { strategy: s = "referenceHidden", ...i } = th(t, e);
                switch(s){
                    case "referenceHidden":
                        {
                            const o = await r.detectOverflow(e, {
                                ...i,
                                elementContext: "reference"
                            }), a = yz(o, n.reference);
                            return {
                                data: {
                                    referenceHiddenOffsets: a,
                                    referenceHidden: wz(a)
                                }
                            };
                        }
                    case "escaped":
                        {
                            const o = await r.detectOverflow(e, {
                                ...i,
                                altBoundary: !0
                            }), a = yz(o, n.floating);
                            return {
                                data: {
                                    escapedOffsets: a,
                                    escaped: wz(a)
                                }
                            };
                        }
                    default:
                        return {};
                }
            }
        };
    }, kat = new Set([
        "left",
        "top"
    ]);
    async function Tat(t, e) {
        const { placement: n, platform: r, elements: s } = t, i = await (r.isRTL == null ? void 0 : r.isRTL(s.floating)), o = zd(n), a = ib(n), c = Ll(n) === "y", l = kat.has(o) ? -1 : 1, u = i && c ? -1 : 1, d = th(e, t);
        let { mainAxis: f, crossAxis: p, alignmentAxis: h } = typeof d == "number" ? {
            mainAxis: d,
            crossAxis: 0,
            alignmentAxis: null
        } : {
            mainAxis: d.mainAxis || 0,
            crossAxis: d.crossAxis || 0,
            alignmentAxis: d.alignmentAxis
        };
        return a && typeof h == "number" && (p = a === "end" ? h * -1 : h), c ? {
            x: p * u,
            y: f * l
        } : {
            x: f * l,
            y: p * u
        };
    }
    const Cat = function(t) {
        return t === void 0 && (t = 0), {
            name: "offset",
            options: t,
            async fn (e) {
                var n, r;
                const { x: s, y: i, placement: o, middlewareData: a } = e, c = await Tat(e, t);
                return o === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : {
                    x: s + c.x,
                    y: i + c.y,
                    data: {
                        ...c,
                        placement: o
                    }
                };
            }
        };
    }, Eat = function(t) {
        return t === void 0 && (t = {}), {
            name: "shift",
            options: t,
            async fn (e) {
                const { x: n, y: r, placement: s, platform: i } = e, { mainAxis: o = !0, crossAxis: a = !1, limiter: c = {
                    fn: (v)=>{
                        let { x: k, y: _ } = v;
                        return {
                            x: k,
                            y: _
                        };
                    }
                }, ...l } = th(t, e), u = {
                    x: n,
                    y: r
                }, d = await i.detectOverflow(e, l), f = Ll(zd(s)), p = See(f);
                let h = u[p], m = u[f];
                if (o) {
                    const v = p === "y" ? "top" : "left", k = p === "y" ? "bottom" : "right", _ = h + d[v], A = h - d[k];
                    h = lT(_, h, A);
                }
                if (a) {
                    const v = f === "y" ? "top" : "left", k = f === "y" ? "bottom" : "right", _ = m + d[v], A = m - d[k];
                    m = lT(_, m, A);
                }
                const w = c.fn({
                    ...e,
                    [p]: h,
                    [f]: m
                });
                return {
                    ...w,
                    data: {
                        x: w.x - n,
                        y: w.y - r,
                        enabled: {
                            [p]: o,
                            [f]: a
                        }
                    }
                };
            }
        };
    }, Iat = function(t) {
        return t === void 0 && (t = {}), {
            name: "size",
            options: t,
            async fn (e) {
                var n, r;
                const { placement: s, rects: i, platform: o, elements: a } = e, { apply: c = ()=>{}, ...l } = th(t, e), u = await o.detectOverflow(e, l), d = zd(s), f = ib(s), p = Ll(s) === "y", { width: h, height: m } = i.floating;
                let w, v;
                d === "top" || d === "bottom" ? (w = d, v = f === (await (o.isRTL == null ? void 0 : o.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (v = d, w = f === "end" ? "top" : "bottom");
                const k = m - u.top - u.bottom, _ = h - u.left - u.right, A = Ld(m - u[w], k), P = Ld(h - u[v], _), U = !e.middlewareData.shift;
                let K = A, X = P;
                if ((n = e.middlewareData.shift) != null && n.enabled.x && (X = _), (r = e.middlewareData.shift) != null && r.enabled.y && (K = k), U && !f) {
                    const ce = uo(u.left, 0), ie = uo(u.right, 0), Y = uo(u.top, 0), M = uo(u.bottom, 0);
                    p ? X = h - 2 * (ce !== 0 || ie !== 0 ? ce + ie : uo(u.left, u.right)) : K = m - 2 * (Y !== 0 || M !== 0 ? Y + M : uo(u.top, u.bottom));
                }
                await c({
                    ...e,
                    availableWidth: X,
                    availableHeight: K
                });
                const G = await o.getDimensions(a.floating);
                return h !== G.width || m !== G.height ? {
                    reset: {
                        rects: !0
                    }
                } : {};
            }
        };
    };
    function T9() {
        return typeof window < "u";
    }
    function ob(t) {
        return Tee(t) ? (t.nodeName || "").toLowerCase() : "#document";
    }
    function ko(t) {
        var e;
        return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
    }
    function Jc(t) {
        var e;
        return (e = (Tee(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
    }
    function Tee(t) {
        return T9() ? t instanceof Node || t instanceof ko(t).Node : !1;
    }
    function Ka(t) {
        return T9() ? t instanceof Element || t instanceof ko(t).Element : !1;
    }
    function Eu(t) {
        return T9() ? t instanceof HTMLElement || t instanceof ko(t).HTMLElement : !1;
    }
    function _z(t) {
        return !T9() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof ko(t).ShadowRoot;
    }
    function Y1(t) {
        const { overflow: e, overflowX: n, overflowY: r, display: s } = $a(t);
        return /auto|scroll|overlay|hidden|clip/.test(e + r + n) && s !== "inline" && s !== "contents";
    }
    function Aat(t) {
        return /^(table|td|th)$/.test(ob(t));
    }
    function C9(t) {
        try {
            if (t.matches(":popover-open")) return !0;
        } catch  {}
        try {
            return t.matches(":modal");
        } catch  {
            return !1;
        }
    }
    const Pat = /transform|translate|scale|rotate|perspective|filter/, Oat = /paint|layout|strict|content/, bf = (t)=>!!t && t !== "none";
    let b7;
    function qP(t) {
        const e = Ka(t) ? $a(t) : t;
        return bf(e.transform) || bf(e.translate) || bf(e.scale) || bf(e.rotate) || bf(e.perspective) || !WP() && (bf(e.backdropFilter) || bf(e.filter)) || Pat.test(e.willChange || "") || Oat.test(e.contain || "");
    }
    function Mat(t) {
        let e = Ud(t);
        for(; Eu(e) && !ag(e);){
            if (qP(e)) return e;
            if (C9(e)) return null;
            e = Ud(e);
        }
        return null;
    }
    function WP() {
        return b7 == null && (b7 = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), b7;
    }
    function ag(t) {
        return /^(html|body|#document)$/.test(ob(t));
    }
    function $a(t) {
        return ko(t).getComputedStyle(t);
    }
    function E9(t) {
        return Ka(t) ? {
            scrollLeft: t.scrollLeft,
            scrollTop: t.scrollTop
        } : {
            scrollLeft: t.scrollX,
            scrollTop: t.scrollY
        };
    }
    function Ud(t) {
        if (ob(t) === "html") return t;
        const e = t.assignedSlot || t.parentNode || _z(t) && t.host || Jc(t);
        return _z(e) ? e.host : e;
    }
    function Cee(t) {
        const e = Ud(t);
        return ag(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : Eu(e) && Y1(e) ? e : Cee(e);
    }
    function Dy(t, e, n) {
        var r;
        e === void 0 && (e = []), n === void 0 && (n = !0);
        const s = Cee(t), i = s === ((r = t.ownerDocument) == null ? void 0 : r.body), o = ko(s);
        if (i) {
            const a = dT(o);
            return e.concat(o, o.visualViewport || [], Y1(s) ? s : [], a && n ? Dy(a) : []);
        } else return e.concat(s, Dy(s, [], n));
    }
    function dT(t) {
        return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
    }
    function Eee(t) {
        const e = $a(t);
        let n = parseFloat(e.width) || 0, r = parseFloat(e.height) || 0;
        const s = Eu(t), i = s ? t.offsetWidth : n, o = s ? t.offsetHeight : r, a = Ux(n) !== i || Ux(r) !== o;
        return a && (n = i, r = o), {
            width: n,
            height: r,
            $: a
        };
    }
    function KP(t) {
        return Ka(t) ? t : t.contextElement;
    }
    function r0(t) {
        const e = KP(t);
        if (!Eu(e)) return Vc(1);
        const n = e.getBoundingClientRect(), { width: r, height: s, $: i } = Eee(e);
        let o = (i ? Ux(n.width) : n.width) / r, a = (i ? Ux(n.height) : n.height) / s;
        return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
            x: o,
            y: a
        };
    }
    const Rat = Vc(0);
    function Iee(t) {
        const e = ko(t);
        return !WP() || !e.visualViewport ? Rat : {
            x: e.visualViewport.offsetLeft,
            y: e.visualViewport.offsetTop
        };
    }
    function Nat(t, e, n) {
        return e === void 0 && (e = !1), !n || e && n !== ko(t) ? !1 : e;
    }
    function Cp(t, e, n, r) {
        e === void 0 && (e = !1), n === void 0 && (n = !1);
        const s = t.getBoundingClientRect(), i = KP(t);
        let o = Vc(1);
        e && (r ? Ka(r) && (o = r0(r)) : o = r0(t));
        const a = Nat(i, n, r) ? Iee(i) : Vc(0);
        let c = (s.left + a.x) / o.x, l = (s.top + a.y) / o.y, u = s.width / o.x, d = s.height / o.y;
        if (i) {
            const f = ko(i), p = r && Ka(r) ? ko(r) : r;
            let h = f, m = dT(h);
            for(; m && r && p !== h;){
                const w = r0(m), v = m.getBoundingClientRect(), k = $a(m), _ = v.left + (m.clientLeft + parseFloat(k.paddingLeft)) * w.x, A = v.top + (m.clientTop + parseFloat(k.paddingTop)) * w.y;
                c *= w.x, l *= w.y, u *= w.x, d *= w.y, c += _, l += A, h = ko(m), m = dT(h);
            }
        }
        return jx({
            width: u,
            height: d,
            x: c,
            y: l
        });
    }
    function I9(t, e) {
        const n = E9(t).scrollLeft;
        return e ? e.left + n : Cp(Jc(t)).left + n;
    }
    function Aee(t, e) {
        const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - I9(t, n), s = n.top + e.scrollTop;
        return {
            x: r,
            y: s
        };
    }
    function Vat(t) {
        let { elements: e, rect: n, offsetParent: r, strategy: s } = t;
        const i = s === "fixed", o = Jc(r), a = e ? C9(e.floating) : !1;
        if (r === o || a && i) return n;
        let c = {
            scrollLeft: 0,
            scrollTop: 0
        }, l = Vc(1);
        const u = Vc(0), d = Eu(r);
        if ((d || !d && !i) && ((ob(r) !== "body" || Y1(o)) && (c = E9(r)), d)) {
            const p = Cp(r);
            l = r0(r), u.x = p.x + r.clientLeft, u.y = p.y + r.clientTop;
        }
        const f = o && !d && !i ? Aee(o, c) : Vc(0);
        return {
            width: n.width * l.x,
            height: n.height * l.y,
            x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
            y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
        };
    }
    function Dat(t) {
        return Array.from(t.getClientRects());
    }
    function Bat(t) {
        const e = Jc(t), n = E9(t), r = t.ownerDocument.body, s = uo(e.scrollWidth, e.clientWidth, r.scrollWidth, r.clientWidth), i = uo(e.scrollHeight, e.clientHeight, r.scrollHeight, r.clientHeight);
        let o = -n.scrollLeft + I9(t);
        const a = -n.scrollTop;
        return $a(r).direction === "rtl" && (o += uo(e.clientWidth, r.clientWidth) - s), {
            width: s,
            height: i,
            x: o,
            y: a
        };
    }
    const xz = 25;
    function Fat(t, e) {
        const n = ko(t), r = Jc(t), s = n.visualViewport;
        let i = r.clientWidth, o = r.clientHeight, a = 0, c = 0;
        if (s) {
            i = s.width, o = s.height;
            const u = WP();
            (!u || u && e === "fixed") && (a = s.offsetLeft, c = s.offsetTop);
        }
        const l = I9(r);
        if (l <= 0) {
            const u = r.ownerDocument, d = u.body, f = getComputedStyle(d), p = u.compatMode === "CSS1Compat" && parseFloat(f.marginLeft) + parseFloat(f.marginRight) || 0, h = Math.abs(r.clientWidth - d.clientWidth - p);
            h <= xz && (i -= h);
        } else l <= xz && (i += l);
        return {
            width: i,
            height: o,
            x: a,
            y: c
        };
    }
    function Lat(t, e) {
        const n = Cp(t, !0, e === "fixed"), r = n.top + t.clientTop, s = n.left + t.clientLeft, i = Eu(t) ? r0(t) : Vc(1), o = t.clientWidth * i.x, a = t.clientHeight * i.y, c = s * i.x, l = r * i.y;
        return {
            width: o,
            height: a,
            x: c,
            y: l
        };
    }
    function vz(t, e, n) {
        let r;
        if (e === "viewport") r = Fat(t, n);
        else if (e === "document") r = Bat(Jc(t));
        else if (Ka(e)) r = Lat(e, n);
        else {
            const s = Iee(t);
            r = {
                x: e.x - s.x,
                y: e.y - s.y,
                width: e.width,
                height: e.height
            };
        }
        return jx(r);
    }
    function Pee(t, e) {
        const n = Ud(t);
        return n === e || !Ka(n) || ag(n) ? !1 : $a(n).position === "fixed" || Pee(n, e);
    }
    function zat(t, e) {
        const n = e.get(t);
        if (n) return n;
        let r = Dy(t, [], !1).filter((a)=>Ka(a) && ob(a) !== "body"), s = null;
        const i = $a(t).position === "fixed";
        let o = i ? Ud(t) : t;
        for(; Ka(o) && !ag(o);){
            const a = $a(o), c = qP(o);
            !c && a.position === "fixed" && (s = null), (i ? !c && !s : !c && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") || Y1(o) && !c && Pee(t, o)) ? r = r.filter((u)=>u !== o) : s = a, o = Ud(o);
        }
        return e.set(t, r), r;
    }
    function Uat(t) {
        let { element: e, boundary: n, rootBoundary: r, strategy: s } = t;
        const o = [
            ...n === "clippingAncestors" ? C9(e) ? [] : zat(e, this._c) : [].concat(n),
            r
        ], a = vz(e, o[0], s);
        let c = a.top, l = a.right, u = a.bottom, d = a.left;
        for(let f = 1; f < o.length; f++){
            const p = vz(e, o[f], s);
            c = uo(p.top, c), l = Ld(p.right, l), u = Ld(p.bottom, u), d = uo(p.left, d);
        }
        return {
            width: l - d,
            height: u - c,
            x: d,
            y: c
        };
    }
    function Hat(t) {
        const { width: e, height: n } = Eee(t);
        return {
            width: e,
            height: n
        };
    }
    function jat(t, e, n) {
        const r = Eu(e), s = Jc(e), i = n === "fixed", o = Cp(t, !0, i, e);
        let a = {
            scrollLeft: 0,
            scrollTop: 0
        };
        const c = Vc(0);
        function l() {
            c.x = I9(s);
        }
        if (r || !r && !i) if ((ob(e) !== "body" || Y1(s)) && (a = E9(e)), r) {
            const p = Cp(e, !0, i, e);
            c.x = p.x + e.clientLeft, c.y = p.y + e.clientTop;
        } else s && l();
        i && !r && s && l();
        const u = s && !r && !i ? Aee(s, a) : Vc(0), d = o.left + a.scrollLeft - c.x - u.x, f = o.top + a.scrollTop - c.y - u.y;
        return {
            x: d,
            y: f,
            width: o.width,
            height: o.height
        };
    }
    function m7(t) {
        return $a(t).position === "static";
    }
    function Sz(t, e) {
        if (!Eu(t) || $a(t).position === "fixed") return null;
        if (e) return e(t);
        let n = t.offsetParent;
        return Jc(t) === n && (n = n.ownerDocument.body), n;
    }
    function Oee(t, e) {
        const n = ko(t);
        if (C9(t)) return n;
        if (!Eu(t)) {
            let s = Ud(t);
            for(; s && !ag(s);){
                if (Ka(s) && !m7(s)) return s;
                s = Ud(s);
            }
            return n;
        }
        let r = Sz(t, e);
        for(; r && Aat(r) && m7(r);)r = Sz(r, e);
        return r && ag(r) && m7(r) && !qP(r) ? n : r || Mat(t) || n;
    }
    const qat = async function(t) {
        const e = this.getOffsetParent || Oee, n = this.getDimensions, r = await n(t.floating);
        return {
            reference: jat(t.reference, await e(t.floating), t.strategy),
            floating: {
                x: 0,
                y: 0,
                width: r.width,
                height: r.height
            }
        };
    };
    function Wat(t) {
        return $a(t).direction === "rtl";
    }
    const Mee = {
        convertOffsetParentRelativeRectToViewportRelativeRect: Vat,
        getDocumentElement: Jc,
        getClippingRect: Uat,
        getOffsetParent: Oee,
        getElementRects: qat,
        getClientRects: Dat,
        getDimensions: Hat,
        getScale: r0,
        isElement: Ka,
        isRTL: Wat
    };
    function Ree(t, e) {
        return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
    }
    function Kat(t, e) {
        let n = null, r;
        const s = Jc(t);
        function i() {
            var a;
            clearTimeout(r), (a = n) == null || a.disconnect(), n = null;
        }
        function o(a, c) {
            a === void 0 && (a = !1), c === void 0 && (c = 1), i();
            const l = t.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
            if (a || e(), !f || !p) return;
            const h = p_(d), m = p_(s.clientWidth - (u + f)), w = p_(s.clientHeight - (d + p)), v = p_(u), _ = {
                rootMargin: -h + "px " + -m + "px " + -w + "px " + -v + "px",
                threshold: uo(0, Ld(1, c)) || 1
            };
            let A = !0;
            function P(U) {
                const K = U[0].intersectionRatio;
                if (K !== c) {
                    if (!A) return o();
                    K ? o(!1, K) : r = setTimeout(()=>{
                        o(!1, 1e-7);
                    }, 1e3);
                }
                K === 1 && !Ree(l, t.getBoundingClientRect()) && o(), A = !1;
            }
            try {
                n = new IntersectionObserver(P, {
                    ..._,
                    root: s.ownerDocument
                });
            } catch  {
                n = new IntersectionObserver(P, _);
            }
            n.observe(t);
        }
        return o(!0), i;
    }
    function $at(t, e, n, r) {
        r === void 0 && (r = {});
        const { ancestorScroll: s = !0, ancestorResize: i = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: a = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = KP(t), u = s || i ? [
            ...l ? Dy(l) : [],
            ...e ? Dy(e) : []
        ] : [];
        u.forEach((v)=>{
            s && v.addEventListener("scroll", n, {
                passive: !0
            }), i && v.addEventListener("resize", n);
        });
        const d = l && a ? Kat(l, n) : null;
        let f = -1, p = null;
        o && (p = new ResizeObserver((v)=>{
            let [k] = v;
            k && k.target === l && p && e && (p.unobserve(e), cancelAnimationFrame(f), f = requestAnimationFrame(()=>{
                var _;
                (_ = p) == null || _.observe(e);
            })), n();
        }), l && !c && p.observe(l), e && p.observe(e));
        let h, m = c ? Cp(t) : null;
        c && w();
        function w() {
            const v = Cp(t);
            m && !Ree(m, v) && n(), m = v, h = requestAnimationFrame(w);
        }
        return n(), ()=>{
            var v;
            u.forEach((k)=>{
                s && k.removeEventListener("scroll", n), i && k.removeEventListener("resize", n);
            }), d?.(), (v = p) == null || v.disconnect(), p = null, c && cancelAnimationFrame(h);
        };
    }
    const Xat = Cat, Gat = Eat, Zat = vat, Jat = Iat, Yat = Sat, Qat = xat, ect = (t, e, n)=>{
        const r = new Map, s = {
            platform: Mee,
            ...n
        }, i = {
            ...s.platform,
            _c: r
        };
        return _at(t, e, {
            ...s,
            platform: i
        });
    };
    var tct = Q('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'), $P = ds();
    function XP() {
        const t = fs($P);
        if (t === void 0) throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");
        return t;
    }
    var fT = 30, kz = fT / 2, nct = {
        top: 180,
        right: -90,
        bottom: 0,
        left: 90
    };
    function Q1(t) {
        const e = XP(), n = qt({
            size: fT
        }, t), [r, s] = rt(n, [
            "ref",
            "style",
            "size"
        ]), i = ()=>e.currentPlacement().split("-")[0], o = rct(e.contentRef), a = ()=>o()?.getPropertyValue("background-color") || "none", c = ()=>o()?.getPropertyValue(`border-${i()}-color`) || "none", l = ()=>o()?.getPropertyValue(`border-${i()}-width`) || "0px", u = ()=>Number.parseInt(l()) * 2 * (fT / r.size), d = ()=>`rotate(${nct[i()]} ${kz} ${kz}) translate(0 2)`;
        return I(yn, qe({
            as: "div",
            ref (f) {
                var p = yr(e.setArrowRef, r.ref);
                typeof p == "function" && p(f);
            },
            "aria-hidden": "true",
            get style () {
                return hg({
                    position: "absolute",
                    "font-size": `${r.size}px`,
                    width: "1em",
                    height: "1em",
                    "pointer-events": "none",
                    fill: a(),
                    stroke: c(),
                    "stroke-width": u()
                }, r.style);
            }
        }, s, {
            get children () {
                var f = tct(), p = f.firstChild, h = p.firstChild;
                return h.nextSibling, pt(()=>Ot(p, "transform", d())), f;
            }
        }));
    }
    function rct(t) {
        const [e, n] = pe();
        return lt(()=>{
            const r = t();
            r && n(_se(r).getComputedStyle(r));
        }), e;
    }
    function sct(t) {
        const e = XP(), [n, r] = rt(t, [
            "ref",
            "style"
        ]);
        return I(yn, qe({
            as: "div",
            ref (s) {
                var i = yr(e.setPositionerRef, n.ref);
                typeof i == "function" && i(s);
            },
            "data-popper-positioner": "",
            get style () {
                return hg({
                    position: "absolute",
                    top: 0,
                    left: 0,
                    "min-width": "max-content"
                }, n.style);
            }
        }, r));
    }
    function Tz(t) {
        const { x: e = 0, y: n = 0, width: r = 0, height: s = 0 } = t ?? {};
        if (typeof DOMRect == "function") return new DOMRect(e, n, r, s);
        const i = {
            x: e,
            y: n,
            width: r,
            height: s,
            top: n,
            right: e + r,
            bottom: n + s,
            left: e
        };
        return {
            ...i,
            toJSON: ()=>i
        };
    }
    function ict(t, e) {
        return {
            contextElement: t,
            getBoundingClientRect: ()=>{
                const r = e(t);
                return r ? Tz(r) : t ? t.getBoundingClientRect() : Tz();
            }
        };
    }
    function oct(t) {
        return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(t);
    }
    var act = {
        top: "bottom",
        right: "left",
        bottom: "top",
        left: "right"
    };
    function cct(t, e) {
        const [n, r] = t.split("-"), s = act[n];
        return r ? n === "left" || n === "right" ? `${s} ${r === "start" ? "top" : "bottom"}` : r === "start" ? `${s} ${e === "rtl" ? "right" : "left"}` : `${s} ${e === "rtl" ? "left" : "right"}` : `${s} center`;
    }
    function lct(t) {
        const e = qt({
            getAnchorRect: (f)=>f?.getBoundingClientRect(),
            placement: "bottom",
            gutter: 0,
            shift: 0,
            flip: !0,
            slide: !0,
            overlap: !1,
            sameWidth: !1,
            fitViewport: !1,
            hideWhenDetached: !1,
            detachedPadding: 0,
            arrowPadding: 4,
            overflowPadding: 8
        }, t), [n, r] = pe(), [s, i] = pe(), [o, a] = pe(e.placement), c = ()=>ict(e.anchorRef?.(), e.getAnchorRect), { direction: l } = Zc();
        async function u() {
            const f = c(), p = n(), h = s();
            if (!f || !p) return;
            const m = (h?.clientHeight || 0) / 2, w = typeof e.gutter == "number" ? e.gutter + m : e.gutter ?? m;
            p.style.setProperty("--kb-popper-content-overflow-padding", `${e.overflowPadding}px`), f.getBoundingClientRect();
            const v = [
                Xat(({ placement: U })=>{
                    const K = !!U.split("-")[1];
                    return {
                        mainAxis: w,
                        crossAxis: K ? void 0 : e.shift,
                        alignmentAxis: e.shift
                    };
                })
            ];
            if (e.flip !== !1) {
                const U = typeof e.flip == "string" ? e.flip.split(" ") : void 0;
                if (U !== void 0 && !U.every(oct)) throw new Error("`flip` expects a spaced-delimited list of placements");
                v.push(Zat({
                    padding: e.overflowPadding,
                    fallbackPlacements: U
                }));
            }
            (e.slide || e.overlap) && v.push(Gat({
                mainAxis: e.slide,
                crossAxis: e.overlap,
                padding: e.overflowPadding
            })), v.push(Jat({
                padding: e.overflowPadding,
                apply ({ availableWidth: U, availableHeight: K, rects: X }) {
                    const G = Math.round(X.reference.width);
                    U = Math.floor(U), K = Math.floor(K), p.style.setProperty("--kb-popper-anchor-width", `${G}px`), p.style.setProperty("--kb-popper-content-available-width", `${U}px`), p.style.setProperty("--kb-popper-content-available-height", `${K}px`), e.sameWidth && (p.style.width = `${G}px`), e.fitViewport && (p.style.maxWidth = `${U}px`, p.style.maxHeight = `${K}px`);
                }
            })), e.hideWhenDetached && v.push(Yat({
                padding: e.detachedPadding
            })), h && v.push(Qat({
                element: h,
                padding: e.arrowPadding
            }));
            const k = await ect(f, p, {
                placement: e.placement,
                strategy: "absolute",
                middleware: v,
                platform: {
                    ...Mee,
                    isRTL: ()=>l() === "rtl"
                }
            });
            if (a(k.placement), e.onCurrentPlacementChange?.(k.placement), !p) return;
            p.style.setProperty("--kb-popper-content-transform-origin", cct(k.placement, l()));
            const _ = Math.round(k.x), A = Math.round(k.y);
            let P;
            if (e.hideWhenDetached && (P = k.middlewareData.hide?.referenceHidden ? "hidden" : "visible"), Object.assign(p.style, {
                top: "0",
                left: "0",
                transform: `translate3d(${_}px, ${A}px, 0)`,
                visibility: P
            }), h && k.middlewareData.arrow) {
                const { x: U, y: K } = k.middlewareData.arrow, X = k.placement.split("-")[0];
                Object.assign(h.style, {
                    left: U != null ? `${U}px` : "",
                    top: K != null ? `${K}px` : "",
                    [X]: "100%"
                });
            }
        }
        lt(()=>{
            const f = c(), p = n();
            if (!f || !p) return;
            const h = $at(f, p, u, {
                elementResize: typeof ResizeObserver == "function"
            });
            It(h);
        }), lt(()=>{
            const f = n(), p = e.contentRef?.();
            !f || !p || queueMicrotask(()=>{
                f.style.zIndex = getComputedStyle(p).zIndex;
            });
        });
        const d = {
            currentPlacement: o,
            contentRef: ()=>e.contentRef?.(),
            setPositionerRef: r,
            setArrowRef: i
        };
        return I($P.Provider, {
            value: d,
            get children () {
                return e.children;
            }
        });
    }
    var A9 = Object.assign(lct, {
        Arrow: Q1,
        Context: $P,
        usePopperContext: XP,
        Positioner: sct
    }), Nee = class {
        collection;
        ref;
        collator;
        constructor(t, e, n){
            this.collection = t, this.ref = e, this.collator = n;
        }
        getKeyBelow(t) {
            let e = this.collection().getKeyAfter(t);
            for(; e != null;){
                const n = this.collection().getItem(e);
                if (n && n.type === "item" && !n.disabled) return e;
                e = this.collection().getKeyAfter(e);
            }
        }
        getKeyAbove(t) {
            let e = this.collection().getKeyBefore(t);
            for(; e != null;){
                const n = this.collection().getItem(e);
                if (n && n.type === "item" && !n.disabled) return e;
                e = this.collection().getKeyBefore(e);
            }
        }
        getFirstKey() {
            let t = this.collection().getFirstKey();
            for(; t != null;){
                const e = this.collection().getItem(t);
                if (e && e.type === "item" && !e.disabled) return t;
                t = this.collection().getKeyAfter(t);
            }
        }
        getLastKey() {
            let t = this.collection().getLastKey();
            for(; t != null;){
                const e = this.collection().getItem(t);
                if (e && e.type === "item" && !e.disabled) return t;
                t = this.collection().getKeyBefore(t);
            }
        }
        getItem(t) {
            return this.ref?.()?.querySelector(`[data-key="${t}"]`) ?? null;
        }
        getKeyPageAbove(t) {
            const e = this.ref?.();
            let n = this.getItem(t);
            if (!e || !n) return;
            const r = Math.max(0, n.offsetTop + n.offsetHeight - e.offsetHeight);
            let s = t;
            for(; s && n && n.offsetTop > r;)s = this.getKeyAbove(s), n = s != null ? this.getItem(s) : null;
            return s;
        }
        getKeyPageBelow(t) {
            const e = this.ref?.();
            let n = this.getItem(t);
            if (!e || !n) return;
            const r = Math.min(e.scrollHeight, n.offsetTop - n.offsetHeight + e.offsetHeight);
            let s = t;
            for(; s && n && n.offsetTop < r;)s = this.getKeyBelow(s), n = s != null ? this.getItem(s) : null;
            return s;
        }
        getKeyForSearch(t, e) {
            const n = this.collator?.();
            if (!n) return;
            let r = e != null ? this.getKeyBelow(e) : this.getFirstKey();
            for(; r != null;){
                const s = this.collection().getItem(r);
                if (s) {
                    const i = s.textValue.slice(0, t.length);
                    if (s.textValue && n.compare(i, t) === 0) return r;
                }
                r = this.getKeyBelow(r);
            }
        }
    };
    function Vee(t, e, n) {
        const r = uee({
            usage: "search",
            sensitivity: "base"
        }), s = Ct(()=>{
            const i = Ae(t.keyboardDelegate);
            return i || new Nee(t.collection, e, r);
        });
        return gee({
            selectionManager: ()=>Ae(t.selectionManager),
            keyboardDelegate: s,
            autoFocus: ()=>Ae(t.autoFocus),
            deferAutoFocus: ()=>Ae(t.deferAutoFocus),
            shouldFocusWrap: ()=>Ae(t.shouldFocusWrap),
            disallowEmptySelection: ()=>Ae(t.disallowEmptySelection),
            selectOnFocus: ()=>Ae(t.selectOnFocus),
            disallowTypeAhead: ()=>Ae(t.disallowTypeAhead),
            shouldUseVirtualFocus: ()=>Ae(t.shouldUseVirtualFocus),
            allowsTabNavigation: ()=>Ae(t.allowsTabNavigation),
            isVirtualized: ()=>Ae(t.isVirtualized),
            scrollToKey: (i)=>Ae(t.scrollToKey)?.(i),
            orientation: ()=>Ae(t.orientation)
        }, e, n);
    }
    var qx = "data-kb-top-layer", Dee, pT = !1, pu = [];
    function By(t) {
        return pu.findIndex((e)=>e.node === t);
    }
    function uct(t) {
        return pu[By(t)];
    }
    function dct(t) {
        return pu[pu.length - 1].node === t;
    }
    function Bee() {
        return pu.filter((t)=>t.isPointerBlocking);
    }
    function fct() {
        return [
            ...Bee()
        ].slice(-1)[0];
    }
    function GP() {
        return Bee().length > 0;
    }
    function Fee(t) {
        const e = By(fct()?.node);
        return By(t) < e;
    }
    function pct(t) {
        pu.push(t);
    }
    function hct(t) {
        const e = By(t);
        e < 0 || pu.splice(e, 1);
    }
    function gct() {
        for (const { node: t } of pu)t.style.pointerEvents = Fee(t) ? "none" : "auto";
    }
    function bct(t) {
        if (GP() && !pT) {
            const e = Bc(t);
            Dee = document.body.style.pointerEvents, e.body.style.pointerEvents = "none", pT = !0;
        }
    }
    function mct(t) {
        if (GP()) return;
        const e = Bc(t);
        e.body.style.pointerEvents = Dee, e.body.style.length === 0 && e.body.removeAttribute("style"), pT = !1;
    }
    var io = {
        layers: pu,
        isTopMostLayer: dct,
        hasPointerBlockingLayer: GP,
        isBelowPointerBlockingLayer: Fee,
        addLayer: pct,
        removeLayer: hct,
        indexOf: By,
        find: uct,
        assignPointerEventToLayers: gct,
        disableBodyPointerEvents: bct,
        restoreBodyPointerEvents: mct
    }, y7 = "focusScope.autoFocusOnMount", w7 = "focusScope.autoFocusOnUnmount", Cz = {
        bubbles: !1,
        cancelable: !0
    }, Ez = {
        stack: [],
        active () {
            return this.stack[0];
        },
        add (t) {
            t !== this.active() && this.active()?.pause(), this.stack = G7(this.stack, t), this.stack.unshift(t);
        },
        remove (t) {
            this.stack = G7(this.stack, t), this.active()?.resume();
        }
    };
    function ZP(t, e) {
        const [n, r] = pe(!1), s = {
            pause () {
                r(!0);
            },
            resume () {
                r(!1);
            }
        };
        let i = null;
        const o = (h)=>t.onMountAutoFocus?.(h), a = (h)=>t.onUnmountAutoFocus?.(h), c = ()=>Bc(e()), l = ()=>{
            const h = c().createElement("span");
            return h.setAttribute("data-focus-trap", ""), h.tabIndex = 0, Object.assign(h.style, sH), h;
        }, u = ()=>{
            const h = e();
            return h ? tH(h, !0).filter((m)=>!m.hasAttribute("data-focus-trap")) : [];
        }, d = ()=>{
            const h = u();
            return h.length > 0 ? h[0] : null;
        }, f = ()=>{
            const h = u();
            return h.length > 0 ? h[h.length - 1] : null;
        }, p = ()=>{
            const h = e();
            if (!h) return !1;
            const m = Xb(h);
            return !m || bo(h, m) ? !1 : nH(m);
        };
        lt(()=>{
            const h = e();
            if (!h) return;
            Ez.add(s);
            const m = Xb(h);
            if (!bo(h, m)) {
                const v = new CustomEvent(y7, Cz);
                h.addEventListener(y7, o), h.dispatchEvent(v), v.defaultPrevented || setTimeout(()=>{
                    jr(d()), Xb(h) === m && jr(h);
                }, 0);
            }
            It(()=>{
                h.removeEventListener(y7, o), setTimeout(()=>{
                    const v = new CustomEvent(w7, Cz);
                    p() && v.preventDefault(), h.addEventListener(w7, a), h.dispatchEvent(v), v.defaultPrevented || jr(m ?? c().body), h.removeEventListener(w7, a), Ez.remove(s);
                }, 0);
            });
        }), lt(()=>{
            const h = e();
            if (!h || !Ae(t.trapFocus) || n()) return;
            const m = (v)=>{
                const k = v.target;
                k?.closest(`[${qx}]`) || (bo(h, k) ? i = k : jr(i));
            }, w = (v)=>{
                const _ = v.relatedTarget ?? Xb(h);
                _?.closest(`[${qx}]`) || bo(h, _) || jr(i);
            };
            c().addEventListener("focusin", m), c().addEventListener("focusout", w), It(()=>{
                c().removeEventListener("focusin", m), c().removeEventListener("focusout", w);
            });
        }), lt(()=>{
            const h = e();
            if (!h || !Ae(t.trapFocus) || n()) return;
            const m = l();
            h.insertAdjacentElement("afterbegin", m);
            const w = l();
            h.insertAdjacentElement("beforeend", w);
            function v(_) {
                const A = d(), P = f();
                _.relatedTarget === A ? jr(P) : jr(A);
            }
            m.addEventListener("focusin", v), w.addEventListener("focusin", v);
            const k = new MutationObserver((_)=>{
                for (const A of _)A.previousSibling === w && (w.remove(), h.insertAdjacentElement("beforeend", w)), A.nextSibling === m && (m.remove(), h.insertAdjacentElement("afterbegin", m));
            });
            k.observe(h, {
                childList: !0,
                subtree: !1
            }), It(()=>{
                m.removeEventListener("focusin", v), w.removeEventListener("focusin", v), m.remove(), w.remove(), k.disconnect();
            });
        });
    }
    var yct = "data-live-announcer";
    function JP(t) {
        lt(()=>{
            Ae(t.isDisabled) || It(wct(Ae(t.targets), Ae(t.root)));
        });
    }
    var Wb = new WeakMap, Lo = [];
    function wct(t, e = document.body) {
        const n = new Set(t), r = new Set, s = (c)=>{
            for (const f of c.querySelectorAll(`[${yct}], [${qx}]`))n.add(f);
            const l = (f)=>{
                if (n.has(f) || f.parentElement && r.has(f.parentElement) && f.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
                for (const p of n)if (f.contains(p)) return NodeFilter.FILTER_SKIP;
                return NodeFilter.FILTER_ACCEPT;
            }, u = document.createTreeWalker(c, NodeFilter.SHOW_ELEMENT, {
                acceptNode: l
            }), d = l(c);
            if (d === NodeFilter.FILTER_ACCEPT && i(c), d !== NodeFilter.FILTER_REJECT) {
                let f = u.nextNode();
                for(; f != null;)i(f), f = u.nextNode();
            }
        }, i = (c)=>{
            const l = Wb.get(c) ?? 0;
            c.getAttribute("aria-hidden") === "true" && l === 0 || (l === 0 && c.setAttribute("aria-hidden", "true"), r.add(c), Wb.set(c, l + 1));
        };
        Lo.length && Lo[Lo.length - 1].disconnect(), s(e);
        const o = new MutationObserver((c)=>{
            for (const l of c)if (!(l.type !== "childList" || l.addedNodes.length === 0) && ![
                ...n,
                ...r
            ].some((u)=>u.contains(l.target))) {
                for (const u of l.removedNodes)u instanceof Element && (n.delete(u), r.delete(u));
                for (const u of l.addedNodes)(u instanceof HTMLElement || u instanceof SVGElement) && (u.dataset.liveAnnouncer === "true" || u.dataset.reactAriaTopLayer === "true") ? n.add(u) : u instanceof Element && s(u);
            }
        });
        o.observe(e, {
            childList: !0,
            subtree: !0
        });
        const a = {
            observe () {
                o.observe(e, {
                    childList: !0,
                    subtree: !0
                });
            },
            disconnect () {
                o.disconnect();
            }
        };
        return Lo.push(a), ()=>{
            o.disconnect();
            for (const c of r){
                const l = Wb.get(c);
                if (l == null) return;
                l === 1 ? (c.removeAttribute("aria-hidden"), Wb.delete(c)) : Wb.set(c, l - 1);
            }
            a === Lo[Lo.length - 1] ? (Lo.pop(), Lo.length && Lo[Lo.length - 1].observe()) : Lo.splice(Lo.indexOf(a), 1);
        };
    }
    var Iz = "interactOutside.pointerDownOutside", Az = "interactOutside.focusOutside";
    function _ct(t, e) {
        let n, r = Dse;
        const s = ()=>Bc(e()), i = (d)=>t.onPointerDownOutside?.(d), o = (d)=>t.onFocusOutside?.(d), a = (d)=>t.onInteractOutside?.(d), c = (d)=>{
            const f = d.target;
            return !(f instanceof Element) || f.closest(`[${qx}]`) || !bo(s(), f) || bo(e(), f) ? !1 : !t.shouldExcludeElement?.(f);
        }, l = (d)=>{
            function f() {
                const p = e(), h = d.target;
                if (!p || !h || !c(d)) return;
                const m = Yt([
                    i,
                    a
                ]);
                h.addEventListener(Iz, m, {
                    once: !0
                });
                const w = new CustomEvent(Iz, {
                    bubbles: !1,
                    cancelable: !0,
                    detail: {
                        originalEvent: d,
                        isContextMenu: d.button === 2 || Cse(d) && d.button === 0
                    }
                });
                h.dispatchEvent(w);
            }
            d.pointerType === "touch" ? (s().removeEventListener("click", f), r = f, s().addEventListener("click", f, {
                once: !0
            })) : f();
        }, u = (d)=>{
            const f = e(), p = d.target;
            if (!f || !p || !c(d)) return;
            const h = Yt([
                o,
                a
            ]);
            p.addEventListener(Az, h, {
                once: !0
            });
            const m = new CustomEvent(Az, {
                bubbles: !1,
                cancelable: !0,
                detail: {
                    originalEvent: d,
                    isContextMenu: !1
                }
            });
            p.dispatchEvent(m);
        };
        lt(()=>{
            Ae(t.isDisabled) || (n = window.setTimeout(()=>{
                s().addEventListener("pointerdown", l, !0);
            }, 0), s().addEventListener("focusin", u, !0), It(()=>{
                window.clearTimeout(n), s().removeEventListener("click", r), s().removeEventListener("pointerdown", l, !0), s().removeEventListener("focusin", u, !0);
            }));
        });
    }
    function xct(t) {
        const e = (n)=>{
            n.key === JU.Escape && t.onEscapeKeyDown?.(n);
        };
        lt(()=>{
            if (Ae(t.isDisabled)) return;
            const n = t.ownerDocument?.() ?? Bc();
            n.addEventListener("keydown", e), It(()=>{
                n.removeEventListener("keydown", e);
            });
        });
    }
    var Lee = ds();
    function vct() {
        return fs(Lee);
    }
    function YP(t) {
        let e;
        const n = vct(), [r, s] = rt(t, [
            "ref",
            "disableOutsidePointerEvents",
            "excludedElements",
            "onEscapeKeyDown",
            "onPointerDownOutside",
            "onFocusOutside",
            "onInteractOutside",
            "onDismiss",
            "bypassTopMostLayerCheck"
        ]), i = new Set([]), o = (d)=>{
            i.add(d);
            const f = n?.registerNestedLayer(d);
            return ()=>{
                i.delete(d), f?.();
            };
        };
        _ct({
            shouldExcludeElement: (d)=>e ? r.excludedElements?.some((f)=>bo(f(), d)) || [
                    ...i
                ].some((f)=>bo(f, d)) : !1,
            onPointerDownOutside: (d)=>{
                !e || io.isBelowPointerBlockingLayer(e) || !r.bypassTopMostLayerCheck && !io.isTopMostLayer(e) || (r.onPointerDownOutside?.(d), r.onInteractOutside?.(d), d.defaultPrevented || r.onDismiss?.());
            },
            onFocusOutside: (d)=>{
                r.onFocusOutside?.(d), r.onInteractOutside?.(d), d.defaultPrevented || r.onDismiss?.();
            }
        }, ()=>e), xct({
            ownerDocument: ()=>Bc(e),
            onEscapeKeyDown: (d)=>{
                !e || !io.isTopMostLayer(e) || (r.onEscapeKeyDown?.(d), !d.defaultPrevented && r.onDismiss && (d.preventDefault(), r.onDismiss()));
            }
        }), ga(()=>{
            if (!e) return;
            io.addLayer({
                node: e,
                isPointerBlocking: r.disableOutsidePointerEvents,
                dismiss: r.onDismiss
            });
            const d = n?.registerNestedLayer(e);
            io.assignPointerEventToLayers(), io.disableBodyPointerEvents(e), It(()=>{
                e && (io.removeLayer(e), d?.(), io.assignPointerEventToLayers(), io.restoreBodyPointerEvents(e));
            });
        }), lt(Ji([
            ()=>e,
            ()=>r.disableOutsidePointerEvents
        ], ([d, f])=>{
            if (!d) return;
            const p = io.find(d);
            p && p.isPointerBlocking !== f && (p.isPointerBlocking = f, io.assignPointerEventToLayers()), f && io.disableBodyPointerEvents(d), It(()=>{
                io.restoreBodyPointerEvents(d);
            });
        }, {
            defer: !0
        }));
        const u = {
            registerNestedLayer: o
        };
        return I(Lee.Provider, {
            value: u,
            get children () {
                return I(yn, qe({
                    as: "div",
                    ref (d) {
                        var f = yr((p)=>e = p, r.ref);
                        typeof f == "function" && f(d);
                    }
                }, s));
            }
        });
    }
    function P9(t = {}) {
        const [e, n] = $Q({
            value: ()=>Ae(t.open),
            defaultValue: ()=>!!Ae(t.defaultOpen),
            onChange: (o)=>t.onOpenChange?.(o)
        }), r = ()=>{
            n(!0);
        }, s = ()=>{
            n(!1);
        };
        return {
            isOpen: e,
            setIsOpen: n,
            open: r,
            close: s,
            toggle: ()=>{
                e() ? s() : r();
            }
        };
    }
    function Sct(t = {}) {
        const [e, n] = $Q({
            value: ()=>Ae(t.isSelected),
            defaultValue: ()=>!!Ae(t.defaultIsSelected),
            onChange: (i)=>t.onSelectedChange?.(i)
        });
        return {
            isSelected: e,
            setIsSelected: (i)=>{
                !Ae(t.isReadOnly) && !Ae(t.isDisabled) && n(i);
            },
            toggle: ()=>{
                !Ae(t.isReadOnly) && !Ae(t.isDisabled) && n(!e());
            }
        };
    }
    var hT = (t, e)=>{
        if (t.contains(e)) return !0;
        let n = e;
        for(; n;){
            if (n === t) return !0;
            n = n._$host ?? n.parentElement;
        }
        return !1;
    }, h_ = new Map, kct = (t)=>{
        lt(()=>{
            const e = Js(t.style) ?? {}, n = Js(t.properties) ?? [], r = {};
            for(const i in e)r[i] = t.element.style[i];
            const s = h_.get(t.key);
            s ? s.activeCount++ : h_.set(t.key, {
                activeCount: 1,
                originalStyles: r,
                properties: n.map((i)=>i.key)
            }), Object.assign(t.element.style, t.style);
            for (const i of n)t.element.style.setProperty(i.key, i.value);
            It(()=>{
                const i = h_.get(t.key);
                if (i) {
                    if (i.activeCount !== 1) {
                        i.activeCount--;
                        return;
                    }
                    h_.delete(t.key);
                    for (const [o, a] of Object.entries(i.originalStyles))t.element.style[o] = a;
                    for (const o of i.properties)t.element.style.removeProperty(o);
                    t.element.style.length === 0 && t.element.removeAttribute("style"), t.cleanup?.();
                }
            });
        });
    }, Pz = kct, Tct = (t, e)=>{
        switch(e){
            case "x":
                return [
                    t.clientWidth,
                    t.scrollLeft,
                    t.scrollWidth
                ];
            case "y":
                return [
                    t.clientHeight,
                    t.scrollTop,
                    t.scrollHeight
                ];
        }
    }, Cct = (t, e)=>{
        const n = getComputedStyle(t), r = e === "x" ? n.overflowX : n.overflowY;
        return r === "auto" || r === "scroll" || t.tagName === "HTML" && r === "visible";
    }, Ect = (t, e, n)=>{
        const r = e === "x" && window.getComputedStyle(t).direction === "rtl" ? -1 : 1;
        let s = t, i = 0, o = 0, a = !1;
        do {
            const [c, l, u] = Tct(s, e), d = u - c - r * l;
            (l !== 0 || d !== 0) && Cct(s, e) && (i += d, o += l), s === (n ?? document.documentElement) ? a = !0 : s = s._$host ?? s.parentElement;
        }while (s && !a);
        return [
            i,
            o
        ];
    }, [Oz, Mz] = pe([]), Ict = (t)=>Oz().indexOf(t) === Oz().length - 1, Act = (t)=>{
        const e = qe({
            element: null,
            enabled: !0,
            hideScrollbar: !0,
            preventScrollbarShift: !0,
            preventScrollbarShiftMode: "padding",
            restoreScrollPosition: !0,
            allowPinchZoom: !1
        }, t), n = ii();
        let r = [
            0,
            0
        ], s = null, i = null;
        lt(()=>{
            Js(e.enabled) && (Mz((l)=>[
                    ...l,
                    n
                ]), It(()=>{
                Mz((l)=>l.filter((u)=>u !== n));
            }));
        }), lt(()=>{
            if (!Js(e.enabled) || !Js(e.hideScrollbar)) return;
            const { body: l } = document, u = window.innerWidth - l.offsetWidth;
            if (Js(e.preventScrollbarShift)) {
                const d = {
                    overflow: "hidden"
                }, f = [];
                u > 0 && (Js(e.preventScrollbarShiftMode) === "padding" ? d.paddingRight = `calc(${window.getComputedStyle(l).paddingRight} + ${u}px)` : d.marginRight = `calc(${window.getComputedStyle(l).marginRight} + ${u}px)`, f.push({
                    key: "--scrollbar-width",
                    value: `${u}px`
                }));
                const p = window.scrollY, h = window.scrollX;
                Pz({
                    key: "prevent-scroll",
                    element: l,
                    style: d,
                    properties: f,
                    cleanup: ()=>{
                        Js(e.restoreScrollPosition) && u > 0 && window.scrollTo(h, p);
                    }
                });
            } else Pz({
                key: "prevent-scroll",
                element: l,
                style: {
                    overflow: "hidden"
                }
            });
        }), lt(()=>{
            !Ict(n) || !Js(e.enabled) || (document.addEventListener("wheel", a, {
                passive: !1
            }), document.addEventListener("touchstart", o, {
                passive: !1
            }), document.addEventListener("touchmove", c, {
                passive: !1
            }), It(()=>{
                document.removeEventListener("wheel", a), document.removeEventListener("touchstart", o), document.removeEventListener("touchmove", c);
            }));
        });
        const o = (l)=>{
            r = Rz(l), s = null, i = null;
        }, a = (l)=>{
            const u = l.target, d = Js(e.element), f = Pct(l), p = Math.abs(f[0]) > Math.abs(f[1]) ? "x" : "y", h = p === "x" ? f[0] : f[1], m = Nz(u, p, h, d);
            let w;
            d && hT(d, u) ? w = !m : w = !0, w && l.cancelable && l.preventDefault();
        }, c = (l)=>{
            const u = Js(e.element), d = l.target;
            let f;
            if (l.touches.length === 2) f = !Js(e.allowPinchZoom);
            else {
                if (s == null || i === null) {
                    const p = Rz(l).map((m, w)=>r[w] - m), h = Math.abs(p[0]) > Math.abs(p[1]) ? "x" : "y";
                    s = h, i = h === "x" ? p[0] : p[1];
                }
                if (d.type === "range") f = !1;
                else {
                    const p = Nz(d, s, i, u);
                    u && hT(u, d) ? f = !p : f = !0;
                }
            }
            f && l.cancelable && l.preventDefault();
        };
    }, Pct = (t)=>[
            t.deltaX,
            t.deltaY
        ], Rz = (t)=>t.changedTouches[0] ? [
            t.changedTouches[0].clientX,
            t.changedTouches[0].clientY
        ] : [
            0,
            0
        ], Nz = (t, e, n, r)=>{
        const s = r !== null && hT(r, t), [i, o] = Ect(t, e, s ? r : void 0);
        return !(n > 0 && Math.abs(i) <= 1 || n < 0 && Math.abs(o) < 1);
    }, Oct = Act, QP = Oct, Mct = ds();
    function O9() {
        return fs(Mct);
    }
    var Rct = ds();
    function zee() {
        return fs(Rct);
    }
    var Uee = ds();
    function Hee() {
        return fs(Uee);
    }
    function Iu() {
        const t = Hee();
        if (t === void 0) throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");
        return t;
    }
    var jee = ds();
    function eO() {
        const t = fs(jee);
        if (t === void 0) throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");
        return t;
    }
    var qee = ds();
    function Yc() {
        const t = fs(qee);
        if (t === void 0) throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");
        return t;
    }
    function tO(t) {
        let e;
        const n = Yc(), r = Iu(), s = qt({
            id: n.generateId(`item-${ii()}`)
        }, t), [i, o] = rt(s, [
            "ref",
            "textValue",
            "disabled",
            "closeOnSelect",
            "checked",
            "indeterminate",
            "onSelect",
            "onPointerMove",
            "onPointerLeave",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]), [a, c] = pe(), [l, u] = pe(), [d, f] = pe(), p = ()=>r.listState().selectionManager(), h = ()=>o.id, m = ()=>p().focusedKey() === h(), w = ()=>{
            i.onSelect?.(), i.closeOnSelect && setTimeout(()=>{
                r.close(!0);
            });
        };
        xee({
            getItem: ()=>({
                    ref: ()=>e,
                    type: "item",
                    key: h(),
                    textValue: i.textValue ?? d()?.textContent ?? e?.textContent ?? "",
                    disabled: i.disabled ?? !1
                })
        });
        const v = S9({
            key: h,
            selectionManager: p,
            shouldSelectOnPressUp: !0,
            allowsDifferentPressOrigin: !0,
            disabled: ()=>i.disabled
        }, ()=>e), k = (G)=>{
            $n(G, i.onPointerMove), G.pointerType === "mouse" && (i.disabled ? r.onItemLeave(G) : (r.onItemEnter(G), G.defaultPrevented || (jr(G.currentTarget), r.listState().selectionManager().setFocused(!0), r.listState().selectionManager().setFocusedKey(h()))));
        }, _ = (G)=>{
            $n(G, i.onPointerLeave), G.pointerType === "mouse" && r.onItemLeave(G);
        }, A = (G)=>{
            $n(G, i.onPointerUp), !i.disabled && G.button === 0 && w();
        }, P = (G)=>{
            if ($n(G, i.onKeyDown), !G.repeat && !i.disabled) switch(G.key){
                case "Enter":
                case " ":
                    w();
                    break;
            }
        }, U = Ct(()=>{
            if (i.indeterminate) return "mixed";
            if (i.checked != null) return i.checked;
        }), K = Ct(()=>({
                "data-indeterminate": i.indeterminate ? "" : void 0,
                "data-checked": i.checked && !i.indeterminate ? "" : void 0,
                "data-disabled": i.disabled ? "" : void 0,
                "data-highlighted": m() ? "" : void 0
            })), X = {
            isChecked: ()=>i.checked,
            dataset: K,
            setLabelRef: f,
            generateId: gu(()=>o.id),
            registerLabel: $s(c),
            registerDescription: $s(u)
        };
        return I(jee.Provider, {
            value: X,
            get children () {
                return I(yn, qe({
                    as: "div",
                    ref (G) {
                        var ce = yr((ie)=>e = ie, i.ref);
                        typeof ce == "function" && ce(G);
                    },
                    get tabIndex () {
                        return v.tabIndex();
                    },
                    get "aria-checked" () {
                        return U();
                    },
                    get "aria-disabled" () {
                        return i.disabled;
                    },
                    get "aria-labelledby" () {
                        return a();
                    },
                    get "aria-describedby" () {
                        return l();
                    },
                    get "data-key" () {
                        return v.dataKey();
                    },
                    get onPointerDown () {
                        return Yt([
                            i.onPointerDown,
                            v.onPointerDown
                        ]);
                    },
                    get onPointerUp () {
                        return Yt([
                            A,
                            v.onPointerUp
                        ]);
                    },
                    get onClick () {
                        return Yt([
                            i.onClick,
                            v.onClick
                        ]);
                    },
                    get onKeyDown () {
                        return Yt([
                            P,
                            v.onKeyDown
                        ]);
                    },
                    get onMouseDown () {
                        return Yt([
                            i.onMouseDown,
                            v.onMouseDown
                        ]);
                    },
                    get onFocus () {
                        return Yt([
                            i.onFocus,
                            v.onFocus
                        ]);
                    },
                    onPointerMove: k,
                    onPointerLeave: _
                }, K, o));
            }
        });
    }
    function Wee(t) {
        const e = qt({
            closeOnSelect: !1
        }, t), [n, r] = rt(e, [
            "checked",
            "defaultChecked",
            "onChange",
            "onSelect"
        ]), s = Sct({
            isSelected: ()=>n.checked,
            defaultIsSelected: ()=>n.defaultChecked,
            onSelectedChange: (o)=>n.onChange?.(o),
            isDisabled: ()=>r.disabled
        });
        return I(tO, qe({
            role: "menuitemcheckbox",
            get checked () {
                return s.isSelected();
            },
            onSelect: ()=>{
                n.onSelect?.(), s.toggle();
            }
        }, r));
    }
    var Fy = {
        next: (t, e)=>t === "ltr" ? e === "horizontal" ? "ArrowRight" : "ArrowDown" : e === "horizontal" ? "ArrowLeft" : "ArrowUp",
        previous: (t, e)=>Fy.next(t === "ltr" ? "rtl" : "ltr", e)
    }, Vz = {
        first: (t)=>t === "horizontal" ? "ArrowDown" : "ArrowRight",
        last: (t)=>t === "horizontal" ? "ArrowUp" : "ArrowLeft"
    };
    function nO(t) {
        const e = Yc(), n = Iu(), r = O9(), { direction: s } = Zc(), i = qt({
            id: e.generateId("trigger")
        }, t), [o, a] = rt(i, [
            "ref",
            "id",
            "disabled",
            "onPointerDown",
            "onClick",
            "onKeyDown",
            "onMouseOver",
            "onFocus"
        ]);
        let c = ()=>e.value();
        r !== void 0 && (c = ()=>e.value() ?? o.id, r.lastValue() === void 0 && r.setLastValue(c));
        const l = Zx(()=>n.triggerRef(), ()=>"button"), u = Ct(()=>l() === "a" && n.triggerRef()?.getAttribute("href") != null);
        lt(Ji(()=>r?.value(), (v)=>{
            u() && v === c() && n.triggerRef()?.focus();
        }));
        const d = ()=>{
            r !== void 0 ? n.isOpen() ? r.value() === c() && r.closeMenu() : (r.autoFocusMenu() || r.setAutoFocusMenu(!0), n.open(!1)) : n.toggle(!0);
        }, f = (v)=>{
            $n(v, o.onPointerDown), v.currentTarget.dataset.pointerType = v.pointerType, !o.disabled && v.pointerType !== "touch" && v.button === 0 && d();
        }, p = (v)=>{
            $n(v, o.onClick), o.disabled || v.currentTarget.dataset.pointerType === "touch" && d();
        }, h = (v)=>{
            if ($n(v, o.onKeyDown), !o.disabled) {
                if (u()) switch(v.key){
                    case "Enter":
                    case " ":
                        return;
                }
                switch(v.key){
                    case "Enter":
                    case " ":
                    case Vz.first(e.orientation()):
                        v.stopPropagation(), v.preventDefault(), Fse(v.currentTarget), n.open("first"), r?.setAutoFocusMenu(!0), r?.setValue(c);
                        break;
                    case Vz.last(e.orientation()):
                        v.stopPropagation(), v.preventDefault(), n.open("last");
                        break;
                    case Fy.next(s(), e.orientation()):
                        if (r === void 0) break;
                        v.stopPropagation(), v.preventDefault(), r.nextMenu();
                        break;
                    case Fy.previous(s(), e.orientation()):
                        if (r === void 0) break;
                        v.stopPropagation(), v.preventDefault(), r.previousMenu();
                        break;
                }
            }
        }, m = (v)=>{
            $n(v, o.onMouseOver), n.triggerRef()?.dataset.pointerType !== "touch" && !o.disabled && r !== void 0 && r.value() !== void 0 && r.setValue(c);
        }, w = (v)=>{
            $n(v, o.onFocus), r !== void 0 && v.currentTarget.dataset.pointerType !== "touch" && r.setValue(c);
        };
        return lt(()=>It(n.registerTriggerId(o.id))), I(jc, qe({
            ref (v) {
                var k = yr(n.setTriggerRef, o.ref);
                typeof k == "function" && k(v);
            },
            get "data-kb-menu-value-trigger" () {
                return e.value();
            },
            get id () {
                return o.id;
            },
            get disabled () {
                return o.disabled;
            },
            "aria-haspopup": "true",
            get "aria-expanded" () {
                return n.isOpen();
            },
            get "aria-controls" () {
                return Ze(()=>!!n.isOpen())() ? n.contentId() : void 0;
            },
            get "data-highlighted" () {
                return c() !== void 0 && r?.value() === c() ? !0 : void 0;
            },
            get tabIndex () {
                return r !== void 0 ? r.value() === c() || r.lastValue() === c() ? 0 : -1 : void 0;
            },
            onPointerDown: f,
            onMouseOver: m,
            onClick: p,
            onKeyDown: h,
            onFocus: w,
            role: r !== void 0 ? "menuitem" : void 0
        }, ()=>n.dataset(), a));
    }
    function Kee(t) {
        let e;
        const n = Yc(), r = Iu(), s = O9(), i = zee(), { direction: o } = Zc(), a = qt({
            id: n.generateId(`content-${ii()}`)
        }, t), [c, l] = rt(a, [
            "ref",
            "id",
            "style",
            "onOpenAutoFocus",
            "onCloseAutoFocus",
            "onEscapeKeyDown",
            "onFocusOutside",
            "onPointerEnter",
            "onPointerMove",
            "onKeyDown",
            "onMouseDown",
            "onFocusIn",
            "onFocusOut"
        ]);
        let u = 0;
        const d = ()=>r.parentMenuContext() == null && s === void 0 && n.isModal(), f = Vee({
            selectionManager: r.listState().selectionManager,
            collection: r.listState().collection,
            autoFocus: r.autoFocus,
            deferAutoFocus: !0,
            shouldFocusWrap: !0,
            disallowTypeAhead: ()=>!r.listState().selectionManager().isFocused(),
            orientation: ()=>n.orientation() === "horizontal" ? "vertical" : "horizontal"
        }, ()=>e);
        ZP({
            trapFocus: ()=>d() && r.isOpen(),
            onMountAutoFocus: (_)=>{
                s === void 0 && c.onOpenAutoFocus?.(_);
            },
            onUnmountAutoFocus: c.onCloseAutoFocus
        }, ()=>e);
        const p = (_)=>{
            if (bo(_.currentTarget, _.target) && (_.key === "Tab" && r.isOpen() && _.preventDefault(), s !== void 0 && _.currentTarget.getAttribute("aria-haspopup") !== "true")) switch(_.key){
                case Fy.next(o(), n.orientation()):
                    _.stopPropagation(), _.preventDefault(), r.close(!0), s.setAutoFocusMenu(!0), s.nextMenu();
                    break;
                case Fy.previous(o(), n.orientation()):
                    if (_.currentTarget.hasAttribute("data-closed")) break;
                    _.stopPropagation(), _.preventDefault(), r.close(!0), s.setAutoFocusMenu(!0), s.previousMenu();
                    break;
            }
        }, h = (_)=>{
            c.onEscapeKeyDown?.(_), s?.setAutoFocusMenu(!1), r.close(!0);
        }, m = (_)=>{
            c.onFocusOutside?.(_), n.isModal() && _.preventDefault();
        }, w = (_)=>{
            $n(_, c.onPointerEnter), r.isOpen() && (r.parentMenuContext()?.listState().selectionManager().setFocused(!1), r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0));
        }, v = (_)=>{
            if ($n(_, c.onPointerMove), _.pointerType !== "mouse") return;
            const A = _.target, P = u !== _.clientX;
            bo(_.currentTarget, A) && P && (r.setPointerDir(_.clientX > u ? "right" : "left"), u = _.clientX);
        };
        lt(()=>It(r.registerContentId(c.id))), It(()=>r.setContentRef(void 0));
        const k = {
            ref: yr((_)=>{
                r.setContentRef(_), e = _;
            }, c.ref),
            role: "menu",
            get id () {
                return c.id;
            },
            get tabIndex () {
                return f.tabIndex();
            },
            get "aria-labelledby" () {
                return r.triggerId();
            },
            onKeyDown: Yt([
                c.onKeyDown,
                f.onKeyDown,
                p
            ]),
            onMouseDown: Yt([
                c.onMouseDown,
                f.onMouseDown
            ]),
            onFocusIn: Yt([
                c.onFocusIn,
                f.onFocusIn
            ]),
            onFocusOut: Yt([
                c.onFocusOut,
                f.onFocusOut
            ]),
            onPointerEnter: w,
            onPointerMove: v,
            get "data-orientation" () {
                return n.orientation();
            }
        };
        return I(de, {
            get when () {
                return r.contentPresent();
            },
            get children () {
                return I(de, {
                    get when () {
                        return i === void 0 || r.parentMenuContext() != null;
                    },
                    get fallback () {
                        return I(yn, qe({
                            as: "div"
                        }, ()=>r.dataset(), k, l));
                    },
                    get children () {
                        return I(A9.Positioner, {
                            get children () {
                                return I(YP, qe({
                                    get disableOutsidePointerEvents () {
                                        return Ze(()=>!!d())() && r.isOpen();
                                    },
                                    get excludedElements () {
                                        return [
                                            r.triggerRef
                                        ];
                                    },
                                    bypassTopMostLayerCheck: !0,
                                    get style () {
                                        return hg({
                                            "--kb-menu-content-transform-origin": "var(--kb-popper-content-transform-origin)",
                                            position: "relative"
                                        }, c.style);
                                    },
                                    onEscapeKeyDown: h,
                                    onFocusOutside: m,
                                    get onDismiss () {
                                        return r.close;
                                    }
                                }, ()=>r.dataset(), k, l));
                            }
                        });
                    }
                });
            }
        });
    }
    function Nct(t) {
        let e;
        const n = Yc(), r = Iu(), [s, i] = rt(t, [
            "ref"
        ]);
        return QP({
            element: ()=>e ?? null,
            enabled: ()=>r.contentPresent() && n.preventScroll()
        }), I(Kee, qe({
            ref (o) {
                var a = yr((c)=>{
                    e = c;
                }, s.ref);
                typeof a == "function" && a(o);
            }
        }, i));
    }
    var $ee = ds();
    function Vct() {
        const t = fs($ee);
        if (t === void 0) throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");
        return t;
    }
    function rO(t) {
        const e = Yc(), n = qt({
            id: e.generateId(`group-${ii()}`)
        }, t), [r, s] = pe(), i = {
            generateId: gu(()=>n.id),
            registerLabelId: $s(s)
        };
        return I($ee.Provider, {
            value: i,
            get children () {
                return I(yn, qe({
                    as: "div",
                    role: "group",
                    get "aria-labelledby" () {
                        return r();
                    }
                }, n));
            }
        });
    }
    function Xee(t) {
        const e = Vct(), n = qt({
            id: e.generateId("label")
        }, t), [r, s] = rt(n, [
            "id"
        ]);
        return lt(()=>It(e.registerLabelId(r.id))), I(yn, qe({
            as: "span",
            get id () {
                return r.id;
            },
            "aria-hidden": "true"
        }, s));
    }
    function Gee(t) {
        const e = Iu(), n = qt({
            children: "▼"
        }, t);
        return I(yn, qe({
            as: "span",
            "aria-hidden": "true"
        }, ()=>e.dataset(), n));
    }
    function sO(t) {
        return I(tO, qe({
            role: "menuitem",
            closeOnSelect: !0
        }, t));
    }
    function Zee(t) {
        const e = eO(), n = qt({
            id: e.generateId("description")
        }, t), [r, s] = rt(n, [
            "id"
        ]);
        return lt(()=>It(e.registerDescription(r.id))), I(yn, qe({
            as: "div",
            get id () {
                return r.id;
            }
        }, ()=>e.dataset(), s));
    }
    function Jee(t) {
        const e = eO(), n = qt({
            id: e.generateId("indicator")
        }, t), [r, s] = rt(n, [
            "forceMount"
        ]);
        return I(de, {
            get when () {
                return r.forceMount || e.isChecked();
            },
            get children () {
                return I(yn, qe({
                    as: "div"
                }, ()=>e.dataset(), s));
            }
        });
    }
    function Yee(t) {
        const e = eO(), n = qt({
            id: e.generateId("label")
        }, t), [r, s] = rt(n, [
            "ref",
            "id"
        ]);
        return lt(()=>It(e.registerLabel(r.id))), I(yn, qe({
            as: "div",
            ref (i) {
                var o = yr(e.setLabelRef, r.ref);
                typeof o == "function" && o(i);
            },
            get id () {
                return r.id;
            }
        }, ()=>e.dataset(), s));
    }
    function iO(t) {
        const e = Iu();
        return I(de, {
            get when () {
                return e.contentPresent();
            },
            get children () {
                return I(kT, t);
            }
        });
    }
    var Qee = ds();
    function Dct() {
        const t = fs(Qee);
        if (t === void 0) throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");
        return t;
    }
    function ete(t) {
        const n = Yc().generateId(`radiogroup-${ii()}`), r = qt({
            id: n
        }, t), [s, i] = rt(r, [
            "value",
            "defaultValue",
            "onChange",
            "disabled"
        ]), [o, a] = eh({
            value: ()=>s.value,
            defaultValue: ()=>s.defaultValue,
            onChange: (l)=>s.onChange?.(l)
        }), c = {
            isDisabled: ()=>s.disabled,
            isSelectedValue: (l)=>l === o(),
            setSelectedValue: (l)=>a(l)
        };
        return I(Qee.Provider, {
            value: c,
            get children () {
                return I(rO, i);
            }
        });
    }
    function tte(t) {
        const e = Dct(), n = qt({
            closeOnSelect: !1
        }, t), [r, s] = rt(n, [
            "value",
            "onSelect"
        ]);
        return I(tO, qe({
            role: "menuitemradio",
            get checked () {
                return e.isSelectedValue(r.value);
            },
            onSelect: ()=>{
                r.onSelect?.(), e.setSelectedValue(r.value);
            }
        }, s));
    }
    function Bct(t, e, n) {
        const r = t.split("-")[0], s = n.getBoundingClientRect(), i = [], o = e.clientX, a = e.clientY;
        switch(r){
            case "top":
                i.push([
                    o,
                    a + 5
                ]), i.push([
                    s.left,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.top
                ]), i.push([
                    s.right,
                    s.top
                ]), i.push([
                    s.right,
                    s.bottom
                ]);
                break;
            case "right":
                i.push([
                    o - 5,
                    a
                ]), i.push([
                    s.left,
                    s.top
                ]), i.push([
                    s.right,
                    s.top
                ]), i.push([
                    s.right,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.bottom
                ]);
                break;
            case "bottom":
                i.push([
                    o,
                    a - 5
                ]), i.push([
                    s.right,
                    s.top
                ]), i.push([
                    s.right,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.top
                ]);
                break;
            case "left":
                i.push([
                    o + 5,
                    a
                ]), i.push([
                    s.right,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.bottom
                ]), i.push([
                    s.left,
                    s.top
                ]), i.push([
                    s.right,
                    s.top
                ]);
                break;
        }
        return i;
    }
    function Fct(t, e) {
        return e ? Bse([
            t.clientX,
            t.clientY
        ], e) : !1;
    }
    function nte(t) {
        const e = Yc(), n = mee(), r = Hee(), s = O9(), i = zee(), o = qt({
            placement: e.orientation() === "horizontal" ? "bottom-start" : "right-start"
        }, t), [a, c] = rt(o, [
            "open",
            "defaultOpen",
            "onOpenChange"
        ]);
        let l = 0, u = null, d = "right";
        const [f, p] = pe(), [h, m] = pe(), [w, v] = pe(), [k, _] = pe(), [A, P] = pe(!0), [U, K] = pe(c.placement), [X, G] = pe([]), [ce, ie] = pe([]), { DomCollectionProvider: Y } = _ee({
            items: ce,
            onItemsChange: ie
        }), M = P9({
            open: ()=>a.open,
            defaultOpen: ()=>a.defaultOpen,
            onOpenChange: (J)=>a.onOpenChange?.(J)
        }), { present: g } = Ny({
            show: ()=>e.forceMount() || M.isOpen(),
            element: ()=>k() ?? null
        }), y = k9({
            selectionMode: "none",
            dataSource: ce
        }), C = (J)=>{
            P(J), M.open();
        }, R = (J = !1)=>{
            M.close(), J && r && r.close(!0);
        }, N = (J)=>{
            P(J), M.toggle();
        }, L = ()=>{
            const J = k();
            J && (jr(J), y.selectionManager().setFocused(!0), y.selectionManager().setFocusedKey(void 0));
        }, z = ()=>{
            i != null ? setTimeout(()=>L()) : L();
        }, B = (J)=>{
            G((fe)=>[
                    ...fe,
                    J
                ]);
            const se = r?.registerNestedMenu(J);
            return ()=>{
                G((fe)=>G7(fe, J)), se?.();
            };
        }, x = (J)=>d === u?.side && Fct(J, u?.area), O = (J)=>{
            x(J) && J.preventDefault();
        }, q = (J)=>{
            x(J) || z();
        }, H = (J)=>{
            x(J) && J.preventDefault();
        };
        JP({
            isDisabled: ()=>!(r == null && M.isOpen() && e.isModal()),
            targets: ()=>[
                    k(),
                    ...X()
                ].filter(Boolean)
        }), lt(()=>{
            const J = k();
            if (!J || !r) return;
            const se = r.registerNestedMenu(J);
            It(()=>{
                se();
            });
        }), lt(()=>{
            r === void 0 && s?.registerMenu(e.value(), [
                k(),
                ...X()
            ]);
        }), lt(()=>{
            r !== void 0 || s === void 0 || (s.value() === e.value() ? (w()?.focus(), s.autoFocusMenu() && C(!0)) : R());
        }), lt(()=>{
            r !== void 0 || s === void 0 || M.isOpen() && s.setValue(e.value());
        }), It(()=>{
            r === void 0 && s?.unregisterMenu(e.value());
        });
        const te = {
            dataset: Ct(()=>({
                    "data-expanded": M.isOpen() ? "" : void 0,
                    "data-closed": M.isOpen() ? void 0 : ""
                })),
            isOpen: M.isOpen,
            contentPresent: g,
            nestedMenus: X,
            currentPlacement: U,
            pointerGraceTimeoutId: ()=>l,
            autoFocus: A,
            listState: ()=>y,
            parentMenuContext: ()=>r,
            triggerRef: w,
            contentRef: k,
            triggerId: f,
            contentId: h,
            setTriggerRef: v,
            setContentRef: _,
            open: C,
            close: R,
            toggle: N,
            focusContent: z,
            onItemEnter: O,
            onItemLeave: q,
            onTriggerLeave: H,
            setPointerDir: (J)=>d = J,
            setPointerGraceTimeoutId: (J)=>l = J,
            setPointerGraceIntent: (J)=>u = J,
            registerNestedMenu: B,
            registerItemToParentDomCollection: n?.registerItem,
            registerTriggerId: $s(p),
            registerContentId: $s(m)
        };
        return I(Y, {
            get children () {
                return I(Uee.Provider, {
                    value: te,
                    get children () {
                        return I(de, {
                            when: i === void 0,
                            get fallback () {
                                return c.children;
                            },
                            get children () {
                                return I(A9, qe({
                                    anchorRef: w,
                                    contentRef: k,
                                    onCurrentPlacementChange: K
                                }, c));
                            }
                        });
                    }
                });
            }
        });
    }
    function rte(t) {
        const { direction: e } = Zc();
        return I(nte, qe({
            get placement () {
                return e() === "rtl" ? "left-start" : "right-start";
            },
            flip: !0
        }, t));
    }
    var Lct = {
        close: (t, e)=>t === "ltr" ? [
                e === "horizontal" ? "ArrowLeft" : "ArrowUp"
            ] : [
                e === "horizontal" ? "ArrowRight" : "ArrowDown"
            ]
    };
    function ste(t) {
        const e = Iu(), n = Yc(), [r, s] = rt(t, [
            "onFocusOutside",
            "onKeyDown"
        ]), { direction: i } = Zc();
        return I(Kee, qe({
            onOpenAutoFocus: (u)=>{
                u.preventDefault();
            },
            onCloseAutoFocus: (u)=>{
                u.preventDefault();
            },
            onFocusOutside: (u)=>{
                r.onFocusOutside?.(u);
                const d = u.target;
                bo(e.triggerRef(), d) || e.close();
            },
            onKeyDown: (u)=>{
                $n(u, r.onKeyDown);
                const d = bo(u.currentTarget, u.target), f = Lct.close(i(), n.orientation()).includes(u.key), p = e.parentMenuContext() != null;
                d && f && p && (e.close(), jr(e.triggerRef()));
            }
        }, s));
    }
    var Dz = [
        "Enter",
        " "
    ], zct = {
        open: (t, e)=>t === "ltr" ? [
                ...Dz,
                e === "horizontal" ? "ArrowRight" : "ArrowDown"
            ] : [
                ...Dz,
                e === "horizontal" ? "ArrowLeft" : "ArrowUp"
            ]
    };
    function ite(t) {
        let e;
        const n = Yc(), r = Iu(), s = qt({
            id: n.generateId(`sub-trigger-${ii()}`)
        }, t), [i, o] = rt(s, [
            "ref",
            "id",
            "textValue",
            "disabled",
            "onPointerMove",
            "onPointerLeave",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]);
        let a = null;
        const c = ()=>{
            a && window.clearTimeout(a), a = null;
        }, { direction: l } = Zc(), u = ()=>i.id, d = ()=>{
            const _ = r.parentMenuContext();
            if (_ == null) throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");
            return _.listState().selectionManager();
        }, f = ()=>r.listState().collection(), p = ()=>d().focusedKey() === u(), h = S9({
            key: u,
            selectionManager: d,
            shouldSelectOnPressUp: !0,
            allowsDifferentPressOrigin: !0,
            disabled: ()=>i.disabled
        }, ()=>e), m = (_)=>{
            $n(_, i.onClick), !r.isOpen() && !i.disabled && r.open(!0);
        }, w = (_)=>{
            if ($n(_, i.onPointerMove), _.pointerType !== "mouse") return;
            const A = r.parentMenuContext();
            if (A?.onItemEnter(_), !_.defaultPrevented) {
                if (i.disabled) {
                    A?.onItemLeave(_);
                    return;
                }
                !r.isOpen() && !a && (r.parentMenuContext()?.setPointerGraceIntent(null), a = window.setTimeout(()=>{
                    r.open(!1), c();
                }, 100)), A?.onItemEnter(_), _.defaultPrevented || (r.listState().selectionManager().isFocused() && (r.listState().selectionManager().setFocused(!1), r.listState().selectionManager().setFocusedKey(void 0)), jr(_.currentTarget), A?.listState().selectionManager().setFocused(!0), A?.listState().selectionManager().setFocusedKey(u()));
            }
        }, v = (_)=>{
            if ($n(_, i.onPointerLeave), _.pointerType !== "mouse") return;
            c();
            const A = r.parentMenuContext(), P = r.contentRef();
            if (P) {
                A?.setPointerGraceIntent({
                    area: Bct(r.currentPlacement(), _, P),
                    side: r.currentPlacement().split("-")[0]
                }), window.clearTimeout(A?.pointerGraceTimeoutId());
                const U = window.setTimeout(()=>{
                    A?.setPointerGraceIntent(null);
                }, 300);
                A?.setPointerGraceTimeoutId(U);
            } else {
                if (A?.onTriggerLeave(_), _.defaultPrevented) return;
                A?.setPointerGraceIntent(null);
            }
            A?.onItemLeave(_);
        }, k = (_)=>{
            $n(_, i.onKeyDown), !_.repeat && (i.disabled || zct.open(l(), n.orientation()).includes(_.key) && (_.stopPropagation(), _.preventDefault(), d().setFocused(!1), d().setFocusedKey(void 0), r.isOpen() || r.open("first"), r.focusContent(), r.listState().selectionManager().setFocused(!0), r.listState().selectionManager().setFocusedKey(f().getFirstKey())));
        };
        return lt(()=>{
            if (r.registerItemToParentDomCollection == null) throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");
            const _ = r.registerItemToParentDomCollection({
                ref: ()=>e,
                type: "item",
                key: u(),
                textValue: i.textValue ?? e?.textContent ?? "",
                disabled: i.disabled ?? !1
            });
            It(_);
        }), lt(Ji(()=>r.parentMenuContext()?.pointerGraceTimeoutId(), (_)=>{
            It(()=>{
                window.clearTimeout(_), r.parentMenuContext()?.setPointerGraceIntent(null);
            });
        })), lt(()=>It(r.registerTriggerId(i.id))), It(()=>{
            c();
        }), I(yn, qe({
            as: "div",
            ref (_) {
                var A = yr((P)=>{
                    r.setTriggerRef(P), e = P;
                }, i.ref);
                typeof A == "function" && A(_);
            },
            get id () {
                return i.id;
            },
            role: "menuitem",
            get tabIndex () {
                return h.tabIndex();
            },
            "aria-haspopup": "true",
            get "aria-expanded" () {
                return r.isOpen();
            },
            get "aria-controls" () {
                return Ze(()=>!!r.isOpen())() ? r.contentId() : void 0;
            },
            get "aria-disabled" () {
                return i.disabled;
            },
            get "data-key" () {
                return h.dataKey();
            },
            get "data-highlighted" () {
                return p() ? "" : void 0;
            },
            get "data-disabled" () {
                return i.disabled ? "" : void 0;
            },
            get onPointerDown () {
                return Yt([
                    i.onPointerDown,
                    h.onPointerDown
                ]);
            },
            get onPointerUp () {
                return Yt([
                    i.onPointerUp,
                    h.onPointerUp
                ]);
            },
            get onClick () {
                return Yt([
                    m,
                    h.onClick
                ]);
            },
            get onKeyDown () {
                return Yt([
                    k,
                    h.onKeyDown
                ]);
            },
            get onMouseDown () {
                return Yt([
                    i.onMouseDown,
                    h.onMouseDown
                ]);
            },
            get onFocus () {
                return Yt([
                    i.onFocus,
                    h.onFocus
                ]);
            },
            onPointerMove: w,
            onPointerLeave: v
        }, ()=>r.dataset(), o));
    }
    function Uct(t) {
        const e = O9(), n = `menu-${ii()}`, r = qt({
            id: n,
            modal: !0
        }, t), [s, i] = rt(r, [
            "id",
            "modal",
            "preventScroll",
            "forceMount",
            "open",
            "defaultOpen",
            "onOpenChange",
            "value",
            "orientation"
        ]), o = P9({
            open: ()=>s.open,
            defaultOpen: ()=>s.defaultOpen,
            onOpenChange: (c)=>s.onOpenChange?.(c)
        }), a = {
            isModal: ()=>s.modal ?? !0,
            preventScroll: ()=>s.preventScroll ?? a.isModal(),
            forceMount: ()=>s.forceMount ?? !1,
            generateId: gu(()=>s.id),
            value: ()=>s.value,
            orientation: ()=>s.orientation ?? e?.orientation() ?? "horizontal"
        };
        return I(qee.Provider, {
            value: a,
            get children () {
                return I(nte, qe({
                    get open () {
                        return o.isOpen();
                    },
                    get onOpenChange () {
                        return o.setIsOpen;
                    }
                }, i));
            }
        });
    }
    var Hct = {};
    bu(Hct, {
        Root: ()=>M9,
        Separator: ()=>jct
    });
    function M9(t) {
        let e;
        const n = qt({
            orientation: "horizontal"
        }, t), [r, s] = rt(n, [
            "ref",
            "orientation"
        ]), i = Zx(()=>e, ()=>"hr");
        return I(yn, qe({
            as: "hr",
            ref (o) {
                var a = yr((c)=>e = c, r.ref);
                typeof a == "function" && a(o);
            },
            get role () {
                return i() !== "hr" ? "separator" : void 0;
            },
            get "aria-orientation" () {
                return r.orientation === "vertical" ? "vertical" : void 0;
            },
            get "data-orientation" () {
                return r.orientation;
            }
        }, s));
    }
    var jct = M9, qct = {};
    bu(qct, {
        Arrow: ()=>Q1,
        CheckboxItem: ()=>Wee,
        Content: ()=>oO,
        DropdownMenu: ()=>Wct,
        Group: ()=>rO,
        GroupLabel: ()=>Xee,
        Icon: ()=>Gee,
        Item: ()=>sO,
        ItemDescription: ()=>Zee,
        ItemIndicator: ()=>Jee,
        ItemLabel: ()=>Yee,
        Portal: ()=>iO,
        RadioGroup: ()=>ete,
        RadioItem: ()=>tte,
        Root: ()=>aO,
        Separator: ()=>M9,
        Sub: ()=>rte,
        SubContent: ()=>ste,
        SubTrigger: ()=>ite,
        Trigger: ()=>nO
    });
    function oO(t) {
        const e = Yc(), n = Iu(), [r, s] = rt(t, [
            "onCloseAutoFocus",
            "onInteractOutside"
        ]);
        let i = !1;
        return I(Nct, qe({
            onCloseAutoFocus: (c)=>{
                r.onCloseAutoFocus?.(c), i || jr(n.triggerRef()), i = !1, c.preventDefault();
            },
            onInteractOutside: (c)=>{
                r.onInteractOutside?.(c), (!e.isModal() || c.detail.isContextMenu) && (i = !0);
            }
        }, s));
    }
    function aO(t) {
        const e = `dropdownmenu-${ii()}`, n = qt({
            id: e
        }, t);
        return I(Uct, n);
    }
    var Wct = Object.assign(aO, {
        Arrow: Q1,
        CheckboxItem: Wee,
        Content: oO,
        Group: rO,
        GroupLabel: Xee,
        Icon: Gee,
        Item: sO,
        ItemDescription: Zee,
        ItemIndicator: Jee,
        ItemLabel: Yee,
        Portal: iO,
        RadioGroup: ete,
        RadioItem: tte,
        Separator: M9,
        Sub: rte,
        SubContent: ste,
        SubTrigger: ite,
        Trigger: nO
    });
    const Kct = nO, $ct = (t)=>I(aO, qe({
            gutter: 0
        }, t)), Xct = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return I(iO, {
            get children () {
                return I(oO, qe({
                    get class () {
                        return xn("z-50 font-sans min-w-32 origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden bg-popover p-2 text-popover-foreground mt-0 data-[expanded]:animate-content-show", t.class);
                    }
                }, e));
            }
        });
    }, Th = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return I(sO, qe({
            get class () {
                return xn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", t.class);
            }
        }, e));
    };
    var Gct = Q("<button type=button role=switch><span aria-hidden=true>");
    const Tl = (t)=>{
        const [e, n] = rt(t, [
            "checked",
            "onChange",
            "size",
            "class",
            "disabled"
        ]), r = ()=>e.size ?? "md";
        return (()=>{
            var s = Gct(), i = s.firstChild;
            return s.$$click = ()=>{
                e.disabled || e.onChange?.(!e.checked);
            }, Kx(s, qe({
                get "aria-checked" () {
                    return e.checked;
                },
                get disabled () {
                    return e.disabled;
                },
                get class () {
                    return xn("relative inline-flex shrink-0 items-center overflow-hidden rounded-none p-1 transition-[background-color,border-color,box-shadow] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_var(--bg-primary),0_0_0_4px_var(--utility-brand-500)] disabled:cursor-not-allowed", r() === "sm" ? "h-5 w-9" : "h-6 w-11", e.disabled ? e.checked ? "border-[var(--border-disabled)] bg-[var(--bg-disabled)]" : "border border-[var(--border-secondary-alt)] bg-[var(--bg-disabled)]" : e.checked ? "border-[var(--border-brand)] bg-[var(--toggle-track-checked)] hover:bg-[var(--toggle-track-checked-hover)]" : "border border-[var(--border-secondary-alt)] bg-[var(--bg-tertiary)] hover:bg-[var(--bg-tertiary-hover)]", e.class);
                }
            }, n), !1, !0), pt(()=>Vt(i, xn("block border transition-[transform,background-color,border-color] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform", r() === "sm" ? "h-3 w-4" : "h-4 w-5", e.disabled ? "border-[var(--border-disabled)] bg-[var(--bg-primary)]" : e.checked ? "border-[var(--fg-white)] bg-[var(--fg-white)]" : "border-[var(--border-secondary-alt)] bg-[var(--fg-white)]", e.checked ? r() === "sm" ? "translate-x-3" : "translate-x-4" : "translate-x-0"))), s;
        })();
    };
    Pi([
        "click"
    ]);
    var Zct = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M9 6l6 6l-6 6">'), Jct = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 16 18"fill=none stroke=currentColor stroke-linecap=square stroke-linejoin=round><path d="M9.66667 17.1667C9.66667 17.1667 10.3744 17.0656 13.3033 14.1366C16.2322 11.2077 16.2322 6.45897 13.3033 3.53003C12.2656 2.4923 10.9994 1.82224 9.66667 1.51986M9.66667 17.1667H14.6667M9.66667 17.1667L9.66667 12.1667M6.33333 0.500162C6.33333 0.500162 5.62563 0.601264 2.6967 3.5302C-0.232233 6.45913 -0.232233 11.2079 2.6967 14.1368C3.73443 15.1745 5.0006 15.8446 6.33333 16.147M6.33333 0.500162L1.33333 0.5M6.33333 0.500162L6.33333 5.5">'), Yct = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 16 16"fill=none><path d="M4.16666 8.00002C4.16666 5.88293 5.8829 4.16669 7.99999 4.16669C10.1171 4.16669 11.8333 5.88293 11.8333 8.00002C11.8333 10.1171 10.1171 11.8334 7.99999 11.8334C5.8829 11.8334 4.16666 10.1171 4.16666 8.00002Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M7.20565 1.32838C7.28592 1.15822 7.40239 0.971651 7.55825 0.833984L8.44099 1.83322C8.45059 1.82474 8.45512 1.8202 8.45512 1.8202C8.45512 1.8202 8.43719 1.84283 8.41159 1.89715C8.37925 1.9657 8.35152 2.05188 8.33945 2.1405C8.31525 2.3175 8.35632 2.42585 8.44099 2.50065L7.55825 3.49989C7.03919 3.04136 6.95452 2.42748 7.01839 1.96003C7.05025 1.72643 7.12005 1.50984 7.20565 1.32838ZM7.54412 13.4869C7.54412 13.4869 7.54865 13.4914 7.55825 13.4999L8.44099 12.5007C8.59685 12.6383 8.71332 12.8249 8.79359 12.9951C8.87919 13.1765 8.94892 13.3931 8.98085 13.6267C9.04472 14.0941 8.96005 14.708 8.44099 15.1665L7.55825 14.1673C7.64292 14.0925 7.68399 13.9841 7.65979 13.8072C7.64772 13.7185 7.61999 13.6324 7.58765 13.5638C7.56205 13.5095 7.54412 13.4869 7.54412 13.4869Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M12.1565 2.72091C12.3335 2.65734 12.5479 2.60779 12.7554 2.62063L12.6731 3.95142C12.6859 3.95221 12.6922 3.95218 12.6922 3.95218C12.6922 3.95218 12.6636 3.95552 12.6071 3.97581C12.5357 4.00142 12.4552 4.04278 12.3839 4.09688C12.2417 4.20494 12.1941 4.3106 12.2011 4.42336L10.8703 4.50572C10.8275 3.81447 11.2017 3.32052 11.5775 3.03513C11.7652 2.89252 11.9677 2.7887 12.1565 2.72091ZM3.7985 11.5576C3.7985 11.5576 3.79847 11.564 3.79926 11.5768L5.13005 11.4944C5.14289 11.702 5.09335 11.9162 5.02978 12.0933C4.96198 12.2822 4.85816 12.4846 4.71555 12.6724C4.43016 13.0481 3.93621 13.4223 3.24496 13.3795L3.32732 12.0487C3.44008 12.0557 3.54575 12.0081 3.6538 11.8659C3.7079 11.7946 3.74926 11.7141 3.77487 11.6428C3.79516 11.5862 3.7985 11.5576 3.7985 11.5576Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M14.6709 7.20626C14.8411 7.28653 15.0277 7.40306 15.1653 7.55886L14.1661 8.44166C14.1746 8.45126 14.1791 8.45573 14.1791 8.45573C14.1791 8.45573 14.1565 8.43786 14.1022 8.41226C14.0337 8.37993 13.9475 8.35219 13.8589 8.34006C13.6819 8.31593 13.5735 8.35699 13.4987 8.44166L12.4995 7.55886C12.958 7.03986 13.5719 6.95519 14.0393 7.01906C14.2729 7.05093 14.4895 7.12073 14.6709 7.20626ZM2.51248 7.54479C2.51248 7.54479 2.50795 7.54926 2.49946 7.55886L3.49871 8.44166C3.36104 8.59746 3.17446 8.71399 3.0043 8.79426C2.82285 8.87986 2.60625 8.94959 2.37265 8.98153C1.9052 9.04539 1.29133 8.96073 0.832794 8.44166L1.83204 7.55886C1.90683 7.64353 2.01519 7.68466 2.19218 7.66046C2.2808 7.64833 2.36699 7.62066 2.43553 7.58833C2.48986 7.56273 2.51248 7.54479 2.51248 7.54479Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M13.2784 12.1565C13.342 12.3336 13.3915 12.5479 13.3787 12.7554L12.0479 12.6731C12.0471 12.6859 12.0471 12.6922 12.0471 12.6922C12.0471 12.6922 12.0438 12.6636 12.0235 12.6071C11.9979 12.5358 11.9565 12.4552 11.9025 12.384C11.7944 12.2418 11.6887 12.1942 11.576 12.2012L11.4936 10.8704C12.1849 10.8276 12.6788 11.2018 12.9642 11.5775C13.1068 11.7652 13.2107 11.9677 13.2784 12.1565ZM4.44173 3.79853C4.44173 3.79853 4.43536 3.7985 4.42256 3.7993L4.50492 5.13008C4.29738 5.14292 4.08306 5.09338 3.906 5.02981C3.71718 4.96202 3.51468 4.85819 3.32694 4.71558C2.95124 4.43019 2.57706 3.93624 2.61984 3.245L3.95062 3.32736C3.94364 3.44011 3.99121 3.54578 4.13346 3.65383C4.20468 3.70793 4.28521 3.74929 4.35654 3.7749C4.41308 3.7952 4.44173 3.79853 4.44173 3.79853Z"fill=currentColor>'), Qct = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 14"fill=none><path d="M13.6667 13.6667H0V0H13.6667V13.6667ZM6.16667 10.1667H7.5V5.83333H6.16667V10.1667ZM6.16667 4.83854H7.5V3.4987H6.16667V4.83854Z"fill=currentColor>'), elt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 13 15"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M6.50001 0C6.50001 0 5.94088 0.33366 5.79555 0.410673C5.50468 0.56478 5.08089 0.774907 4.55518 0.995387C3.50092 1.43753 2.05132 1.91515 0.450247 2.07386L0 2.11849V6.53219C0 9.22672 1.63303 11.1711 3.18633 12.4115C3.96782 13.0355 4.74667 13.4963 5.32915 13.8011C5.62095 13.9537 6.50001 14.3333 6.50001 14.3333C6.50001 14.3333 7.37908 13.9537 7.67088 13.8011C8.25335 13.4963 9.03215 13.0355 9.81368 12.4115C11.3669 11.1711 13 9.22672 13 6.53219V2.11849L12.5497 2.07386C10.9487 1.91515 9.49908 1.43753 8.44481 0.995387C7.91908 0.774907 7.49528 0.56478 7.20441 0.410673C7.05908 0.33366 6.50001 0 6.50001 0ZM9.66668 5.04102L6.50001 3.25977L3.33333 5.04102V8.62585L6.50001 10.4071L9.66668 8.62585V5.04102ZM4.33333 8.04099V6.18839L6.00001 7.12585V8.97852L4.33333 8.04099ZM7.00001 8.97852V7.12585L8.66668 6.18839V8.04099L7.00001 8.97852ZM6.50001 4.40711L8.14681 5.33344L6.50001 6.25979L4.85319 5.33344L6.50001 4.40711Z"fill=currentColor>'), tlt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z">'), nlt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 20"fill=none><path d="M1.13656 0.292893C1.52708 -0.0976311 2.16107 -0.0976311 2.5516 0.292893L6.19124 3.93254C6.24634 3.97646 6.29669 4.02741 6.34261 4.08391L16.744 14.4853C16.8069 14.5339 16.8637 14.5915 16.9149 14.6562L20.5516 18.2929C20.9417 18.6833 20.9417 19.3165 20.5516 19.707C20.1611 20.0975 19.5271 20.0975 19.1366 19.707L15.9813 16.5517C14.5366 17.3969 12.8149 17.9999 10.8436 17.9999C7.98221 17.9998 5.64923 16.7355 3.92074 15.2929C2.19449 13.8521 1.01055 12.1856 0.417806 11.247C0.297789 11.057 0.129264 10.8064 0.0467126 10.4462C-0.0155249 10.1743 -0.0156168 9.82449 0.0467126 9.55266C0.129399 9.19228 0.29847 8.94135 0.418783 8.7509C1.02116 7.79734 2.2464 6.07696 4.04085 4.61125L1.13656 1.70696C0.746309 1.31648 0.746309 0.683365 1.13656 0.292893ZM5.46175 6.03215C3.82268 7.32622 2.6777 8.9209 2.11019 9.81926C2.07472 9.87541 2.04992 9.91493 2.02913 9.94914C2.01519 9.9721 2.00594 9.98796 1.99984 9.99895V9.99992C2.00583 10.0107 2.01424 10.0268 2.02816 10.0497C2.04882 10.0838 2.07387 10.1236 2.10921 10.1796C2.64191 11.023 3.69606 12.4998 5.20199 13.7568C6.70583 15.0119 8.60044 15.9998 10.8436 15.9999C12.1964 15.9999 13.421 15.6411 14.5106 15.081L12.8748 13.4452C12.2795 13.7968 11.5848 13.9999 10.8436 13.9999C8.63464 13.9997 6.84359 12.2089 6.84359 9.99992C6.84359 9.25866 7.04671 8.56405 7.39828 7.96867L5.46175 6.03215ZM10.8436 1.99992C13.7052 1.99992 16.0388 3.26428 17.7674 4.70696C19.4936 6.14764 20.6766 7.81427 21.2694 8.75285C21.3743 8.91907 21.517 9.13113 21.6063 9.42278L21.6414 9.55364L21.6766 9.76946C21.6999 9.99532 21.6882 10.2432 21.6414 10.4472C21.5587 10.8078 21.3889 11.0592 21.2684 11.2499C20.9501 11.7538 20.4669 12.4583 19.827 13.2226C19.4724 13.646 18.8412 13.7021 18.4178 13.3476C17.9944 12.993 17.9392 12.3618 18.2938 11.9384C18.8649 11.2563 19.2957 10.6268 19.577 10.1816C19.6126 10.1252 19.6381 10.0851 19.659 10.0507C19.6733 10.0272 19.6822 10.011 19.6883 9.99992V9.99895C19.6823 9.98817 19.6736 9.97253 19.66 9.95012C19.6393 9.91609 19.6143 9.87621 19.5789 9.82024C19.0463 8.97684 17.9921 7.50005 16.4862 6.24309C14.9822 4.98788 13.0869 3.99992 10.8436 3.99992C10.462 3.99995 10.092 4.02893 9.73324 4.08196C9.18689 4.16273 8.67827 3.78455 8.59749 3.23821C8.51688 2.69198 8.89405 2.18424 9.44027 2.10344C9.89397 2.03636 10.362 1.99995 10.8436 1.99992ZM2.00081 10.0243V10.0224L1.99984 10.0204C1.99995 10.0221 2.00073 10.0234 2.00081 10.0243ZM8.84359 9.99992C8.84359 11.1044 9.73921 11.9997 10.8436 11.9999C11.0222 11.9999 11.1947 11.9734 11.3592 11.9296L8.91292 9.48332C8.86901 9.64817 8.84359 9.821 8.84359 9.99992Z"fill=currentColor>'), rlt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 10 12"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M5.26465 0.166016L5.26758 0.166992C5.27031 0.168672 5.27491 0.17195 5.28125 0.175781C5.29426 0.183641 5.31542 0.195993 5.34277 0.211914C5.39743 0.243717 5.47977 0.290382 5.58691 0.347656C5.80216 0.4627 6.1168 0.620118 6.50684 0.785156C7.29026 1.1166 8.3654 1.47433 9.5498 1.59277L10 1.6377V5.08984C10 7.1831 8.74178 8.68656 7.56348 9.63574C6.96958 10.1141 6.37828 10.467 5.93652 10.7002C5.71504 10.8171 5.52901 10.9049 5.39746 10.9639C5.33195 10.9932 5.2799 11.0159 5.24316 11.0312C5.22474 11.0389 5.20958 11.0447 5.19922 11.0488C5.19434 11.0508 5.19047 11.0525 5.1875 11.0537L5.18359 11.0547L5.18164 11.0557L5 11.126L4.81836 11.0557L4.81641 11.0547L4.8125 11.0537C4.80953 11.0525 4.80566 11.0508 4.80078 11.0488C4.79042 11.0447 4.77526 11.0389 4.75684 11.0312C4.7201 11.0159 4.66805 10.9932 4.60254 10.9639C4.47099 10.9049 4.28496 10.8171 4.06348 10.7002C3.62172 10.467 3.03042 10.1141 2.43652 9.63574C1.25822 8.68656 0 7.1831 0 5.08984V1.6377L0.450195 1.59277C1.6346 1.47433 2.70974 1.1166 3.49316 0.785156C3.8832 0.620118 4.19784 0.4627 4.41309 0.347656C4.52023 0.290382 4.60257 0.243717 4.65723 0.211914C4.68458 0.195993 4.70574 0.183641 4.71875 0.175781C4.72509 0.17195 4.72969 0.168672 4.73242 0.166992L4.73535 0.166016L5 0L5.26465 0.166016ZM2.72754 8.56836C2.83816 8.66842 2.94998 8.76501 3.06348 8.85645C3.59446 9.28419 4.12835 9.6033 4.53027 9.81543C4.72395 9.91765 4.88598 9.99353 5 10.0449C5.11402 9.99353 5.27605 9.91765 5.46973 9.81543C5.87165 9.6033 6.40554 9.28419 6.93652 8.85645C8.00813 7.99314 9 6.74646 9 5.08984V2.53027C8.93266 2.52038 8.86622 2.50718 8.7998 2.49609L2.72754 8.56836ZM4.88379 1.23047C4.64603 1.35753 4.30377 1.52852 3.88184 1.70703C3.13763 2.02185 2.13221 2.364 1 2.53027V5.08984C1 6.18476 1.43487 7.09932 2.03809 7.84375L7.64355 2.23828C7.06546 2.07738 6.54793 1.88883 6.11816 1.70703C5.69623 1.52852 5.35397 1.35753 5.11621 1.23047C5.074 1.20791 5.03558 1.18468 5 1.16504C4.96442 1.18468 4.926 1.20791 4.88379 1.23047Z"fill=currentColor>'), slt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'), ilt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=none><path d="M17.0516 0.82169C17.1255 0.59859 17.0681 0.352865 16.9028 0.18569C16.7377 0.0185149 16.4927 -0.0418352 16.2687 0.0294898L0.435339 5.07199C0.187472 5.15093 0.014414 5.37516 0.000855698 5.63494C-0.012711 5.89472 0.136064 6.13575 0.374372 6.24006L7.04133 9.15848L10.6004 5.59971L11.4842 6.48361L7.90858 10.0591L10.6312 16.6953C10.7305 16.9371 10.9698 17.0917 11.2311 17.0826C11.4924 17.0736 11.7205 16.9029 11.8027 16.6547L17.0516 0.82169Z"fill=currentColor>'), olt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 17 17"fill=currentColor><path d="M5.625 16.25H0V10.625H5.625V16.25Z"></path><path d="M11.25 16.25H9.58301V14.583H11.25V16.25Z"></path><path d="M15.416 9.58301C15.8763 9.58301 16.25 9.95674 16.25 10.417V15.417C16.2498 15.8771 15.8762 16.25 15.416 16.25H12.916V14.583H14.583V11.25H12.916V9.58301H15.416Z"></path><path d="M8.95801 14.792H7.29102V12.292H8.95801V14.792Z"></path><path d="M11.25 11.667H13.75V13.75H12.083V13.333H9.58301V10.417H11.25V11.667Z"></path><path d="M16.25 8.95801H8.95801V10.625H7.29102V8.125C7.29102 7.66483 7.66483 7.29199 8.125 7.29199H16.25V8.95801Z"></path><path d="M5.625 8.95801H0V7.29199H5.625V8.95801Z"></path><path d="M5.625 5.625H0V0H5.625V5.625Z"></path><path d="M8.95801 5.625H7.29199V0H8.95801V5.625Z"></path><path d="M16.25 5.625H10.625V0H16.25V5.625Z">'), alt = Q('<svg width=36 height=36 viewBox="0 0 36 36"fill=none xmlns=http://www.w3.org/2000/svg><path d="M19.6895 19.6895H16.3105V16.3105H19.6895V19.6895Z"fill=currentColor></path><path d="M19.6895 14.3555H16.3105V10.9756H19.6895V14.3555Z"fill=currentColor></path><path d="M19.6895 5.6416V9.02051H16.3105V5.6416H19.6895Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M18 0C27.9409 0 36 8.05912 36 18C36 27.9409 27.9409 36 18 36C8.05912 36 0 27.9409 0 18C2.75145e-08 8.05912 8.05912 2.75127e-08 18 0ZM18 3.31836C9.90415 3.31836 3.31934 9.9052 3.31934 18C3.31934 26.0948 9.9052 32.6807 18 32.6807C26.0948 32.6807 32.6806 26.0938 32.6807 17.999C32.6807 9.90422 26.0959 3.31836 18 3.31836Z"fill=currentColor>'), clt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path d="M2.49998 5.33331C2.49998 3.40031 4.06698 1.83331 5.99998 1.83331C7.93298 1.83331 9.49998 3.40031 9.49998 5.33331C9.49998 6.85605 8.52758 8.15158 7.16991 8.63298C9.45985 9.16311 11.1666 11.2156 11.1666 13.6666V14.1666H0.833313V13.6666C0.833313 11.2156 2.54013 9.16311 4.83005 8.63298C3.47237 8.15158 2.49998 6.85605 2.49998 5.33331Z"></path><path d="M10.5 5.66669H15.1667V7.00002H10.5V5.66669Z"></path><path d="M10.5 8H15.1667V9.33333H10.5V8Z"></path><path d="M12.5 10.3333H15.1667V11.6666H12.5V10.3333Z">'), llt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path d="M10.5 4.33173H3.09375L10.5 1.16766V4.33173Z"></path><path d="M3.83333 12.4984H1.5V11.1651H3.83333V8.83173H5.16667V11.1651H7.5V12.4984H5.16667V14.8317H3.83333V12.4984Z"></path><path fill-rule=evenodd clip-rule=evenodd d="M14.5 14.8327H6V13.3327H8.33333V10.3327H6V7.99934H3V10.3327H1.5V5.16602H14.5V14.8327ZM11.6667 9.166C11.2064 9.166 10.8333 9.53914 10.8333 9.99934C10.8333 10.4596 11.2064 10.8327 11.6667 10.8327C12.1269 10.8327 12.5 10.4596 12.5 9.99934C12.5 9.53914 12.1269 9.166 11.6667 9.166Z">'), ult = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M6.25359 1.41351C6.11521 1.17781 5.81321 1.09689 5.57553 1.23184L3.26613 2.54305C3.14972 2.60914 3.06467 2.71916 3.03003 2.84846C2.99539 2.97776 3.01405 3.11556 3.08182 3.231C3.84071 4.52362 2.87048 6.1888 1.33331 6.1888C1.05717 6.1888 0.833313 6.41266 0.833313 6.68878V9.31124C0.833313 9.58738 1.05717 9.81124 1.33331 9.81124C2.87009 9.81124 3.83981 11.476 3.08077 12.769C3.01299 12.8844 2.99434 13.0222 3.02898 13.1515C3.06362 13.2808 3.14867 13.3908 3.26508 13.4569L5.57448 14.7681C5.81216 14.903 6.11415 14.8222 6.25253 14.5864C7.03591 13.2521 8.96511 13.2521 9.74851 14.5864C9.88685 14.8221 10.1888 14.903 10.4265 14.768L12.7359 13.4568C12.8524 13.3908 12.9374 13.2807 12.972 13.1514C13.0066 13.0221 12.988 12.8843 12.9202 12.7689C12.161 11.4757 13.1302 9.81124 14.6666 9.81124C14.9428 9.81124 15.1666 9.58738 15.1666 9.31124V6.68878C15.1666 6.41266 14.9428 6.1888 14.6666 6.1888C13.1298 6.1888 12.1602 4.52395 12.9192 3.23106C12.987 3.11562 13.0056 2.97782 12.971 2.84852C12.9363 2.71922 12.8513 2.6092 12.7349 2.54311L10.4255 1.23191C10.1878 1.09696 9.88578 1.17786 9.74745 1.41356C8.96458 2.74704 7.03651 2.74702 6.25359 1.41351ZM7.99998 10.3332C9.28865 10.3332 10.3333 9.28858 10.3333 7.99991C10.3333 6.71124 9.28865 5.66656 7.99998 5.66656C6.71131 5.66656 5.66665 6.71124 5.66665 7.99991C5.66665 9.28858 6.71131 10.3332 7.99998 10.3332Z">'), dlt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path d="M7.01089 1.36195C7.13055 1.51764 7.14802 1.72894 7.05549 1.90215C6.6662 2.63124 6.4453 3.46402 6.4453 4.34988C6.4453 7.22444 8.77555 9.55471 11.6501 9.55471C12.536 9.55471 13.3688 9.33378 14.0978 8.94451C14.271 8.85198 14.4824 8.86944 14.638 8.98911C14.7938 9.10878 14.865 9.30844 14.8202 9.49964C14.1038 12.5566 11.3606 14.8333 8.08462 14.8333C4.26395 14.8333 1.16669 11.736 1.16669 7.91538C1.16669 4.63935 3.44339 1.89628 6.50035 1.17984C6.69155 1.13503 6.89122 1.20627 7.01089 1.36195Z">'), flt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M14.8334 1.16669H1.16669V14.8334H14.8334V1.16669ZM8.00002 4.66669C6.15907 4.66669 4.66669 6.15907 4.66669 8.00002C4.66669 9.84095 6.15907 11.3334 8.00002 11.3334C8.67942 11.3334 9.31129 11.1301 9.83829 10.7811L11.3334 12.2762L12.2762 11.3334L10.7811 9.83829C11.1301 9.31129 11.3334 8.67942 11.3334 8.00002C11.3334 6.15907 9.84095 4.66669 8.00002 4.66669ZM6.00002 8.00002C6.00002 6.89542 6.89542 6.00002 8.00002 6.00002C9.10455 6.00002 10 6.89542 10 8.00002C10 9.10455 9.10455 10 8.00002 10C6.89542 10 6.00002 9.10455 6.00002 8.00002Z">'), plt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path d="M14.8334 14.8334H1.16669V1.16669H14.8334V14.8334ZM7.33335 11.3334H8.66669V7.33335H7.33335V11.3334ZM8.00002 4.83335C7.63182 4.83335 7.33335 5.13183 7.33335 5.50002C7.33335 5.86821 7.63182 6.16669 8.00002 6.16669C8.36822 6.16669 8.66669 5.86821 8.66669 5.50002C8.66669 5.13183 8.36822 4.83335 8.00002 4.83335Z">'), hlt = Q('<svg width=16 height=16 viewBox="0 0 16 16"fill=currentColor xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M13.6616 10.0938V9.50029C13.6616 8.57896 12.9147 7.83209 11.9934 7.83209C11.072 7.83209 10.3252 8.57896 10.3252 9.50029V10.0938H9.16815V14.4984H14.8321V10.0938H13.6616ZM11.325 9.50029C11.325 9.13123 11.6242 8.83209 11.9933 8.83209C12.3623 8.83209 12.6615 9.13123 12.6615 9.50029V10.0938H11.325V9.50029Z"></path><path d="M8.33482 13.8333V9.26045H9.50315C9.50342 9.25778 9.50369 9.25511 9.50389 9.25245C8.92369 8.80118 8.24462 8.47098 7.50475 8.29971C8.86242 7.81831 9.83482 6.5227 9.83482 5C9.83482 3.06701 8.26782 1.5 6.33482 1.5C4.40182 1.5 2.83482 3.06701 2.83482 5C2.83482 6.5227 3.8072 7.81831 5.16489 8.29971C2.87496 8.82978 1.16815 10.8822 1.16815 13.3333V13.8333H8.33482Z">'), glt = Q('<svg width=20 height=20 viewBox="0 0 20 20"fill=currentColor xmlns=http://www.w3.org/2000/svg><path d="M6.66699 13.333L7.25586 13.9229L4.51074 16.667H6.66699V18.333H1.66699V13.333H3.33301V15.4883L6.07715 12.7441L6.66699 13.333ZM16.667 15.4883V13.333H18.333V18.333H13.333V16.667H15.4893L12.7441 13.9229L13.333 13.333L13.9229 12.7441L16.667 15.4883ZM6.66699 1.66699V3.33301H4.51074L7.25586 6.07715L6.66699 6.66699L6.07715 7.25586L3.33301 4.51074V6.66699H1.66699V1.66699H6.66699ZM18.333 6.66699H16.667V4.51074L13.9229 7.25586L13.333 6.66699L12.7441 6.07715L15.4893 3.33301H13.333V1.66699H18.333V6.66699Z">');
    const blt = ()=>Zct(), mlt = ()=>Jct(), ylt = ()=>Yct(), wlt = ()=>Qct(), Ep = ()=>elt(), _lt = ()=>tlt(), xlt = ()=>nlt(), Ip = ()=>rlt(), cO = ()=>slt(), vlt = ()=>ilt(), ote = ()=>olt(), ew = ()=>alt(), Slt = ()=>clt(), klt = ()=>llt(), Tlt = ()=>ult(), Clt = ()=>dlt(), Elt = ()=>flt(), Ilt = ()=>plt(), Alt = ()=>hlt(), Plt = ()=>glt(), cg = "/assets/cardano-ada-logo-white-B9pPeaxq.svg", ab = "/assets/cardano-ada-logo-black-D1FRPH9x.svg", Olt = 220, Mlt = (t)=>{
        document.documentElement.setAttribute("data-theme", t);
    }, ate = (t)=>{
        const e = document.documentElement;
        e.setAttribute("data-theme-transitioning", "true"), requestAnimationFrame(()=>{
            Mlt(t);
        }), window.setTimeout(()=>{
            e.removeAttribute("data-theme-transitioning");
        }, Olt);
    }, Rlt = "data:image/svg+xml,%3csvg%20width='790'%20height='790'%20viewBox='0%200%20790%20790'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M394.993%200C176.842%200%200%20176.839%200%20395C0%20613.161%20176.842%20790%20394.993%20790C613.145%20790%20790%20613.148%20790%20395C790%20176.852%20613.145%200%20394.993%200ZM394.993%20717.159C217.347%20717.159%2072.829%20572.643%2072.829%20395C72.829%20217.357%20217.347%2072.8412%20394.993%2072.8412C572.64%2072.8412%20717.158%20217.357%20717.158%20395C717.158%20572.643%20572.64%20717.159%20394.993%20717.159Z'%20fill='black'/%3e%3cpath%20d='M549.798%20331.851C541.668%20313.206%20530.267%20296.971%20515.608%20283.135C500.949%20269.298%20483.82%20258.663%20464.222%20251.243C444.623%20243.809%20423.209%20240.098%20399.992%20240.098H393.063V314.291H410.606C426.186%20314.291%20439.857%20317.452%20451.605%20323.787C463.354%20330.123%20472.512%20339.298%20479.067%20351.34C485.623%20363.381%20488.907%20377.58%20488.907%20393.961C488.907%20410.343%20485.689%20424.929%20479.254%20436.957C472.819%20448.999%20463.728%20458.241%20451.979%20464.698C440.231%20471.154%20426.44%20474.382%20410.606%20474.382H393.063V548.574H400.86C423.796%20548.574%20445.064%20544.797%20464.662%20537.215C484.261%20529.648%20501.309%20518.932%20515.835%20505.095C530.347%20491.259%20541.668%20474.944%20549.798%20456.165C557.929%20437.373%20561.987%20416.772%20561.987%20394.336C561.987%20371.9%20557.916%20350.496%20549.798%20331.851Z'%20fill='black'/%3e%3cpath%20d='M350.249%20474.368H276.299V548.56H350.249V474.368Z'%20fill='black'/%3e%3cpath%20d='M350.249%20357.233H276.299V431.425H350.249V357.233Z'%20fill='black'/%3e%3cpath%20d='M394.958%20240.085H276.299V314.277H394.958V240.085Z'%20fill='black'/%3e%3c/svg%3e", Nlt = "data:image/svg+xml,%3csvg%20width='790'%20height='790'%20viewBox='0%200%20790%20790'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M394.993%200C176.842%200%200%20176.839%200%20395C0%20613.161%20176.842%20790%20394.993%20790C613.145%20790%20790%20613.148%20790%20395C790%20176.852%20613.145%200%20394.993%200ZM394.993%20717.159C217.347%20717.159%2072.829%20572.643%2072.829%20395C72.829%20217.357%20217.347%2072.8412%20394.993%2072.8412C572.64%2072.8412%20717.158%20217.357%20717.158%20395C717.158%20572.643%20572.64%20717.159%20394.993%20717.159Z'%20fill='white'/%3e%3cpath%20d='M549.798%20331.851C541.668%20313.206%20530.267%20296.971%20515.608%20283.135C500.949%20269.298%20483.82%20258.663%20464.222%20251.243C444.623%20243.809%20423.209%20240.098%20399.992%20240.098H393.063V314.291H410.606C426.186%20314.291%20439.857%20317.452%20451.605%20323.787C463.354%20330.123%20472.512%20339.298%20479.067%20351.34C485.623%20363.381%20488.907%20377.58%20488.907%20393.961C488.907%20410.343%20485.689%20424.929%20479.254%20436.957C472.819%20448.999%20463.728%20458.241%20451.979%20464.698C440.231%20471.154%20426.44%20474.382%20410.606%20474.382H393.063V548.574H400.86C423.796%20548.574%20445.064%20544.797%20464.662%20537.215C484.261%20529.648%20501.309%20518.932%20515.835%20505.095C530.347%20491.259%20541.668%20474.944%20549.798%20456.165C557.929%20437.373%20561.987%20416.772%20561.987%20394.336C561.987%20371.9%20557.916%20350.496%20549.798%20331.851Z'%20fill='white'/%3e%3cpath%20d='M350.249%20474.368H276.299V548.56H350.249V474.368Z'%20fill='white'/%3e%3cpath%20d='M350.249%20357.233H276.299V431.425H350.249V357.233Z'%20fill='white'/%3e%3cpath%20d='M394.958%20240.085H276.299V314.277H394.958V240.085Z'%20fill='white'/%3e%3c/svg%3e", Vlt = "data:image/svg+xml,%3csvg%20width='790'%20height='790'%20viewBox='0%200%20790%20790'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='395'%20cy='395'%20r='395'%20fill='white'/%3e%3cpath%20d='M394.995%2076C218.816%2076%2076%20218.814%2076%20395C76%20571.186%20218.816%20714%20394.995%20714C571.173%20714%20714%20571.175%20714%20395C714%20218.825%20571.173%2076%20394.995%2076ZM394.995%20655.174C251.528%20655.174%20134.816%20538.464%20134.816%20395C134.816%20251.536%20251.528%20134.826%20394.995%20134.826C538.461%20134.826%20655.173%20251.536%20655.173%20395C655.173%20538.464%20538.461%20655.174%20394.995%20655.174Z'%20fill='black'/%3e%3cpath%20d='M520.014%20344.001C513.448%20328.943%20504.24%20315.833%20492.402%20304.658C480.563%20293.484%20466.73%20284.895%20450.903%20278.902C435.075%20272.899%20417.781%20269.902%20399.031%20269.902H393.436V329.819H407.603C420.185%20329.819%20431.226%20332.372%20440.714%20337.489C450.202%20342.606%20457.598%20350.015%20462.892%20359.74C468.186%20369.465%20470.838%20380.931%20470.838%20394.161C470.838%20407.391%20468.24%20419.171%20463.043%20428.885C457.846%20438.609%20450.504%20446.073%20441.016%20451.287C431.528%20456.501%20420.39%20459.108%20407.603%20459.108H393.436V519.026H399.732C418.255%20519.026%20435.431%20515.975%20451.258%20509.852C467.086%20503.741%20480.854%20495.087%20492.585%20483.912C504.305%20472.738%20513.448%20459.563%20520.014%20444.397C526.58%20429.22%20529.858%20412.583%20529.858%20394.464C529.858%20376.345%20526.569%20359.059%20520.014%20344.001Z'%20fill='black'/%3e%3cpath%20d='M358.859%20459.097H299.138V519.015H358.859V459.097Z'%20fill='black'/%3e%3cpath%20d='M358.859%20364.5H299.138V424.417H358.859V364.5Z'%20fill='black'/%3e%3cpath%20d='M394.966%20269.891H299.138V329.809H394.966V269.891Z'%20fill='black'/%3e%3c/svg%3e", Dlt = "data:image/svg+xml,%3csvg%20width='790'%20height='790'%20viewBox='0%200%20790%20790'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='395'%20cy='395'%20r='395'%20fill='black'/%3e%3cpath%20d='M394.995%2076C218.816%2076%2076%20218.814%2076%20395C76%20571.186%20218.816%20714%20394.995%20714C571.173%20714%20714%20571.175%20714%20395C714%20218.825%20571.173%2076%20394.995%2076ZM394.995%20655.174C251.528%20655.174%20134.816%20538.464%20134.816%20395C134.816%20251.536%20251.528%20134.826%20394.995%20134.826C538.461%20134.826%20655.173%20251.536%20655.173%20395C655.173%20538.464%20538.461%20655.174%20394.995%20655.174Z'%20fill='white'/%3e%3cpath%20d='M520.014%20344.001C513.448%20328.943%20504.24%20315.833%20492.402%20304.658C480.563%20293.484%20466.73%20284.895%20450.903%20278.902C435.075%20272.899%20417.781%20269.902%20399.031%20269.902H393.436V329.819H407.603C420.185%20329.819%20431.226%20332.372%20440.714%20337.489C450.202%20342.606%20457.598%20350.015%20462.892%20359.74C468.186%20369.465%20470.838%20380.931%20470.838%20394.161C470.838%20407.391%20468.24%20419.171%20463.043%20428.885C457.846%20438.609%20450.504%20446.073%20441.016%20451.287C431.528%20456.501%20420.39%20459.108%20407.603%20459.108H393.436V519.026H399.732C418.255%20519.026%20435.431%20515.975%20451.258%20509.852C467.086%20503.741%20480.854%20495.087%20492.585%20483.912C504.305%20472.738%20513.448%20459.563%20520.014%20444.397C526.58%20429.22%20529.858%20412.583%20529.858%20394.464C529.858%20376.345%20526.569%20359.059%20520.014%20344.001Z'%20fill='white'/%3e%3cpath%20d='M358.859%20459.097H299.138V519.015H358.859V459.097Z'%20fill='white'/%3e%3cpath%20d='M358.859%20364.5H299.138V424.417H358.859V364.5Z'%20fill='white'/%3e%3cpath%20d='M394.966%20269.891H299.138V329.809H394.966V269.891Z'%20fill='white'/%3e%3c/svg%3e";
    var Blt = Q("<img>");
    const Dc = (t)=>{
        const { environmentSettings: e } = lr(), n = ()=>{
            const r = t.tone === "light" ? !0 : t.tone === "dark" ? !1 : e().theme === "dark";
            return t.kind === "token" ? r ? Dlt : Vlt : r ? Nlt : Rlt;
        };
        return (()=>{
            var r = Blt();
            return Ot(r, "draggable", !1), pt((s)=>{
                var i = n(), o = t.alt ?? "DUST", a = t.class ?? "h-full w-full";
                return i !== s.e && Ot(r, "src", s.e = i), o !== s.t && Ot(r, "alt", s.t = o), a !== s.a && Vt(r, s.a = a), s;
            }, {
                e: void 0,
                t: void 0,
                a: void 0
            }), r;
        })();
    };
    var Flt = Q('<span class="inline-flex items-center gap-2"><span><span></span><span class="hidden sm:inline"></span><span class=sm:hidden></span></span><span class=text-[var(--color-grey-dark-500)]>|</span><i class="icon-box w-1.5 h-1.5 rounded-full bg-emerald-500"></i><span class="text-[10px] lg:text-sm text-[var(--color-grey-dark-400)] transition-colors group-hover:text-[var(--color-grey-dark-300)] group-focus-visible:text-[var(--color-grey-dark-300)]">SYNCED'), Llt = Q('<span class="inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-amber-500/20 text-amber-400"><div class="w-2 h-2 border border-amber-400 border-t-transparent rounded-full animate-spin"></div><span class="text-[10px] font-medium">'), zlt = Q('<span class="flex items-center justify-center w-7 h-7 text-header-muted"><i class="icon-box w-3.5 h-3.5">'), Ult = Q('<span class="type-text-xs text-header-muted">%'), Hlt = Q('<div class="flex items-center gap-1.5"><i class="icon-box w-1.5 h-1.5 rounded-full bg-rose-500"></i><span><span></span><span class="hidden sm:inline"></span><span class=sm:hidden>'), jlt = Q('<div class="relative flex h-3 w-full overflow-hidden border border-[var(--color-grey-dark-700)]"aria-hidden=true><div class="absolute inset-0 bg-[rgba(34,38,47,0.4)]"style="background-image:repeating-linear-gradient(135deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 6px)"></div><div class="relative z-10 h-full shrink-0 backdrop-blur-[14px] transition-[width] duration-300"style="background-image:repeating-linear-gradient(135deg, color-mix(in_srgb,var(--fg-white)_22%,transparent) 0 1px, transparent 1px 6px)">'), qlt = Q('<div class="grid min-w-[160px] gap-1.5"><div class="flex items-center justify-between gap-4 leading-none"><span></span></div><div><span></span><span class="text-[9px] font-medium uppercase tracking-wider hidden sm:inline"></span><span class="text-[9px] font-medium uppercase tracking-wider sm:hidden">'), Wlt = Q('<div class="flex items-center gap-1.5 lg:hidden"><span class="inline-flex items-center gap-1"><span class="inline-flex h-3 w-3 items-center justify-center"></span><span class="text-[9px] font-medium text-header-muted">DUST</span></span><span class="text-[9px] text-header-foreground">'), Klt = Q('<button type=button title="Refresh sync"aria-label="Refresh sync"><div>'), $lt = Q("<span><span></span><span>"), Xlt = Q('<div class="flex items-center gap-2 min-w-0 text-[#94979C]"><i class="w-3.5 h-3.5 shrink-0 text-[#94979C]"></i><span class="min-w-0 flex-1 text-[10px] font-mono truncate"></span><button type=button class="shrink-0 border border-[#373A41] bg-[#22262F] px-1.5 py-0.5 text-[9px] font-semibold tracking-wide text-[#CECFD2] transition-colors hover:border-[#4B5563] hover:text-white">'), Glt = Q('<img alt class="h-full w-full opacity-80">'), Zlt = Q('<div class="w-10 h-10 overflow-hidden bg-[var(--bg-primary-hover)] border border-[var(--border)] flex items-center justify-center shrink-0"><span class="text-md font-medium text-[var(--text-primary)]">'), Jlt = Q('<div class="mt-2 space-y-1">'), Ylt = Q('<div class="bg-[#13161B] p-3 border-b border-[#22262F]"><div class="flex items-center gap-2"><div class="w-10 h-10 overflow-hidden bg-[#22262F] border border-[#373A41] flex items-center justify-center shrink-0"><span class="text-md font-medium text-[#F7F7F7]"></span></div><div class="flex flex-col min-w-0"><span class="text-xs text-header-muted"></span><span class="text-sm font-semibold text-header-foreground uppercase">'), Qlt = Q('<div class="px-2 pb-2 flex gap-1.5">'), eut = Q('<div class="bg-[#13161B] border-b border-[#22262F]"><div class="px-3 py-1 flex items-center justify-between"><div class="flex items-center gap-1.5"><span></span><span class="text-sm font-medium text-[#F7F7F7] uppercase"></span></div><button class="flex items-center gap-1 text-sm font-medium text-[#CECFD2] hover:text-white transition-colors"aria-label="Change network">CHANGE<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6">'), Ch = Q('<i class="w-4 h-4 mr-2 text-[var(--fg-quaternary)] transition-colors group-hover:text-[var(--fg-quaternary-hover)] group-focus:text-[var(--fg-quaternary-hover)]">'), tut = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">ACCOUNTS'), nut = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">ADD WALLET'), rut = Q('<div class="group relative flex cursor-pointer select-none items-center justify-between outline-none px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]"><div class="flex items-center gap-2"><img alt=Cardano class="w-4 h-4 mr-2 opacity-60 group-hover:opacity-80 transition-opacity"><span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)]">CARDANO L1'), sut = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">EXPLORER'), iut = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">SUPPORT'), out = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">LOCK WALLET'), aut = Q('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">SETTINGS'), cut = Q('<div class="py-1 bg-[var(--bg-primary)]"><div class="my-1 mx-0 h-px w-full bg-[var(--border)]"></div><div class="group relative flex cursor-pointer select-none items-center justify-between rounded-none px-4 py-2 text-sm font-semibold outline-none transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]"><div class="flex items-center gap-2"><i class="w-4 h-4 mr-2 text-[var(--fg-quaternary)] transition-colors group-hover:text-[var(--fg-quaternary-hover)]"></i><span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)]"></span></div><div></div></div><div class="group relative flex cursor-pointer select-none items-center justify-between rounded-none px-4 py-2 text-sm font-semibold outline-none transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]"><div class="flex items-center gap-2"><i class="w-4 h-4 mr-2 text-[var(--fg-quaternary)] transition-colors group-hover:text-[var(--fg-quaternary-hover)]"><svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class="w-full h-full"><rect x=3 y=3 width=18 height=18 rx=2></rect><line x1=15 y1=3 x2=15 y2=21></line></svg></i><span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)]">SIDE PANEL</span></div><div></div></div><div class="my-1 mx-0 h-px w-full bg-[var(--border)]"></div><div class="my-1 mx-0 h-px w-full bg-[var(--border)]"></div><div class="my-1 mx-0 h-px w-full bg-[var(--border)]">'), lut = Q('<button><span></span><span class="text-xs font-semibold text-[var(--color-header-foreground)] uppercase tracking-wide">'), uut = Q('<header class="flex-none bg-header lg:border-b lg:border-header-border"><div class="lg:hidden flex items-center h-16 bg-header border-b-2 border-header-divider overflow-hidden"><button class="flex h-full items-center pl-3 shrink-0"title="Open 1AM homepage"aria-label="Open 1AM homepage"></button><div class="flex items-center h-full ml-auto shrink-0"><button class="flex items-center justify-center h-full px-3 sm:px-[22px] shrink-0 border-l border-header-divider hover:bg-[var(--color-header-divider)] active:bg-[var(--color-header-divider)] transition-colors"title="Open in full screen"aria-label="Open in full screen"><i class="icon-box w-5 h-5 text-header-muted"></i></button></div></div><div class="hidden lg:flex items-center justify-between h-20 border-x border-header-divider container mx-auto"><div class="flex items-center h-full gap-2 px-8"><button class="flex items-center"title="Open 1AM homepage"aria-label="Open 1AM homepage"></button></div><div class="flex items-stretch h-full"><div class="flex h-full w-[218px] shrink-0 items-center justify-center border-l border-r border-header-divider px-8 py-4"><div class="grid w-[154px] gap-1.5"><div class="flex items-center justify-between gap-3"><span class="inline-flex items-center gap-1.5"><span class="inline-flex h-3.5 w-3.5 items-center justify-center"></span><span class="type-text-xs text-header-muted"></span></span><span class="type-text-sm font-medium text-header-foreground"></span></div><div class="relative flex h-3 w-[154px] overflow-hidden border border-[var(--color-grey-dark-700)]"aria-hidden=true><div class="absolute inset-0 bg-[rgba(34,38,47,0.4)]"style="background-image:repeating-linear-gradient(135deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 6px)"></div><div class="relative z-10 bg-[var(--utility-brand-50)] backdrop-blur-[14px] transition-[width] duration-300">'), dut = Q('<div class="flex items-center gap-1 cursor-default"><span></span><span>');
    const _7 = ()=>{
        const { isSynced: t, isLoading: e, syncProgress: n, dustBalance: r, formatBalance: s, dustCoins: i, refreshSync: o, lockWallet: a, pendingCount: c, environmentSettings: l, updateSettings: u, wallets: d, activeWalletId: f, activeAccountIndex: p, networkHealth: h, sponsorHealth: m, cardanoEnabled: w, cardanoAddress: v, setCardanoEnabled: k, unshieldedAddress: _, shieldedAddress: A, dustAddress: P } = lr(), [U, K] = pe(0), [X, G] = pe(!1), ce = ()=>iU("DUST", l().environment), ie = ()=>s(r(), 4, "DUST"), Y = Ct(()=>{
            const Ie = i();
            if (Ie.length === 0) return 0;
            const Le = Ie.reduce((Ve, Ne)=>Ve + Ne.generatedNow, 0n), Ge = Ie.reduce((Ve, Ne)=>Ve + Ne.maxCap, 0n);
            return Ge === 0n ? 0 : Math.min(100, Number(Le * 100n / Ge));
        }), M = ()=>t() ? "text-emerald-400" : h().overall === "down" || h().indexer === "down" ? "text-rose-400" : "text-amber-400", g = ()=>e() || !t(), y = Ct(()=>d().find((Ie)=>Ie.id === f())?.name || "Wallet 1"), C = Ct(()=>d().find((Ie)=>Ie.id === f())?.accounts.find((Ie)=>Ie.index === p())?.name || "Account 1"), R = ()=>l().environment === "mainnet" ? "text-emerald-400" : l().environment === "preprod" ? "text-amber-400" : "text-blue-400", [N, L] = pe(!1), [z, B] = pe(null), x = Ct(()=>[
                "preview",
                "preprod",
                "mainnet"
            ].filter((Ie)=>Ie !== l().environment)), O = ()=>l().environment === "mainnet" ? "bg-emerald-400" : l().environment === "preprod" ? "bg-amber-400" : "bg-blue-400", q = ()=>l().environment === "mainnet" ? "var(--fg-success-secondary)" : l().environment === "preprod" ? "var(--bg-warning-solid)" : "var(--fg-brand-secondary)";
        let H;
        lt(()=>{
            X() && !t() && n().percent > 0 && G(!1);
        });
        const Z = async (Ie)=>{
            ate(Ie), await u({
                ...l(),
                theme: Ie
            });
        };
        ga(()=>{}), It(()=>{
            H && window.clearTimeout(H);
        });
        const te = (Ie)=>Ie.length <= 24 ? Ie : `${Ie.slice(0, 12)}...${Ie.slice(-8)}`, J = async (Ie, Le)=>{
            try {
                await navigator.clipboard.writeText(Ie), B(Le), H && window.clearTimeout(H), H = window.setTimeout(()=>B(null), 1500);
            } catch  {
                B(null);
            }
        }, se = Ct(()=>{
            const Ie = m().status;
            return m(), !l().dustSponsorship || l().proofServerMode !== "proofstation" ? null : Ie === "ready" ? {
                text: "SPONSORED",
                color: "text-emerald-400",
                dot: "bg-emerald-400",
                tooltip: "Your transactions are gas-free — powered by 1AM ProofStation"
            } : Ie === "low" ? {
                text: "LOW DUST",
                color: "text-amber-400",
                dot: "bg-amber-400",
                tooltip: "ProofStation dust is running low — transactions may fail soon"
            } : Ie === "empty" ? {
                text: "NO DUST",
                color: "text-rose-400",
                dot: "bg-rose-400",
                tooltip: "No dust available — transactions cannot be sponsored right now"
            } : Ie === "down" ? {
                text: "OFFLINE",
                color: "text-rose-400",
                dot: "bg-rose-400",
                tooltip: "ProofStation is unreachable — try again later"
            } : {
                text: "...",
                color: "text-[var(--color-grey-dark-500)]",
                dot: "bg-[var(--color-grey-dark-500)]",
                tooltip: "Checking status..."
            };
        }), fe = ()=>[
                I(de, {
                    get when () {
                        return t();
                    },
                    get fallback () {
                        return (()=>{
                            var Ie = qlt(), Le = Ie.firstChild, Ge = Le.firstChild, Ve = Le.nextSibling, Ne = Ve.firstChild, be = Ne.nextSibling, Qe = be.nextSibling;
                            return F(Ge, I(de, {
                                get when () {
                                    return h().overall === "down" || h().indexer === "down";
                                },
                                get fallback () {
                                    return Ze(()=>e() ? "INITIALIZING..." : "SYNCING...");
                                },
                                children: "NETWORK DOWN"
                            })), F(Le, I(de, {
                                get when () {
                                    return Ze(()=>!X() && !e() && n().percent > 0 && h().overall !== "down")() && h().indexer !== "down";
                                },
                                get children () {
                                    var le = Ult(), De = le.firstChild;
                                    return F(le, ()=>n().percent, De), le;
                                }
                            }), null), F(Ie, I(de, {
                                get when () {
                                    return h().overall === "down" || h().indexer === "down";
                                },
                                get children () {
                                    var le = Hlt(), De = le.firstChild, Re = De.nextSibling, ee = Re.firstChild, oe = ee.nextSibling, ye = oe.nextSibling;
                                    return F(oe, ()=>ir[l().environment].label), F(ye, (()=>{
                                        var D = Ze(()=>l().environment === "mainnet");
                                        return ()=>D() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                                    })()), pt((D)=>{
                                        var S = `inline-flex items-center gap-1 text-[9px] lg:text-xs font-semibold uppercase tracking-wider ${R()}`, E = `w-1.5 h-1.5 rounded-full shrink-0 ${O()}`;
                                        return S !== D.e && Vt(Re, D.e = S), E !== D.t && Vt(ee, D.t = E), D;
                                    }, {
                                        e: void 0,
                                        t: void 0
                                    }), le;
                                }
                            }), Ve), F(Ie, I(de, {
                                get when () {
                                    return Ze(()=>h().overall !== "down")() && h().indexer !== "down";
                                },
                                get children () {
                                    var le = jlt(), De = le.firstChild, Re = De.nextSibling;
                                    return pt((ee)=>{
                                        var oe = X() ? "0%" : `${n().percent}%`, ye = q();
                                        return oe !== ee.e && Vf(Re, "width", ee.e = oe), ye !== ee.t && Vf(Re, "background-color", ee.t = ye), ee;
                                    }, {
                                        e: void 0,
                                        t: void 0
                                    }), le;
                                }
                            }), Ve), F(be, ()=>ir[l().environment].label), F(Qe, (()=>{
                                var le = Ze(()=>l().environment === "mainnet");
                                return ()=>le() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                            })()), pt((le)=>{
                                var De = `type-text-xs text-header-muted ${!e() && h().overall !== "down" && h().indexer !== "down" ? "animate-pulse" : ""}`, Re = `inline-flex items-center gap-1 cursor-default ${R()}`, ee = `w-1 h-1 rounded-full shrink-0 ${O()}`;
                                return De !== le.e && Vt(Ge, le.e = De), Re !== le.t && Vt(Ve, le.t = Re), ee !== le.a && Vt(Ne, le.a = ee), le;
                            }, {
                                e: void 0,
                                t: void 0,
                                a: void 0
                            }), Ie;
                        })();
                    },
                    get children () {
                        var Ie = Flt(), Le = Ie.firstChild, Ge = Le.firstChild, Ve = Ge.nextSibling, Ne = Ve.nextSibling;
                        return F(Ve, ()=>ir[l().environment].label), F(Ne, (()=>{
                            var be = Ze(()=>l().environment === "mainnet");
                            return ()=>be() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                        })()), pt((be)=>{
                            var Qe = `inline-flex items-center gap-1 text-[9px] lg:text-xs font-semibold uppercase tracking-wider ${R()}`, le = `w-1.5 h-1.5 rounded-full shrink-0 ${O()}`;
                            return Qe !== be.e && Vt(Le, be.e = Qe), le !== be.t && Vt(Ge, be.t = le), be;
                        }, {
                            e: void 0,
                            t: void 0
                        }), Ie;
                    }
                }),
                I(de, {
                    get when () {
                        return c() > 0;
                    },
                    get children () {
                        var Ie = Llt(), Le = Ie.firstChild, Ge = Le.nextSibling;
                        return F(Ge, c), Ie;
                    }
                }),
                I(de, {
                    get when () {
                        return t();
                    },
                    get children () {
                        var Ie = zlt(), Le = Ie.firstChild;
                        return F(Le, I(mlt, {})), Ie;
                    }
                })
            ], ge = (Ie)=>(()=>{
                var Le = Klt(), Ge = Le.firstChild;
                return Le.$$click = ()=>{
                    G(!0), o();
                }, F(Ge, I(fe, {})), F(Le, I(de, {
                    get when () {
                        return t();
                    },
                    get children () {
                        var Ve = Wlt(), Ne = Ve.firstChild, be = Ne.firstChild, Qe = Ne.nextSibling;
                        return F(be, I(Dc, {
                            kind: "symbol",
                            tone: "light",
                            class: "h-full w-full"
                        })), F(Qe, ie), F(Ve, I(de, {
                            get when () {
                                return se();
                            },
                            children: (le)=>{
                                const De = ()=>le().color.includes("emerald") ? "bg-emerald-500/15" : le().color.includes("amber") ? "bg-amber-500/15" : le().color.includes("rose") ? "bg-rose-500/15" : "bg-white/10";
                                return (()=>{
                                    var Re = $lt(), ee = Re.firstChild, oe = ee.nextSibling;
                                    return F(oe, ()=>le().text), pt((ye)=>{
                                        var D = `inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full ${De()}`, S = le().tooltip, E = `w-1 h-1 rounded-full ${le().dot}`, $ = `text-[8px] font-semibold ${le().color}`;
                                        return D !== ye.e && Vt(Re, ye.e = D), S !== ye.t && Ot(Re, "title", ye.t = S), E !== ye.a && Vt(ee, ye.a = E), $ !== ye.o && Vt(oe, ye.o = $), ye;
                                    }, {
                                        e: void 0,
                                        t: void 0,
                                        a: void 0,
                                        o: void 0
                                    }), Re;
                                })();
                            }
                        }), null), Ve;
                    }
                }), null), pt((Ve)=>{
                    var Ne = `group flex flex-col justify-center gap-0.5 text-left transition-colors disabled:cursor-not-allowed ${Ie.class || ""}`, be = g(), Qe = `flex items-center gap-1.5 ${M()}`;
                    return Ne !== Ve.e && Vt(Le, Ve.e = Ne), be !== Ve.t && (Le.disabled = Ve.t = be), Qe !== Ve.a && Vt(Ge, Ve.a = Qe), Ve;
                }, {
                    e: void 0,
                    t: void 0,
                    a: void 0
                }), Le;
            })(), Ce = (Ie)=>{
            const [Le, Ge] = pe(!1), Ve = ()=>y().slice(0, 2).toUpperCase(), Ne = ()=>{
                Ge(!1), t2(!1), e2(!0);
            }, be = async (le)=>{
                Ge(!1), await Z(le);
            }, Qe = (le)=>(()=>{
                    var De = Xlt(), Re = De.firstChild, ee = Re.nextSibling, oe = ee.nextSibling;
                    return F(Re, I(de, {
                        get when () {
                            return le.kind === "shielded";
                        },
                        get fallback () {
                            return I(de, {
                                get when () {
                                    return le.kind === "unshielded";
                                },
                                get fallback () {
                                    return I(de, {
                                        get when () {
                                            return le.kind === "dust";
                                        },
                                        get fallback () {
                                            return (()=>{
                                                var ye = Glt();
                                                return Ot(ye, "src", cg), Ot(ye, "draggable", !1), ye;
                                            })();
                                        },
                                        get children () {
                                            return I(Dc, {
                                                kind: "symbol",
                                                tone: "light",
                                                class: "h-full w-full"
                                            });
                                        }
                                    });
                                },
                                get children () {
                                    return I(Ip, {});
                                }
                            });
                        },
                        get children () {
                            return I(Ep, {});
                        }
                    })), F(ee, ()=>te(le.address)), oe.$$click = (ye)=>{
                        ye.stopPropagation(), J(le.address, le.kind);
                    }, F(oe, ()=>z() === le.kind ? "DONE" : "COPY"), pt((ye)=>{
                        var D = le.address, S = z() === le.kind ? "Copied!" : "Copy address", E = `${z() === le.kind ? "Copied" : "Copy"} ${le.kind} address`;
                        return D !== ye.e && Ot(De, "title", ye.e = D), S !== ye.t && Ot(oe, "title", ye.t = S), E !== ye.a && Ot(oe, "aria-label", ye.a = E), ye;
                    }, {
                        e: void 0,
                        t: void 0,
                        a: void 0
                    }), De;
                })();
            return I($ct, {
                placement: "bottom-end",
                gutter: 8,
                get open () {
                    return Le();
                },
                onOpenChange: Ge,
                get children () {
                    return [
                        I(Kct, {
                            get class () {
                                return `flex items-center justify-center px-3 lg:px-5 py-5 hover:bg-[var(--color-header-divider)] active:bg-[var(--color-header-divider)] transition-colors outline-none cursor-pointer border-0 bg-transparent ${Ie.class || ""}`;
                            },
                            title: "Manage wallets",
                            "aria-label": "Manage wallets",
                            get children () {
                                var le = Zlt(), De = le.firstChild;
                                return F(De, Ve), le;
                            }
                        }),
                        I(Xct, {
                            class: "w-[315px] p-0 bg-[var(--bg-primary)] !border-solid !border !border-[var(--border)] shadow-lg overflow-hidden",
                            get children () {
                                return [
                                    (()=>{
                                        var le = Ylt(), De = le.firstChild, Re = De.firstChild, ee = Re.firstChild, oe = Re.nextSibling, ye = oe.firstChild, D = ye.nextSibling;
                                        return F(ee, Ve), F(ye, y), F(D, C), F(le, I(de, {
                                            get when () {
                                                return Ze(()=>!!l().showDropdownAddresses)() && (_() || A() || P() || w() && v());
                                            },
                                            get children () {
                                                var S = Jlt();
                                                return F(S, I(de, {
                                                    get when () {
                                                        return _();
                                                    },
                                                    get children () {
                                                        return I(Qe, {
                                                            kind: "unshielded",
                                                            get address () {
                                                                return _();
                                                            }
                                                        });
                                                    }
                                                }), null), F(S, I(de, {
                                                    get when () {
                                                        return A();
                                                    },
                                                    get children () {
                                                        return I(Qe, {
                                                            kind: "shielded",
                                                            get address () {
                                                                return A();
                                                            }
                                                        });
                                                    }
                                                }), null), F(S, I(de, {
                                                    get when () {
                                                        return P();
                                                    },
                                                    get children () {
                                                        return I(Qe, {
                                                            kind: "dust",
                                                            get address () {
                                                                return P();
                                                            }
                                                        });
                                                    }
                                                }), null), F(S, I(de, {
                                                    get when () {
                                                        return Ze(()=>!!w())() && v();
                                                    },
                                                    get children () {
                                                        return I(Qe, {
                                                            kind: "cardano",
                                                            get address () {
                                                                return v();
                                                            }
                                                        });
                                                    }
                                                }), null), S;
                                            }
                                        }), null), le;
                                    })(),
                                    (()=>{
                                        var le = eut(), De = le.firstChild, Re = De.firstChild, ee = Re.firstChild, oe = ee.nextSibling, ye = Re.nextSibling, D = ye.firstChild, S = D.nextSibling;
                                        return F(oe, ()=>ir[l().environment].label), ye.$$click = (E)=>{
                                            E.stopPropagation(), L(!N());
                                        }, F(le, I(de, {
                                            get when () {
                                                return N();
                                            },
                                            get children () {
                                                var E = Qlt();
                                                return F(E, I(_r, {
                                                    get each () {
                                                        return x();
                                                    },
                                                    children: ($)=>{
                                                        const re = $ === "mainnet" ? "bg-[var(--fg-success-secondary)]" : $ === "preprod" ? "bg-[var(--fg-warning-secondary)]" : "bg-[var(--fg-brand-secondary)]", ae = $ === "mainnet" ? "border-[color:color-mix(in_srgb,var(--fg-success-secondary)_22%,var(--color-header-border))] bg-[color:color-mix(in_srgb,var(--fg-success-secondary)_8%,var(--color-header))] hover:bg-[color:color-mix(in_srgb,var(--fg-success-secondary)_14%,var(--color-header))]" : $ === "preprod" ? "border-[color:color-mix(in_srgb,var(--fg-warning-secondary)_24%,var(--color-header-border))] bg-[color:color-mix(in_srgb,var(--fg-warning-secondary)_10%,var(--color-header))] hover:bg-[color:color-mix(in_srgb,var(--fg-warning-secondary)_16%,var(--color-header))]" : "border-[color:color-mix(in_srgb,var(--fg-brand-secondary)_26%,var(--color-header-border))] bg-[color:color-mix(in_srgb,var(--fg-brand-secondary)_10%,var(--color-header))] hover:bg-[color:color-mix(in_srgb,var(--fg-brand-secondary)_16%,var(--color-header))]";
                                                        return (()=>{
                                                            var me = lut(), Oe = me.firstChild, ut = Oe.nextSibling;
                                                            return me.$$click = async (dt)=>{
                                                                dt.stopPropagation(), L(!1);
                                                                try {
                                                                    await u({
                                                                        ...l(),
                                                                        environment: $
                                                                    });
                                                                } catch (Ut) {
                                                                    window.alert(Ut instanceof Error ? Ut.message : "Failed to switch network");
                                                                }
                                                            }, Vt(me, `flex-1 flex items-center justify-center gap-1.5 px-2 py-2 rounded-none border transition-colors ${ae}`), Vt(Oe, `w-1.5 h-1.5 rounded-full ${re}`), F(ut, ()=>ir[$].label), pt(()=>Ot(me, "aria-label", `Switch to ${ir[$].label} network`)), me;
                                                        })();
                                                    }
                                                })), E;
                                            }
                                        }), null), pt((E)=>{
                                            var $ = `w-1.5 h-1.5 rounded-full ${O()}`, re = N(), ae = `w-3.5 h-3.5 transition-transform ${N() ? "rotate-90" : ""}`;
                                            return $ !== E.e && Vt(ee, E.e = $), re !== E.t && Ot(ye, "aria-expanded", E.t = re), ae !== E.a && Ot(S, "class", E.a = ae), E;
                                        }, {
                                            e: void 0,
                                            t: void 0,
                                            a: void 0
                                        }), le;
                                    })(),
                                    (()=>{
                                        var le = cut(), De = le.firstChild, Re = De.nextSibling, ee = Re.firstChild, oe = ee.firstChild, ye = oe.nextSibling, D = ee.nextSibling, S = Re.nextSibling, E = S.firstChild, $ = E.nextSibling, re = S.nextSibling, ae = re.nextSibling, me = ae.nextSibling;
                                        return F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: ()=>{
                                                e2(!1), t2(!0);
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(Slt, {})), Oe;
                                                    })(),
                                                    tut()
                                                ];
                                            }
                                        }), De), F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: ()=>{
                                                e2(!1), t2(!0);
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(klt, {})), Oe;
                                                    })(),
                                                    nut()
                                                ];
                                            }
                                        }), De), Re.$$click = ()=>void be(l().theme === "dark" ? "light" : "dark"), F(oe, I(de, {
                                            get when () {
                                                return l().theme === "dark";
                                            },
                                            get fallback () {
                                                return I(Clt, {});
                                            },
                                            get children () {
                                                return I(ylt, {});
                                            }
                                        })), F(ye, ()=>l().theme === "dark" ? "LIGHT MODE" : "DARK MODE"), D.$$click = (Oe)=>Oe.stopPropagation(), F(D, I(Tl, {
                                            get checked () {
                                                return l().theme === "dark";
                                            },
                                            "aria-label": "Toggle dark mode",
                                            onChange: (Oe)=>void be(Oe ? "dark" : "light")
                                        })), S.$$click = async (Oe)=>{
                                            Oe.stopPropagation();
                                            const ut = !l().sidePanelEnabled;
                                            await u({
                                                ...l(),
                                                sidePanelEnabled: ut
                                            }), await chrome.runtime.sendMessage({
                                                type: "SIDE_PANEL_SETTING_CHANGED"
                                            }).catch(()=>{}), ut && window.__ONE_AM_SHELL__ === "popup" && window.close();
                                        }, $.$$click = (Oe)=>Oe.stopPropagation(), F($, I(Tl, {
                                            get checked () {
                                                return l().sidePanelEnabled ?? !1;
                                            },
                                            "aria-label": "Toggle side panel",
                                            onChange: async (Oe)=>{
                                                await u({
                                                    ...l(),
                                                    sidePanelEnabled: Oe
                                                }), await chrome.runtime.sendMessage({
                                                    type: "SIDE_PANEL_SETTING_CHANGED"
                                                }).catch(()=>{}), Oe && window.__ONE_AM_SHELL__ === "popup" && window.close();
                                            }
                                        })), F(le, I(de, {
                                            get when () {
                                                return fg(l().environment);
                                            },
                                            get children () {
                                                var Oe = rut(), ut = Oe.firstChild, dt = ut.firstChild;
                                                return Oe.$$click = (Ut)=>Ut.stopPropagation(), F(Oe, I(Tl, {
                                                    get checked () {
                                                        return w();
                                                    },
                                                    "aria-label": "Toggle Cardano L1",
                                                    onChange: async (Ut)=>{
                                                        await k(Ut);
                                                    }
                                                }), null), pt(()=>Ot(dt, "src", l().theme === "dark" ? cg : ab)), Oe;
                                            }
                                        }), re), F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: ()=>{
                                                const Oe = l().environment === "preprod" ? "preprod" : l().environment;
                                                window.open(`https://explorer.1am.xyz/?network=${Oe}`, "_blank");
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(Elt, {})), Oe;
                                                    })(),
                                                    sut()
                                                ];
                                            }
                                        }), ae), F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: ()=>window.open("mailto:support@1am.xyz", "_blank"),
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(Ilt, {})), Oe;
                                                    })(),
                                                    iut()
                                                ];
                                            }
                                        }), ae), F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: ()=>a(),
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(Alt, {})), Oe;
                                                    })(),
                                                    out()
                                                ];
                                            }
                                        }), me), F(le, I(Th, {
                                            class: "group px-4 py-2 rounded-none text-sm font-semibold transition-colors hover:bg-[var(--bg-secondary-hover)] focus:bg-[var(--bg-secondary-hover)]",
                                            onSelect: Ne,
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Oe = Ch();
                                                        return F(Oe, I(Tlt, {})), Oe;
                                                    })(),
                                                    aut()
                                                ];
                                            }
                                        }), null), le;
                                    })()
                                ];
                            }
                        })
                    ];
                }
            });
        }, Ue = ()=>{
            window.open("https://1am.xyz", "_blank", "noopener,noreferrer");
        };
        return (()=>{
            var Ie = uut(), Le = Ie.firstChild, Ge = Le.firstChild, Ve = Ge.nextSibling, Ne = Ve.firstChild, be = Ne.firstChild, Qe = Le.nextSibling, le = Qe.firstChild, De = le.firstChild, Re = le.nextSibling, ee = Re.firstChild, oe = ee.firstChild, ye = oe.firstChild, D = ye.firstChild, S = D.firstChild, E = S.nextSibling, $ = D.nextSibling, re = ye.nextSibling, ae = re.firstChild, me = ae.nextSibling;
            return Ge.$$click = Ue, F(Ge, I(Vm, {
                class: "max-h-[18px] min-w-[70px] w-auto object-contain",
                animated: !0
            })), F(Ve, I(ge, {
                class: "h-full px-2 sm:px-4 border-l border-header-divider hover:bg-[var(--color-header-divider)] active:bg-[var(--color-header-divider)]"
            }), Ne), Ne.$$click = ()=>{
                const Oe = xi.runtime.getURL("/fullpage.html");
                xi.tabs.create({
                    url: Oe
                }), window.close();
            }, F(be, I(Plt, {})), F(Ve, I(Ce, {
                class: "h-full shrink-0 border-l border-header-divider"
            }), null), De.$$click = Ue, F(De, I(Vm, {
                class: "max-h-8 w-auto object-contain",
                animated: !0
            })), F(S, I(Dc, {
                kind: "symbol",
                tone: "light",
                class: "h-full w-full"
            })), F(E, ce), F($, ie), F(oe, I(de, {
                get when () {
                    return se();
                },
                children: (Oe)=>(()=>{
                        var ut = dut(), dt = ut.firstChild, Ut = dt.nextSibling;
                        return F(Ut, ()=>Oe().text), pt((at)=>{
                            var Qt = Oe().tooltip, ci = `w-1 h-1 rounded-full ${Oe().dot}`, Sn = `text-[9px] font-medium uppercase tracking-wider ${Oe().color}`;
                            return Qt !== at.e && Ot(ut, "title", at.e = Qt), ci !== at.t && Vt(dt, at.t = ci), Sn !== at.a && Vt(Ut, at.a = Sn), at;
                        }, {
                            e: void 0,
                            t: void 0,
                            a: void 0
                        }), ut;
                    })()
            }), null), F(Re, I(ge, {
                get class () {
                    return `h-full px-6 border-r border-header-divider hover:bg-[var(--color-header-divider)] active:bg-[var(--color-header-divider)] ${M()}`;
                }
            }), null), F(Re, I(Ce, {
                class: "h-full"
            }), null), pt((Oe)=>Vf(me, "width", `${Y()}%`)), Ie;
        })();
    };
    Pi([
        "click"
    ]);
    var fut = Q('<span class="relative h-[8px] w-[8px] shrink-0"><span class="absolute left-px top-px h-[6px] w-[6px] rounded-full bg-[var(--badge-dot)]">'), put = Q("<div>");
    const hut = {
        gray: {
            bg: "var(--utility-grey-50)",
            border: "var(--utility-grey-200)",
            text: "var(--utility-grey-700)",
            dot: "var(--utility-grey-500)"
        },
        brand: {
            bg: "var(--utility-brand-50)",
            border: "var(--utility-brand-200)",
            text: "var(--utility-brand-700)",
            dot: "var(--utility-brand-500)"
        },
        error: {
            bg: "var(--utility-error-50)",
            border: "var(--utility-error-200)",
            text: "var(--utility-error-700)",
            dot: "var(--utility-error-500)"
        },
        warning: {
            bg: "var(--utility-warning-50)",
            border: "var(--utility-warning-200)",
            text: "var(--utility-warning-700)",
            dot: "var(--utility-warning-500)"
        },
        success: {
            bg: "var(--utility-success-50)",
            border: "var(--utility-success-200)",
            text: "var(--utility-success-700)",
            dot: "var(--utility-success-500)"
        }
    }, gut = {
        sm: "type-text-xs",
        md: "type-text-sm",
        lg: "type-text-sm"
    }, but = {
        sm: {
            pill: {
                none: "px-[8px] py-[2px]",
                dot: "gap-[4px] pl-[6px] pr-[8px] py-[2px]"
            },
            color: {
                none: "px-[6px] py-[2px]",
                dot: "gap-[4px] px-[6px] py-[2px]"
            },
            modern: {
                none: "px-[6px] py-[2px]",
                dot: "gap-[4px] px-[6px] py-[2px]"
            }
        },
        md: {
            pill: {
                none: "px-[10px] py-[2px]",
                dot: "gap-[6px] pl-[8px] pr-[10px] py-[2px]"
            },
            color: {
                none: "px-[8px] py-[2px]",
                dot: "gap-[6px] px-[8px] py-[2px]"
            },
            modern: {
                none: "px-[8px] py-[2px]",
                dot: "gap-[6px] px-[8px] py-[2px]"
            }
        },
        lg: {
            pill: {
                none: "px-[12px] py-[4px]",
                dot: "gap-[6px] pl-[10px] pr-[12px] py-[4px]"
            },
            color: {
                none: "px-[10px] py-[4px]",
                dot: "gap-[6px] px-[10px] py-[4px]"
            },
            modern: {
                none: "px-[10px] py-[4px]",
                dot: "gap-[6px] px-[10px] py-[4px]"
            }
        }
    }, lg = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "tone",
            "size",
            "variant",
            "icon",
            "style",
            "children"
        ]), r = ()=>e.tone ?? "gray", s = ()=>e.size ?? "sm", i = ()=>e.variant ?? "pill", o = ()=>e.icon ?? "none", a = ()=>{
            const c = hut[r()];
            return i() === "modern" ? {
                "--badge-bg": "var(--bg-primary)",
                "--badge-border": "var(--border-primary)",
                "--badge-text": "var(--text-secondary)",
                "--badge-dot": c.dot,
                "--badge-shadow": "var(--effect-shadow-xs)",
                ...e.style
            } : {
                "--badge-bg": c.bg,
                "--badge-border": c.border,
                "--badge-text": c.text,
                "--badge-dot": c.dot,
                ...e.style
            };
        };
        return (()=>{
            var c = put();
            return Kx(c, qe({
                get class () {
                    return xn("inline-flex items-center whitespace-nowrap rounded-none border border-solid font-medium text-center", "bg-[var(--badge-bg)] border-[var(--badge-border)] text-[var(--badge-text)]", gut[s()], but[s()][i()][o()], i() === "modern" && "shadow-[0_1px_2px_0_var(--badge-shadow)]", e.class);
                },
                get style () {
                    return a();
                }
            }, n), !1, !0), F(c, I(de, {
                get when () {
                    return o() === "dot";
                },
                get children () {
                    return fut();
                }
            }), null), F(c, I(TT, {
                get children () {
                    return [
                        I(td, {
                            get when () {
                                return e.children;
                            },
                            get children () {
                                return e.children;
                            }
                        }),
                        I(td, {
                            get when () {
                                return !e.children;
                            },
                            children: "Label"
                        })
                    ];
                }
            }), null), c;
        })();
    }, Bz = "/assets/divider-hcEMBCLi.png", lO = {
        indexer: "checking",
        rpc: "checking",
        overall: "checking",
        lastChecked: 0
    }, Wx = {
        ...lO,
        proofServer: "checking",
        faucet: "checking",
        services: []
    };
    function cte(t) {
        const e = [];
        return t === "preprod" ? (e.push({
            label: "Shielded Tools Status",
            url: "https://status.shielded.tools/preprod"
        }), e.push({
            label: "Faucet",
            url: "https://faucet.preprod.midnight.network/"
        })) : t === "preview" && (e.push({
            label: "Shielded Tools Status",
            url: "https://status.shielded.tools/preview"
        }), e.push({
            label: "Faucet",
            url: "https://faucet.preview.midnight.network/"
        })), e.push({
            label: "Midnight Telemetry",
            url: "https://telemetry.midnight.network/"
        }), e;
    }
    function mut(t) {
        return t === "preprod" ? "https://faucet.preprod.midnight.network/api/health" : t === "preview" ? "https://faucet.preview.midnight.network/api/health" : null;
    }
    async function yut(t) {
        const e = ir[t];
        if (!e) return {
            ...lO,
            overall: "down",
            lastChecked: Date.now()
        };
        const n = 5e3, r = new AbortController, s = setTimeout(()=>r.abort(), n);
        let i = "down", o = "down";
        try {
            const c = await fetch(e.indexerHttpUrl, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    query: "{ block { height } }"
                }),
                signal: r.signal
            }).catch(()=>null);
            i = c && c.ok ? "up" : "down";
        } catch  {
            i = "down";
        }
        try {
            const c = e.nodeUrl.replace("wss://", "https://").replace("ws://", "http://"), l = await fetch(c, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    id: 1,
                    jsonrpc: "2.0",
                    method: "system_health",
                    params: []
                }),
                signal: r.signal
            }).catch(()=>null);
            o = l && l.ok ? "up" : "down";
        } catch  {
            o = "down";
        }
        return clearTimeout(s), {
            indexer: i,
            rpc: o,
            overall: i === "up" && o === "up" ? "healthy" : i === "down" && o === "down" ? "down" : "degraded",
            lastChecked: Date.now()
        };
    }
    async function lte(t, e) {
        const n = ir[t];
        if (!n) return {
            ...Wx,
            overall: "down",
            lastChecked: Date.now()
        };
        const r = 5e3, s = async (v, k)=>{
            try {
                const _ = new AbortController, A = setTimeout(()=>_.abort(), r), P = await fetch(v, {
                    ...k,
                    signal: _.signal
                }).catch(()=>null);
                return clearTimeout(A), !!P && P.ok;
            } catch  {
                return !1;
            }
        }, i = n.nodeUrl.replace("wss://", "https://").replace("ws://", "http://"), o = mut(t), [a, c, l, u] = await Promise.all([
            s(n.indexerHttpUrl, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    query: "{ block { height } }"
                })
            }),
            s(i, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    id: 1,
                    jsonrpc: "2.0",
                    method: "system_health",
                    params: []
                })
            }),
            e ? s(`${e}/health`).then(async (v)=>{
                if (!v) return !1;
                try {
                    const k = await fetch(`${e}/health`, {
                        signal: AbortSignal.timeout(r)
                    });
                    if (!k.ok) return !0;
                    const _ = await k.json().catch(()=>null);
                    return _?.services?.balance?.status === "ok" || _?.status === "healthy" || !0;
                } catch  {
                    return !0;
                }
            }) : Promise.resolve(!1),
            o ? s(o) : Promise.resolve(!1)
        ]), d = a ? "up" : "down", f = c ? "up" : "down", p = l ? "up" : "down", h = o ? u ? "up" : "down" : "n/a", m = a && c ? "healthy" : !a && !c ? "down" : "degraded", w = [
            {
                label: "Indexer",
                url: n.indexerHttpUrl,
                status: d
            },
            {
                label: "RPC Node",
                url: i,
                status: f
            },
            {
                label: "Proof Server",
                url: e || "Not configured",
                status: e ? p : "down"
            }
        ];
        return o && w.push({
            label: "Faucet",
            url: o,
            status: h
        }), {
            indexer: d,
            rpc: f,
            proofServer: p,
            faucet: h,
            overall: m,
            lastChecked: Date.now(),
            services: w
        };
    }
    const J_ = {
        status: "checking",
        availableWallets: 0,
        totalWallets: 0,
        totalBalance: 0n,
        totalUtxos: 0,
        pendingTxs: 0,
        lastChecked: 0
    }, wut = 50000000000000n;
    async function _ut(t) {
        try {
            const e = await fetch(`${t}/health`, {
                signal: AbortSignal.timeout(8e3)
            });
            if (!e.ok) return {
                ...J_,
                status: "down",
                lastChecked: Date.now()
            };
            const s = (await e.json())?.cluster?.[0]?.wallet_status;
            if (!s) return {
                ...J_,
                status: "down",
                lastChecked: Date.now()
            };
            const i = s.available ?? 0, o = s.total ?? 0, a = s.pendingTxs?.pending ?? 0;
            let c = 0n, l = 0;
            for (const d of s.wallets ?? [])d.dust && (c += BigInt(d.dust.balance || "0"), l += d.dust.utxoCount ?? 0);
            let u;
            return i === 0 || l === 0 || c === 0n ? u = "empty" : c < wut ? u = "low" : u = "ready", {
                status: u,
                availableWallets: i,
                totalWallets: o,
                totalBalance: c,
                totalUtxos: l,
                pendingTxs: a,
                lastChecked: Date.now()
            };
        } catch  {
            return {
                ...J_,
                status: "down",
                lastChecked: Date.now()
            };
        }
    }
    const Y_ = Object.freeze(Object.defineProperty({
        __proto__: null,
        DEFAULT_SPONSOR_HEALTH: J_,
        INITIAL_DETAILED_HEALTH: Wx,
        INITIAL_HEALTH: lO,
        checkDetailedHealth: lte,
        checkNetworkHealth: yut,
        checkSponsorHealth: _ut,
        getExternalLinks: cte
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    var xut = Q('<div class="relative h-5 overflow-hidden border-y border-[var(--border-secondary)] bg-[var(--bg-primary)]"aria-hidden=true><div class="absolute inset-0 opacity-[0.08]"style="background-position:center;background-size:957px 36px;background-repeat:repeat-x">'), vut = Q('<div class="mt-4 flex items-start gap-2 rounded border border-[var(--bg-warning-secondary)] bg-[var(--bg-warning-primary)] p-3"><svg class="mt-0.5 h-4 w-4 shrink-0 text-[var(--fg-warning-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><span class="font-mono text-xs text-[var(--text-warning-primary)]">Switching networks clears cached state and requires a full resync.'), Fz = Q('<span class="flex items-center gap-2"><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><path d="M20 6L9 17l-5-5"></path></svg>Settings Applied'), Lz = Q('<span class="flex items-center gap-2"><span class="animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full"></span>Applying...'), Sut = Q("<div class=mt-4>"), x7 = Q('<svg class="h-3 w-3 text-[var(--fg-success-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><path d="M20 6L9 17l-5-5">'), kut = Q('<div class="mt-6 border-t border-[var(--border-secondary)] pt-5">'), Tut = Q('<div class="border border-rose-500/30 bg-rose-500/10 px-3 py-2 text-xs text-rose-600">'), Cut = Q('<div class="mt-4 border border-[var(--border-secondary)] bg-background p-4"><div class=space-y-3><div><p class="text-sm font-semibold text-foreground">Enable Cardano NIGHT</p><p class="mt-0.5 font-mono text-xs text-content-muted">This wallet needs your recovery phrase one more time to restore Cardano support.</p></div><div class=space-y-2><p class="font-mono text-xs uppercase text-content-muted">Recovery Phrase</p><textarea rows=3 placeholder="Enter your recovery phrase"class="w-full resize-none border border-[var(--border-secondary)] bg-[var(--bg-primary)] px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-content-muted focus:border-[var(--border-primary)]"></textarea></div><div class="flex gap-3">'), Eut = Q('<section class="bg-[var(--bg-primary)] p-4 sm:p-8"><div class="flex items-center justify-between"><div><h2 class="text-[20px] leading-[30px] font-bold text-foreground flex items-center gap-2"><img class="w-5 h-5 shrink-0"alt=Cardano>CARDANO NIGHT</h2><p class="mt-0.5 font-mono text-xs text-content-muted">'), Iut = Q('<button class="w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div class=text-left><p class="text-sm font-semibold text-foreground">Export Recovery Phrase</p><p class="font-mono text-xs text-content-muted">For </p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6">'), Aut = Q('<button class="w-full flex items-center justify-between px-4 py-3.5 hover:bg-[var(--bg-error-primary)] transition-colors"><div class=text-left><p class="text-sm font-semibold text-[var(--text-error-primary)]">Delete Wallet</p><p class="font-mono text-xs text-[var(--fg-error-secondary)]">Remove all data from this device</p></div><svg class="w-4 h-4 text-[var(--border-error-subtle)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6">'), Put = Q('<div class="space-y-3 border-t border-[var(--border-secondary)] pt-4 mt-2"><div class="flex items-center justify-between"><span class="font-mono text-xs text-content-muted"></span><button class="font-mono text-xs font-semibold text-[var(--text-brand-tertiary)] hover:text-[var(--text-brand-secondary)] disabled:opacity-50 transition-colors"></button></div><div class=space-y-1.5></div><div><p class="mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-content-muted-light">External Status Pages</p><div class=space-y-1>'), Out = Q('<div class="flex flex-col h-full overflow-y-auto bg-background max-w-[1280px] mx-auto w-full border-x border-[var(--border-secondary)]"><div class="flex-none bg-[var(--bg-primary)] border-b border-[var(--border-secondary)]"><div class="sticky top-0 z-50 flex items-stretch min-h-[36px] border-b border-[var(--border-secondary)] bg-[var(--bg-primary)] px-6"><button class="inline-flex items-center gap-1 border-x border-[var(--border-secondary)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-sm font-semibold uppercase text-content-muted-dark transition-colors hover:bg-muted hover:text-foreground"><svg class="w-3.5 h-3.5 shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><path d="M19 12H5M12 19l-7-7 7-7"></path></svg><span>GO BACK</span></button></div><div class="grid gap-2 p-6"><h1 class="type-display-sm font-bold text-foreground">SETTINGS</h1><p class="font-mono text-sm uppercase text-foreground">configure your wallet environment and proof server</p></div></div><div class="grid grid-cols-1 bg-[var(--bg-primary)] sm:grid-cols-[326px_40px_minmax(0,1fr)]"><nav class="hidden sm:flex min-h-0 flex-col"aria-label="Settings sections"style=width:326px;min-width:326px><button class="relative w-full min-h-[44px] flex items-center justify-between gap-3 px-6 py-3 text-left border-b border-[var(--border-secondary)] transition-colors hover:bg-muted bg-muted text-foreground"><span class="absolute left-0 top-0 bottom-0 w-[4px] bg-foreground"></span><span class="font-mono text-sm font-semibold text-foreground uppercase">GENERAL</span></button><a href=mailto:support@1am.xyz class="relative w-full min-h-[44px] flex items-center justify-between gap-3 px-6 py-3 text-left border-b border-[var(--border-secondary)] transition-colors hover:bg-muted"><span class="font-mono text-sm font-semibold uppercase text-content-muted">EMAIL SUPPORT</span><svg class="w-4 h-4 text-content-muted-light shrink-0"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path></svg></a><a href=https://t.me/+Q8IpY9pq_6Q1YWNh target=_blank class="relative w-full min-h-[44px] flex items-center justify-between gap-3 px-6 py-3 text-left border-b border-[var(--border-secondary)] transition-colors hover:bg-muted"><span class="font-mono text-sm font-semibold uppercase text-content-muted">TELEGRAM</span><svg class="w-4 h-4 text-content-muted-light shrink-0"viewBox="0 0 24 24"fill=currentColor><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"></path></svg></a><a href=https://1am.xyz/developers target=_blank class="relative w-full min-h-[44px] flex items-center justify-between gap-3 px-6 py-3 text-left border-b border-[var(--border-secondary)] transition-colors hover:bg-muted"><span class="font-mono text-sm font-semibold uppercase text-content-muted">BUILD WITH 1AM</span><svg class="w-4 h-4 text-content-muted-light shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"></path></svg></a><a href=https://build.1am.xyz target=_blank class="relative w-full min-h-[44px] flex items-center justify-between gap-3 px-6 py-3 text-left border-b border-[var(--border-secondary)] transition-colors hover:bg-muted"><span class="font-mono text-sm font-semibold uppercase text-content-muted">AI BUILDER</span><svg class="w-4 h-4 text-content-muted-light shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"></path><path d="M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"></path></svg></a></nav><div class="relative hidden overflow-hidden border-x border-[var(--border-secondary)] bg-[var(--bg-primary)] sm:block"aria-hidden=true><div class="absolute inset-0 opacity-[0.08]"style="background-position:center;background-size:957px 36px;background-repeat:repeat-y"></div></div><div class="flex min-w-0 flex-col"><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><div class="grid gap-0"><h2 class="text-[20px] leading-[30px] font-bold text-foreground">NETWORK ENVIRONMENT</h2><p class="mt-0.5 font-mono text-sm leading-5 uppercase text-foreground">SELECT WHICH MIDNIGHT NETWORK TO CONNECT TO</p></div><div class="mt-6 grid grid-cols-1 gap-[15px] sm:grid-cols-3"role=radiogroup aria-label="Network environment"></div><div class="mt-6 border border-[var(--border-secondary)]"><button class="w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div class=text-left><p class="text-sm font-semibold text-foreground">Delete Cache & Re-sync</p><p class="font-mono text-xs text-content-muted"> / <!> on </p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6"></path></svg></button></div></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><h2 class="text-[20px] leading-[30px] font-bold text-foreground">NETWORK URLS</h2><div class="mt-6 space-y-[14px]"><div class="flex items-start gap-6 pb-2 border-b border-[var(--border-secondary)]"><div class="flex items-center gap-1 flex-none"style=width:159px;min-width:159px><span class="w-[5px] h-[10px] bg-[var(--fg-disabled-subtle)] flex-none"aria-hidden=true></span><span class="font-mono text-sm uppercase text-content-muted">INDEXER</span></div><div class="flex-1 min-w-0 flex items-start gap-2"><p class="flex-1 min-w-0 font-mono text-sm text-foreground break-all leading-5"></p><button class="flex-none w-[18px] h-[18px] flex items-center justify-center opacity-50 hover:opacity-100 hover:-translate-y-px transition-all"aria-label="Copy indexer URL"></button></div></div><div class="flex items-start gap-6 pb-2 border-b border-[var(--border-secondary)]"><div class="flex items-center gap-1 flex-none"style=width:159px;min-width:159px><span class="w-[5px] h-[10px] bg-[var(--fg-disabled-subtle)] flex-none"aria-hidden=true></span><span class="font-mono text-sm uppercase text-content-muted">WEBSOCKET</span></div><div class="flex-1 min-w-0 flex items-start gap-2"><p class="flex-1 min-w-0 font-mono text-sm text-foreground break-all leading-5"></p><button class="flex-none w-[18px] h-[18px] flex items-center justify-center opacity-50 hover:opacity-100 hover:-translate-y-px transition-all"aria-label="Copy websocket URL"></button></div></div><div class="flex items-start gap-6"><div class="flex items-center gap-1 flex-none"style=width:159px;min-width:159px><span class="w-[5px] h-[10px] bg-[var(--fg-disabled-subtle)] flex-none"aria-hidden=true></span><span class="font-mono text-sm uppercase text-content-muted">NODE</span></div><div class="flex-1 min-w-0 flex items-start gap-2"><p class="flex-1 min-w-0 font-mono text-sm text-foreground break-all leading-5"></p><button class="flex-none w-[18px] h-[18px] flex items-center justify-center opacity-50 hover:opacity-100 hover:-translate-y-px transition-all"aria-label="Copy node URL"></button></div></div></div></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><div class="grid gap-0"><h2 class="text-[20px] leading-[30px] font-bold text-foreground">PROOF SERVER</h2><p class="mt-0.5 font-mono text-sm leading-5 uppercase text-foreground">TRANSACTIONS ARE PROVED THROUGH THE MANAGED 1AM PROOF SERVICE.</p></div><div class="mt-6 border border-[var(--border-secondary)] bg-[var(--bg-primary)] p-4"><div class="flex items-center justify-between gap-3"><div class=min-w-0><p class="font-mono text-sm font-semibold uppercase text-foreground">1AM Managed Proof Service</p><p class="mt-1 break-all font-mono text-xs text-content-muted"></p></div></div><p class="mt-3 font-mono text-xs text-content-muted">Local, custom, and WASM proof modes are disabled in this release to reduce approval and configuration risk.</p></div><div class="mt-6 flex items-center justify-between border-t border-[var(--border-secondary)] pt-5"><div><p class="font-mono text-sm font-semibold text-foreground uppercase">DUST SPONSORSHIP</p><p class="mt-0.5 font-mono text-xs text-content-muted"></p></div></div></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><h2 class="text-[20px] leading-[30px] font-bold text-foreground mb-6">DISPLAY</h2><div class=space-y-6><div class="flex items-center justify-between"><div><p class="text-sm font-semibold text-foreground">Dark Mode</p><p class="mt-0.5 font-mono text-xs text-content-muted">Switch between light and dark theme</p></div></div><div class="flex items-center justify-between"><div><p class="text-sm font-semibold text-foreground">Side Panel</p><p class="mt-0.5 font-mono text-xs text-content-muted"></p></div></div><div class="flex items-center justify-between"><div><p class="text-sm font-semibold text-foreground">Show Wallet Addresses</p><p class="mt-0.5 font-mono text-xs text-content-muted"></p></div></div><div class="flex items-center justify-between"><div><p class="text-sm font-semibold text-foreground">Debug Mode</p><p class="mt-0.5 font-mono text-xs text-content-muted"></p></div></div><div class=pt-1><button class="flex items-center gap-2 text-sm font-semibold text-[var(--text-brand-tertiary)] hover:text-[var(--text-brand-secondary)] transition-colors"><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>Open in Full Screen Tab</button></div></div></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><h2 class="text-[20px] leading-[30px] font-bold text-foreground mb-6">SECURITY</h2><div class=mb-6><p class="text-sm font-semibold text-foreground mb-1">Auto-Lock Timeout</p><p class="mt-0.5 font-mono text-xs text-content-muted mb-3">Lock wallet after inactivity</p><div class="flex gap-1.5"></div></div><div class="border border-[var(--border-secondary)] divide-y divide-[var(--border-secondary)] mb-6"></div><div class="border border-[var(--border-secondary)] divide-y divide-[var(--border-secondary)]"><button class="w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div class=text-left><p class="text-sm font-semibold text-foreground">Lock Wallet</p><p class="font-mono text-xs text-content-muted"></p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6"></path></svg></button></div></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><button class="-m-4 mb-1 w-[calc(100%+2rem)] rounded-none px-4 py-4 text-left transition-colors hover:bg-[var(--bg-primary-hover)] sm:-m-8 sm:w-[calc(100%+4rem)] sm:px-8 sm:py-8"><div class="flex items-start justify-between gap-4"><div><div class="flex items-center gap-3"><h2 class="text-[20px] leading-[30px] font-bold text-foreground">SERVICE STATUS</h2><div></div></div><p class="mt-1 font-mono text-xs text-content-muted"></p></div><svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M6 9l6 6 6-6"></path></svg></div></button></section><section class="bg-[var(--bg-primary)] p-4 sm:p-8"><h2 class="text-[20px] leading-[30px] font-bold text-foreground mb-6">HELP</h2><div class="border border-[var(--border-secondary)] divide-y divide-[var(--border-secondary)]"><a href=https://1am.xyz target=_blank rel="noopener noreferrer"class="flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div><p class="text-sm font-semibold text-foreground">About 1AM</p><p class="font-mono text-xs text-content-muted">Learn more at 1am.xyz</p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"></path></svg></a><a href=https://explorer.1am.xyz target=_blank rel="noopener noreferrer"class="flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div><p class="text-sm font-semibold text-foreground">Block Explorer</p><p class="font-mono text-xs text-content-muted">explorer.1am.xyz</p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"></path></svg></a><a href=mailto:team@1am.xyz class="flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div><p class="text-sm font-semibold text-foreground">Contact Support</p><p class="font-mono text-xs text-content-muted">team@1am.xyz</p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"></path></svg></a><a href=https://webisoft.com target=_blank rel="noopener noreferrer"class="flex items-center justify-between px-4 py-3.5 hover:bg-muted transition-colors"><div><p class="text-sm font-semibold text-foreground">Built by Webisoft</p><p class="font-mono text-xs text-content-muted">webisoft.com</p></div><svg class="w-4 h-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"></path></svg></a></div><p class="mt-4 text-center font-mono text-[10px] text-content-muted-light">1AM Wallet v<!> — <a href=https://webisoft.com target=_blank rel="noopener noreferrer"class="underline hover:text-foreground transition-colors">1AM by Webisoft'), Mut = Q('<span class="absolute inset-[31.25%] rounded-full bg-white">'), Rut = Q("<span aria-hidden=true>"), Nut = Q('<button role=radio><div class="flex items-center gap-2 w-full"><h3 class="flex-1 text-lg font-semibold text-foreground leading-7 uppercase"></h3></div><p class="font-mono text-sm leading-5 text-content-muted">'), Vut = Q('<span class="inline-flex items-center border border-[var(--border-secondary)] bg-muted px-1.5 py-0.5 font-mono text-[11px] text-content-muted-dark whitespace-nowrap">COMING SOON'), v7 = Q('<svg class="w-3 h-3 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=9 y=9 width=13 height=13 rx=2 ry=2></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1">'), Dut = Q('<span class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full">'), But = Q("<button>m"), zz = Q('<p class="text-xs text-[var(--text-error-primary)] font-mono">'), Fut = Q('<div class=space-y-3><p class="text-xs font-semibold text-foreground">Continue with <!> to continue</p><p class="text-xs font-mono text-content-muted leading-relaxed">1AM will re-authenticate this social wallet, reconstruct the vault unlock key locally, and then reveal the mnemonic for this device only.</p><div class="flex gap-2"><button class="flex-1 h-9 border border-[var(--border-secondary)] font-mono text-sm font-semibold text-content-muted hover:bg-muted transition-colors">Cancel</button><button class="flex-1 h-9 text-sm font-mono font-semibold bg-[var(--bg-error-solid)] text-primary-foreground hover:opacity-90 transition-colors disabled:opacity-40">'), Lut = Q('<div class="p-4 space-y-4"><div class="flex items-center gap-2"><svg class="w-5 h-5 text-foreground shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect width=18 height=11 x=3 y=11 rx=2 ry=2></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg><p class="text-sm font-semibold text-foreground">Reveal Secret Recovery Phrase</p></div><p class="text-xs text-foreground leading-relaxed">Your <span class="text-[var(--text-error-primary)] font-semibold">Secret Recovery Phrase</span> gives full access to your wallet, funds, and accounts.</p><div class="bg-[var(--bg-error-primary)] border-l-[3px] border-[var(--border-error)] px-3 py-2.5"><div class="flex items-start gap-2"><svg class="w-4 h-4 text-[var(--fg-error-secondary)] shrink-0 mt-0.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><div><p class="text-xs text-[var(--text-error-primary)] leading-relaxed font-medium">Make sure nobody is looking at your screen. 1AM Support will never ask for this phrase.'), zut = Q('<div class=space-y-3><p class="text-xs font-mono text-foreground">Recovery phrase for <span class=font-semibold></span></p><div class="rounded border border-[var(--bg-warning-secondary)] bg-[var(--bg-warning-primary)] p-4"><p class="font-mono text-sm text-foreground leading-relaxed select-all break-words"></p></div><p class="text-[11px] font-mono text-content-muted leading-relaxed">This phrase restores all <!> account<!> in this wallet. Accounts are derived deterministically from this seed.</p><button class="w-full h-9 border border-[var(--border-secondary)] font-mono text-sm font-semibold text-content-muted hover:bg-muted transition-colors">Done'), Uut = Q('<div class=space-y-3><p class="text-xs font-semibold text-foreground">Enter password to continue</p><div class="flex gap-2"><button class="flex-1 h-9 border border-[var(--border-secondary)] font-mono text-sm font-semibold text-content-muted hover:bg-muted transition-colors">Cancel</button><button class="flex-1 h-9 text-sm font-mono font-semibold bg-[var(--bg-error-solid)] text-primary-foreground hover:opacity-90 transition-colors disabled:opacity-40">'), Hut = Q('<div class="p-4 space-y-3"><p class="text-xs text-[var(--text-error-primary)] font-mono">This permanently deletes your wallet from this device. Type <strong>DELETE</strong> to confirm.</p><div class="flex gap-2"><button class="flex-1 h-9 border border-[var(--border-secondary)] font-mono text-sm font-semibold text-content-muted hover:bg-muted transition-colors">Cancel</button><button class="flex-1 h-9 text-sm font-mono font-semibold bg-[var(--bg-error-solid)] text-primary-foreground hover:opacity-90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed">Delete Forever'), jut = Q('<div class="ml-3 shrink-0 inline-flex items-center gap-1.5 px-2 py-0.5 rounded-none bg-muted text-content-muted font-mono text-[10px] font-semibold uppercase"><span class="w-1.5 h-1.5 rounded-full bg-[var(--border-secondary)] animate-pulse"></span>...'), qut = Q('<div class="flex items-center justify-between py-2 px-3 bg-muted border border-[var(--border-secondary)]"><div class="flex-1 min-w-0"><p class="text-sm font-semibold text-foreground"></p><p class="font-mono text-[10px] text-content-muted truncate">'), Wut = Q('<a target=_blank rel="noopener noreferrer"class="flex items-center justify-between py-2 px-3 bg-muted border border-[var(--border-secondary)] hover:bg-card transition-colors"><span class="text-sm font-semibold text-foreground"></span><svg class="w-3.5 h-3.5 shrink-0 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3">');
    const Kut = (t)=>{
        const { environmentSettings: e, updateSettings: n, lockWallet: r, deleteWallet: s, fullResync: i, activeAccountIndex: o, cardanoEnabled: a, cardanoHasMnemonic: c, setCardanoEnabled: l, enableCardanoWithMnemonic: u, getVaultSeed: d, exportMnemonic: f, wallets: p, activeWalletId: h } = lr(), m = ()=>p().find((je)=>je.id === h())?.name || "Wallet", w = ()=>p().find((je)=>je.id === h())?.accounts?.filter((je)=>!je.hidden)?.length || 1, [v, k] = pe(e().environment), _ = Ct(()=>ir[v()].proofServerUrl), [A, P] = pe(e().dustSponsorship ?? !0), [U, K] = pe(e().autoLockMinutes || LO), [X, G] = pe(e().sidePanelEnabled || !1), [ce, ie] = pe(e().showDropdownAddresses || !1), [Y, M] = pe(e().debugMode || !1), [g, y] = pe(e().theme || "light"), [C, R] = pe(!1), [N, L] = pe(!1), [z, B] = pe(""), [x, O] = pe(!1), [q, H] = pe(Wx), [Z, te] = pe(!1), [J, se] = pe(null), [fe, ge] = pe(null), [Ce, Ue] = pe(!1), [Ie, Le] = pe(""), [Ge, Ve] = pe(""), [Ne, be] = pe(""), [Qe, le] = pe(!1), [De, Re] = pe(!1), [ee, oe] = pe(""), [ye, D] = pe(""), [S, E] = pe(!1), [$, re] = pe("password"), [ae, me] = pe(null);
        let Oe;
        const ut = 6e4, dt = ()=>{
            Ue(!1), Ve(""), Le(""), be(""), le(!1), Oe && (clearTimeout(Oe), Oe = void 0);
        }, Ut = ()=>{
            Oe && clearTimeout(Oe), Oe = setTimeout(dt, ut);
        }, at = (je)=>{
            Ve(je), le(!1), Ut();
        }, Qt = (je)=>{
            be("Wrong password"), le(!1);
        }, ci = (je)=>{
            const Lt = je instanceof Error ? je.message : "Failed to verify your social wallet.";
            /Wrong password/i.test(Lt) ? be("This social account does not match the wallet stored on this device.") : be(Lt), le(!1);
        }, Sn = async ()=>{
            const je = ae();
            if (!je) {
                be("No social login provider is recorded for this wallet.");
                return;
            }
            le(!0), be("");
            try {
                let Lt = await wot(je);
                if (Lt || (Lt = await yot(je)), !Lt) return;
                const pn = await _ot(Lt);
                try {
                    const hn = await f(pn.vaultUnlockKey);
                    at(hn);
                } finally{
                    pn.vaultUnlockKey.fill(0);
                }
            } catch (Lt) {
                ci(Lt);
            }
        }, Hn = ()=>{
            Re(!1), oe(""), D(""), E(!1);
        }, Qc = async ()=>{
            if (a()) {
                Hn(), await l(!1);
                return;
            }
            if (c()) {
                Hn(), await l(!0);
                return;
            }
            D(""), Re(!0);
        }, jn = async ()=>{
            const je = ee().trim().split(/\s+/).filter(Boolean).join(" ");
            if (!je) {
                D("Enter your recovery phrase to enable Cardano NIGHT.");
                return;
            }
            if (!bU(je, IT)) {
                D("Invalid recovery phrase. Please check your words and try again.");
                return;
            }
            E(!0), D("");
            try {
                const Lt = await d(), pn = zQ(je);
                if (!Lt || pn !== Lt) {
                    D("This recovery phrase does not match your wallet. Please enter the correct recovery phrase."), E(!1);
                    return;
                }
                await u(je), Hn();
            } catch (Lt) {
                D(Lt instanceof Error ? Lt.message : "Failed to enable Cardano NIGHT."), E(!1);
            }
        };
        It(dt);
        const An = async ()=>{
            te(!0);
            try {
                const je = await lte(v(), _());
                H(je);
            } catch (je) {
                console.error("[Settings] Health check failed:", je), H(Wx);
            } finally{
                te(!1);
            }
        };
        ga(async ()=>{
            An();
            try {
                const je = await zi();
                re(je.walletKind ?? "password"), me(je.socialAuth?.loginProvider ?? null);
            } catch  {
                re("password"), me(null);
            }
        });
        const ya = Ct(()=>v() !== e().environment || A() !== (e().dustSponsorship ?? !0) || U() !== (e().autoLockMinutes || LO) || g() !== (e().theme || "light")), ar = Ct(()=>v() !== e().environment), Ln = async ()=>{
            R(!0);
            try {
                await n({
                    environment: v(),
                    proofServerUrl: ir[v()].proofServerUrl,
                    proofServerMode: "proofstation",
                    dustSponsorship: A(),
                    autoLockMinutes: U(),
                    theme: g()
                }), L(!0), setTimeout(()=>L(!1), 2e3);
            } catch (je) {
                window.alert(je instanceof Error ? je.message : "Failed to save settings");
            } finally{
                R(!1);
            }
        }, el = async ()=>{
            z() === "DELETE" && await s();
        }, Gn = (je)=>{
            ge((Lt)=>Lt === je ? null : je);
        }, _e = async (je, Lt)=>{
            try {
                await navigator.clipboard.writeText(je), se(Lt), setTimeout(()=>se(null), 1500);
            } catch  {}
        }, an = Ct(()=>ir[v()]), kt = ()=>(()=>{
                var je = xut(), Lt = je.firstChild;
                return Vf(Lt, "background-image", `url(${Bz})`), je;
            })();
        return (()=>{
            var je = Out(), Lt = je.firstChild, pn = Lt.firstChild, hn = pn.firstChild, nr = Lt.nextSibling, gn = nr.firstChild, Wt = gn.firstChild, li = Wt.nextSibling, rn = li.firstChild;
            rn.nextSibling;
            var Pn = li.nextSibling, Qa = Pn.firstChild;
            Qa.nextSibling;
            var ec = Pn.nextSibling, tl = ec.firstChild;
            tl.nextSibling;
            var Bs = ec.nextSibling, Qd = Bs.firstChild;
            Qd.nextSibling;
            var Pu = gn.nextSibling, ef = Pu.firstChild, to = Pu.nextSibling, nl = to.firstChild, tc = nl.firstChild, ui = tc.firstChild;
            ui.nextSibling;
            var nc = tc.nextSibling, Vi = nc.nextSibling, rc = Vi.firstChild, Ou = rc.firstChild, Mu = Ou.firstChild, sc = Mu.nextSibling, Ru = sc.firstChild, rl = Ru.nextSibling;
            rl.nextSibling;
            var lb = nl.nextSibling, L9 = lb.firstChild, z9 = L9.nextSibling, uw = z9.firstChild, U9 = uw.firstChild, H9 = U9.nextSibling, dw = H9.firstChild, nh = dw.nextSibling, rh = uw.nextSibling, ub = rh.firstChild, j9 = ub.nextSibling, Nu = j9.firstChild, sh = Nu.nextSibling, q9 = rh.nextSibling, W9 = q9.firstChild, K9 = W9.nextSibling, ih = K9.firstChild, db = ih.nextSibling, oh = lb.nextSibling, fw = oh.firstChild, $9 = fw.firstChild;
            $9.nextSibling;
            var pw = fw.nextSibling, tf = pw.firstChild, ah = tf.firstChild, X9 = ah.firstChild, G9 = X9.nextSibling, hw = pw.nextSibling, Z9 = hw.firstChild, nf = Z9.firstChild, fb = nf.nextSibling, pb = oh.nextSibling, J9 = pb.firstChild, gw = J9.nextSibling, ch = gw.firstChild, lh = ch.firstChild, Y9 = lh.firstChild;
            Y9.nextSibling;
            var hb = ch.nextSibling, bw = hb.firstChild, Q9 = bw.firstChild, mw = Q9.nextSibling, gb = hb.nextSibling, yw = gb.firstChild, ww = yw.firstChild, _w = ww.nextSibling, xw = gb.nextSibling, DO = xw.firstChild, BO = DO.firstChild, e5 = BO.nextSibling, ue = xw.nextSibling, xe = ue.firstChild, Ee = pb.nextSibling, we = Ee.firstChild, Pe = we.nextSibling, ot = Pe.firstChild, Tt = ot.nextSibling, We = Tt.nextSibling, gt = Pe.nextSibling, Et = gt.nextSibling, sn = Et.firstChild, Zn = sn.firstChild, dr = Zn.firstChild, wa = dr.nextSibling, Fs = Ee.nextSibling, Di = Fs.firstChild, _t = Di.firstChild, on = _t.firstChild, qn = on.firstChild, fr = qn.firstChild, di = fr.nextSibling, Wn = qn.nextSibling, ks = on.nextSibling, Rn = Fs.nextSibling, Lr = Rn.firstChild, No = Lr.nextSibling, fi = No.nextSibling, uh = fi.firstChild, ic = uh.nextSibling;
            return ic.nextSibling, r2(hn, "click", t.onBack, !0), Vf(ef, "background-image", `url(${Bz})`), F(nc, I(_r, {
                get each () {
                    return Object.values(ir);
                },
                children: (tt)=>(()=>{
                        var Nn = Nut(), zr = Nn.firstChild, ct = zr.firstChild, Vn = zr.nextSibling;
                        return Nn.$$click = ()=>tt.enabled && k(tt.name), F(ct, (()=>{
                            var zn = Ze(()=>tt.name === "preprod");
                            return ()=>zn() ? "PREPROD" : tt.label.toUpperCase();
                        })()), F(zr, I(de, {
                            get when () {
                                return tt.enabled;
                            },
                            get fallback () {
                                return Vut();
                            },
                            get children () {
                                var zn = Rut();
                                return F(zn, I(de, {
                                    get when () {
                                        return v() === tt.name;
                                    },
                                    get children () {
                                        return Mut();
                                    }
                                })), pt(()=>Vt(zn, `w-4 h-4 rounded-full flex-none shrink-0 ${v() === tt.name ? "bg-[var(--bg-brand-solid)] relative overflow-hidden" : "border border-[var(--border-primary)] bg-transparent"}`)), zn;
                            }
                        }), null), F(Vn, ()=>tt.description), pt((zn)=>{
                            var Ts = `
                      min-h-[76px] flex flex-col gap-1 justify-center px-4 py-3 text-left transition-all
                      ${v() === tt.name ? "border-2 border-[var(--border-primary)] bg-[var(--bg-primary-hover)]" : tt.enabled ? "border border-[var(--border-secondary)] bg-[var(--bg-primary)] hover:border-[var(--border-primary)]" : "border border-[var(--border-secondary)] bg-muted cursor-default"}
                    `, hs = !tt.enabled, rr = v() === tt.name;
                            return Ts !== zn.e && Vt(Nn, zn.e = Ts), hs !== zn.t && (Nn.disabled = zn.t = hs), rr !== zn.a && Ot(Nn, "aria-checked", zn.a = rr), zn;
                        }, {
                            e: void 0,
                            t: void 0,
                            a: void 0
                        }), Nn;
                    })()
            })), F(nl, I(de, {
                get when () {
                    return ar();
                },
                get children () {
                    return [
                        vut(),
                        (()=>{
                            var tt = Sut();
                            return F(tt, I($r, {
                                onClick: Ln,
                                get disabled () {
                                    return C() || N();
                                },
                                get class () {
                                    return `h-10 px-6 font-mono text-sm font-semibold uppercase tracking-wide transition-colors ${N() ? "bg-[var(--bg-success-solid)] text-primary-foreground cursor-default" : "bg-[var(--bg-warning-solid)] hover:opacity-90 text-primary-foreground"}`;
                                },
                                get children () {
                                    return [
                                        I(de, {
                                            get when () {
                                                return N();
                                            },
                                            get children () {
                                                return Fz();
                                            }
                                        }),
                                        I(de, {
                                            get when () {
                                                return Ze(()=>!N())() && C();
                                            },
                                            get children () {
                                                return Lz();
                                            }
                                        }),
                                        I(de, {
                                            get when () {
                                                return Ze(()=>!N())() && !C();
                                            },
                                            children: "Apply & Resync Wallet"
                                        })
                                    ];
                                }
                            })), tt;
                        })()
                    ];
                }
            }), Vi), rc.$$click = async ()=>{
                t.onBack(), await i();
            }, F(sc, m, Ru), F(sc, ()=>p().find((tt)=>tt.id === h())?.accounts.find((tt)=>tt.index === o())?.name || "Account 1", rl), F(sc, ()=>ir[e().environment].label, null), F(to, I(kt, {}), lb), F(dw, ()=>an().indexerHttpUrl), nh.$$click = ()=>_e(an().indexerHttpUrl, "indexer"), F(nh, I(de, {
                get when () {
                    return J() === "indexer";
                },
                get fallback () {
                    return v7();
                },
                get children () {
                    return x7();
                }
            })), F(Nu, ()=>an().indexerWsUrl), sh.$$click = ()=>_e(an().indexerWsUrl, "ws"), F(sh, I(de, {
                get when () {
                    return J() === "ws";
                },
                get fallback () {
                    return v7();
                },
                get children () {
                    return x7();
                }
            })), F(ih, ()=>an().nodeUrl), db.$$click = ()=>_e(an().nodeUrl, "node"), F(db, I(de, {
                get when () {
                    return J() === "node";
                },
                get fallback () {
                    return v7();
                },
                get children () {
                    return x7();
                }
            })), F(to, I(kt, {}), oh), F(G9, _), F(tf, I(lg, {
                tone: "success",
                variant: "color",
                size: "sm",
                icon: "dot",
                class: "font-mono uppercase",
                children: "Active"
            }), null), F(fb, ()=>A() ? "1AM server pays fees for you" : "You pay dust fees locally"), F(hw, I(Tl, {
                get checked () {
                    return A();
                },
                "aria-label": "Toggle dust sponsorship",
                onChange: P
            }), null), F(oh, I(de, {
                get when () {
                    return Ze(()=>!!ya())() && !ar() || N();
                },
                get children () {
                    var tt = kut();
                    return F(tt, I($r, {
                        onClick: Ln,
                        get disabled () {
                            return C() || N();
                        },
                        get class () {
                            return `h-10 px-6 font-mono text-sm font-semibold uppercase tracking-wide transition-colors ${N() ? "bg-[var(--bg-success-solid)] text-primary-foreground cursor-default" : "bg-[var(--bg-brand-solid,#0064D6)] hover:opacity-90 text-white"}`;
                        },
                        get children () {
                            return [
                                I(de, {
                                    get when () {
                                        return N();
                                    },
                                    get children () {
                                        return Fz();
                                    }
                                }),
                                I(de, {
                                    get when () {
                                        return Ze(()=>!N())() && C();
                                    },
                                    get children () {
                                        return Lz();
                                    }
                                }),
                                I(de, {
                                    get when () {
                                        return Ze(()=>!N())() && !C();
                                    },
                                    children: "Apply Settings"
                                })
                            ];
                        }
                    })), tt;
                }
            }), null), F(to, I(de, {
                get when () {
                    return fg(v());
                },
                get fallback () {
                    return I(kt, {});
                },
                get children () {
                    return [
                        I(kt, {}),
                        (()=>{
                            var tt = Eut(), Nn = tt.firstChild, zr = Nn.firstChild, ct = zr.firstChild, Vn = ct.firstChild, zn = ct.nextSibling;
                            return F(zn, ()=>a() ? "Showing NIGHT balance from Cardano L1" : "Show NIGHT balance on Cardano L1"), F(Nn, I(Tl, {
                                get checked () {
                                    return a();
                                },
                                "aria-label": "Toggle Cardano NIGHT",
                                onChange: ()=>{
                                    Qc();
                                }
                            }), null), F(tt, I(de, {
                                get when () {
                                    return De();
                                },
                                get children () {
                                    var Ts = Cut(), hs = Ts.firstChild, rr = hs.firstChild, gs = rr.firstChild;
                                    gs.nextSibling;
                                    var Bi = rr.nextSibling, Ls = Bi.firstChild, Vu = Ls.nextSibling, sl = Bi.nextSibling;
                                    return Vu.$$input = (il)=>oe(il.currentTarget.value), F(hs, I(de, {
                                        get when () {
                                            return ye();
                                        },
                                        get children () {
                                            var il = Tut();
                                            return F(il, ye), il;
                                        }
                                    }), sl), F(sl, I($r, {
                                        variant: "outline",
                                        class: "flex-1",
                                        onClick: Hn,
                                        title: "Cancel",
                                        "aria-label": "Cancel",
                                        children: "CANCEL"
                                    }), null), F(sl, I($r, {
                                        variant: "submit",
                                        class: "flex-1",
                                        onClick: ()=>void jn(),
                                        get disabled () {
                                            return S();
                                        },
                                        title: "Enable Cardano NIGHT",
                                        "aria-label": "Enable Cardano NIGHT",
                                        get children () {
                                            return I(de, {
                                                get when () {
                                                    return !S();
                                                },
                                                get fallback () {
                                                    return [
                                                        Dut(),
                                                        "ENABLING..."
                                                    ];
                                                },
                                                children: "ENABLE CARDANO NIGHT"
                                            });
                                        }
                                    }), null), pt(()=>Vu.value = ee()), Ts;
                                }
                            }), null), pt(()=>Ot(Vn, "src", e().theme === "dark" ? cg : ab)), tt;
                        })(),
                        I(kt, {})
                    ];
                }
            }), pb), F(ch, I(Tl, {
                get checked () {
                    return g() === "dark";
                },
                "aria-label": "Toggle dark mode",
                onChange: async (tt)=>{
                    const Nn = tt ? "dark" : "light";
                    y(Nn), ate(Nn), await n({
                        ...e(),
                        theme: Nn
                    });
                }
            }), null), F(mw, ()=>X() ? "Opens as sidebar when icon clicked" : "Opens as popup when icon clicked"), F(hb, I(Tl, {
                get checked () {
                    return X();
                },
                "aria-label": "Toggle side panel",
                onChange: async (tt)=>{
                    G(tt), await n({
                        ...e(),
                        sidePanelEnabled: tt
                    }), chrome.runtime.sendMessage({
                        type: "SIDE_PANEL_SETTING_CHANGED"
                    });
                }
            }), null), F(_w, ()=>ce() ? "Shows copyable wallet addresses in the account menu" : "Hides wallet addresses from the account menu by default"), F(gb, I(Tl, {
                get checked () {
                    return ce();
                },
                "aria-label": "Toggle wallet addresses in dropdown",
                onChange: async (tt)=>{
                    ie(tt), await n({
                        ...e(),
                        showDropdownAddresses: tt
                    });
                }
            }), null), F(e5, ()=>Y() ? "Showing sync and network debug info at the bottom" : "Show sync progress, websocket, and network diagnostics"), F(xw, I(Tl, {
                get checked () {
                    return Y();
                },
                "aria-label": "Toggle debug mode",
                onChange: async (tt)=>{
                    M(tt), await n({
                        ...e(),
                        debugMode: tt
                    });
                }
            }), null), xe.$$click = ()=>{
                const tt = xi.runtime.getURL("/fullpage.html");
                xi.tabs.create({
                    url: tt
                }), window.close();
            }, F(to, I(kt, {}), Ee), F(We, I(_r, {
                get each () {
                    return [
                        ...Ute
                    ];
                },
                children: (tt)=>(()=>{
                        var Nn = But(), zr = Nn.firstChild;
                        return Nn.$$click = ()=>{
                            K(tt), n({
                                ...e(),
                                autoLockMinutes: tt
                            });
                        }, F(Nn, tt, zr), pt(()=>Vt(Nn, `flex-1 h-9 font-mono text-xs font-semibold uppercase transition-colors ${U() === tt ? "border-2 border-[var(--border-primary)] bg-[var(--bg-primary-hover)] text-foreground" : "border border-[var(--border-secondary)] bg-[var(--bg-primary)] text-content-muted hover:border-[var(--border-primary)] hover:text-foreground"}`)), Nn;
                    })()
            })), F(gt, I(de, {
                get when () {
                    return !Ce();
                },
                get fallback () {
                    return (()=>{
                        var tt = Lut(), Nn = tt.firstChild, zr = Nn.nextSibling;
                        return zr.nextSibling, F(tt, I(de, {
                            get when () {
                                return !Ge();
                            },
                            get fallback () {
                                return (()=>{
                                    var ct = zut(), Vn = ct.firstChild, zn = Vn.firstChild, Ts = zn.nextSibling, hs = Vn.nextSibling, rr = hs.firstChild, gs = hs.nextSibling, Bi = gs.firstChild, Ls = Bi.nextSibling, Vu = Ls.nextSibling, sl = Vu.nextSibling;
                                    sl.nextSibling;
                                    var il = gs.nextSibling;
                                    return F(Ts, m), F(rr, Ge), F(gs, w, Ls), F(gs, ()=>w() !== 1 ? "s" : "", sl), il.$$click = dt, ct;
                                })();
                            },
                            get children () {
                                return I(de, {
                                    get when () {
                                        return $() === "social-web3auth";
                                    },
                                    get fallback () {
                                        return (()=>{
                                            var ct = Uut(), Vn = ct.firstChild, zn = Vn.nextSibling, Ts = zn.firstChild, hs = Ts.nextSibling;
                                            return F(ct, I(og, {
                                                get value () {
                                                    return Ie();
                                                },
                                                onChange: Le,
                                                get children () {
                                                    return I(Vy, {
                                                        type: "password",
                                                        placeholder: "Password",
                                                        class: "h-10 border-[var(--border-primary)] bg-[var(--bg-primary)] font-mono text-sm text-foreground placeholder:text-content-muted-light focus-visible:ring-[var(--fg-primary)]",
                                                        autofocus: !0,
                                                        onKeyDown: (rr)=>{
                                                            rr.key === "Enter" && Ie().length > 0 && (le(!0), be(""), f(Ie()).then(at).catch(Qt));
                                                        }
                                                    });
                                                }
                                            }), zn), F(ct, I(de, {
                                                get when () {
                                                    return Ne();
                                                },
                                                get children () {
                                                    var rr = zz();
                                                    return F(rr, Ne), rr;
                                                }
                                            }), zn), Ts.$$click = dt, hs.$$click = ()=>{
                                                le(!0), be(""), f(Ie()).then(at).catch(Qt);
                                            }, F(hs, ()=>Qe() ? "Decrypting..." : "Reveal"), pt(()=>hs.disabled = Ie().length === 0 || Qe()), ct;
                                        })();
                                    },
                                    get children () {
                                        var ct = Fut(), Vn = ct.firstChild, zn = Vn.firstChild, Ts = zn.nextSibling;
                                        Ts.nextSibling;
                                        var hs = Vn.nextSibling, rr = hs.nextSibling, gs = rr.firstChild, Bi = gs.nextSibling;
                                        return F(Vn, (()=>{
                                            var Ls = Ze(()=>!!ae());
                                            return ()=>Ls() ? oT[ae()] : "your social provider";
                                        })(), Ts), F(ct, I(de, {
                                            get when () {
                                                return Ne();
                                            },
                                            get children () {
                                                var Ls = zz();
                                                return F(Ls, Ne), Ls;
                                            }
                                        }), rr), gs.$$click = dt, Bi.$$click = ()=>void Sn(), F(Bi, (()=>{
                                            var Ls = Ze(()=>!!Qe());
                                            return ()=>Ls() ? "Verifying..." : `Continue with ${ae() ? oT[ae()] : "Social"}`;
                                        })()), pt(()=>Bi.disabled = Qe()), ct;
                                    }
                                });
                            }
                        }), null), tt;
                    })();
                },
                get children () {
                    var tt = Iut(), Nn = tt.firstChild, zr = Nn.firstChild, ct = zr.nextSibling;
                    return ct.firstChild, tt.$$click = ()=>Ue(!0), F(ct, m, null), tt;
                }
            })), sn.$$click = ()=>r(), F(wa, ()=>$() === "social-web3auth" ? "Require social sign-in to reopen" : "Require password to reopen"), F(Et, I(de, {
                get when () {
                    return !x();
                },
                get fallback () {
                    return (()=>{
                        var tt = Hut(), Nn = tt.firstChild, zr = Nn.nextSibling, ct = zr.firstChild, Vn = ct.nextSibling;
                        return F(tt, I(og, {
                            get value () {
                                return z();
                            },
                            onChange: B,
                            get children () {
                                return I(Vy, {
                                    type: "text",
                                    placeholder: 'Type "DELETE"',
                                    class: "h-9 text-sm border-[var(--border-error-subtle)] text-[var(--text-error-primary)] placeholder:text-[var(--fg-error-secondary)] focus-visible:ring-[var(--fg-error-secondary)] font-mono",
                                    autofocus: !0
                                });
                            }
                        }), zr), ct.$$click = ()=>{
                            O(!1), B("");
                        }, Vn.$$click = el, pt(()=>Vn.disabled = z() !== "DELETE"), tt;
                    })();
                },
                get children () {
                    var tt = Aut();
                    return tt.$$click = ()=>O(!0), tt;
                }
            }), null), F(to, I(kt, {}), Fs), Di.$$click = ()=>Gn("health"), F(Wn, (()=>{
                var tt = Ze(()=>q().overall === "checking");
                return ()=>tt() ? "Checking..." : Ze(()=>q().overall === "healthy")() ? "All services operational" : q().overall === "degraded" ? "Some services degraded" : "Services unreachable";
            })()), F(Fs, I(de, {
                get when () {
                    return fe() === "health";
                },
                get children () {
                    var tt = Put(), Nn = tt.firstChild, zr = Nn.firstChild, ct = zr.nextSibling, Vn = Nn.nextSibling, zn = Vn.nextSibling, Ts = zn.firstChild, hs = Ts.nextSibling;
                    return F(zr, (()=>{
                        var rr = Ze(()=>q().lastChecked > 0);
                        return ()=>rr() ? `Last checked ${new Date(q().lastChecked).toLocaleTimeString()}` : "Not checked yet";
                    })()), ct.$$click = An, F(ct, ()=>Z() ? "Checking..." : "Refresh"), F(Vn, I(_r, {
                        get each () {
                            return q().services;
                        },
                        children: (rr)=>(()=>{
                                var gs = qut(), Bi = gs.firstChild, Ls = Bi.firstChild, Vu = Ls.nextSibling;
                                return F(Ls, ()=>rr.label), F(Vu, ()=>rr.url), F(gs, I(de, {
                                    get when () {
                                        return rr.status === "checking";
                                    },
                                    get fallback () {
                                        return I(lg, {
                                            get tone () {
                                                return rr.status === "up" ? "success" : "error";
                                            },
                                            variant: "color",
                                            size: "sm",
                                            icon: "dot",
                                            class: "ml-3 shrink-0 font-mono uppercase",
                                            get children () {
                                                return rr.status;
                                            }
                                        });
                                    },
                                    get children () {
                                        return jut();
                                    }
                                }), null), gs;
                            })()
                    })), F(hs, I(_r, {
                        get each () {
                            return cte(v());
                        },
                        children: (rr)=>(()=>{
                                var gs = Wut(), Bi = gs.firstChild;
                                return F(Bi, ()=>rr.label), pt(()=>Ot(gs, "href", rr.url)), gs;
                            })()
                    })), pt(()=>ct.disabled = Z()), tt;
                }
            }), null), F(to, I(kt, {}), Rn), F(fi, ()=>chrome.runtime.getManifest().version, ic), pt((tt)=>{
                var Nn = J() === "indexer" ? "Copied!" : "Copy", zr = J() === "ws" ? "Copied!" : "Copy", ct = J() === "node" ? "Copied!" : "Copy", Vn = `w-2 h-2 rounded-full ${q().overall === "healthy" ? "bg-[var(--fg-success-secondary)]" : q().overall === "degraded" ? "bg-[var(--fg-warning-secondary)]" : q().overall === "down" ? "bg-[var(--fg-error-secondary)]" : "bg-[var(--border-secondary)] animate-pulse"}`, zn = `mt-0.5 h-4 w-4 shrink-0 text-content-muted-light transition-transform ${fe() === "health" ? "rotate-180" : ""}`;
                return Nn !== tt.e && Ot(nh, "title", tt.e = Nn), zr !== tt.t && Ot(sh, "title", tt.t = zr), ct !== tt.a && Ot(db, "title", tt.a = ct), Vn !== tt.o && Vt(di, tt.o = Vn), zn !== tt.i && Ot(ks, "class", tt.i = zn), tt;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0
            }), je;
        })();
    };
    Pi([
        "click",
        "input"
    ]);
    var $ut = Q('<div class="p-2.5 rounded-sm bg-[var(--bg-error-primary)] border border-[var(--border-error-subtle)] text-xs text-[var(--text-error-primary)]">'), Xut = Q('<div class=space-y-3><div><label class="text-xs font-medium text-content-muted mb-1.5 block">Wallet Name</label><input type=text placeholder="My Wallet"class="w-full h-10 px-3 text-sm border border-border rounded-sm text-foreground placeholder:text-content-muted outline-none focus:border-foreground bg-card"></div><button class="w-full flex items-center gap-4 p-4 rounded-sm bg-card border border-border hover:border-foreground/30 transition-all"><div class="w-11 h-11 rounded-sm bg-brand-secondary flex items-center justify-center shrink-0"><svg class="w-5 h-5 text-fg-brand-primary"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 5v14M5 12h14"></path></svg></div><div class=text-left><div class="text-sm font-semibold text-foreground">Create New Wallet</div><div class="text-xs text-content-muted">Generate a new 24-word recovery phrase</div></div><svg class="w-4 h-4 text-content-muted ml-auto shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6"></path></svg></button><button class="w-full flex items-center gap-4 p-4 rounded-sm bg-card border border-border hover:border-foreground/30 transition-all"><div class="w-11 h-11 rounded-sm bg-success flex items-center justify-center shrink-0"><svg class="w-5 h-5 text-fg-success-primary"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"></path></svg></div><div class=text-left><div class="text-sm font-semibold text-foreground">Import Existing Wallet</div><div class="text-xs text-content-muted">Enter your 24-word recovery phrase</div></div><svg class="w-4 h-4 text-content-muted ml-auto shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M9 18l6-6-6-6">'), Gut = Q(`<div class=space-y-4><div class="flex items-start gap-2 p-3 rounded-sm bg-[var(--bg-warning-primary)] border border-[var(--warning-foreground)]/30"><svg class="w-4 h-4 text-[var(--fg-warning-secondary)] shrink-0 mt-0.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><div><p class="text-xs font-semibold text-[var(--text-warning-primary)]">Write these down</p><p class="text-xs text-[var(--text-warning-primary)] mt-0.5">This is the only way to recover this wallet. Store it securely offline.</p></div></div><div class="bg-card rounded-sm border border-border p-3"><div class="grid grid-cols-3 gap-1.5"></div></div><div class="flex gap-2"><button class="flex-1 h-11 text-sm font-semibold rounded-sm border border-border text-foreground hover:bg-muted transition-colors flex items-center justify-center gap-2"><svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=9 y=9 width=13 height=13 rx=2></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg><span id=copy-mnemonic-btn>Copy All</span></button><button class="flex-1 h-11 text-sm font-semibold rounded-sm bg-foreground text-primary-foreground hover:bg-foreground/90 transition-colors">I've Written It Down`), Zut = Q(`<p class="text-xs text-[var(--text-error-primary)]">Words don't match. Please check your recovery phrase.`), Jut = Q('<div class=space-y-4><div class="flex items-center justify-between"><p class="text-xs text-content-muted">Confirm your recovery phrase.</p><button class="text-xs font-semibold text-foreground hover:text-content-muted transition-colors flex items-center gap-1"><svg class="w-3 h-3"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=9 y=9 width=13 height=13 rx=2></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>Paste All</button></div><div class="bg-card rounded-sm border border-border p-3"><div class="grid grid-cols-3 gap-1.5"></div></div><button class="w-full h-11 text-sm font-semibold rounded-sm bg-foreground text-primary-foreground hover:bg-foreground/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed">'), Yut = Q('<p class="text-xs text-[var(--text-error-primary)]">Invalid recovery phrase. Please check your words.'), Qut = Q('<div class=space-y-4><p class="text-xs text-content-muted">Enter your 24-word recovery phrase. You can paste all 24 words at once.</p><div class="bg-card rounded-sm border border-border p-3"><div class="grid grid-cols-3 gap-1.5"></div></div><button class="w-full h-11 text-sm font-semibold rounded-sm bg-foreground text-primary-foreground hover:bg-foreground/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed">'), edt = Q('<div class="flex flex-col h-full w-full bg-background"><div class="flex-none flex items-center gap-3 px-4 py-3 bg-header border-b border-header-divider"><button class="flex items-center justify-center w-8 h-8 rounded-sm hover:bg-card/10 transition-colors"title=Back aria-label=Back><svg class="w-5 h-5 text-header-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M19 12H5M12 19l-7-7 7-7"></path></svg></button><h1 class="text-sm font-semibold text-header-foreground uppercase tracking-wider"></h1></div><div class="flex-1 overflow-y-auto w-full"><div>'), tdt = Q('<div class="flex items-center gap-1.5 px-2.5 py-2 bg-muted rounded-sm"><span class="text-[10px] text-content-muted w-4 text-right shrink-0"></span><span class="text-xs font-medium text-foreground">'), Uz = Q('<div class="flex items-center gap-1 bg-muted rounded-sm px-1.5"><span class="text-[10px] text-content-muted w-4 text-right shrink-0"></span><input type=text class="w-full bg-transparent py-2 text-xs text-foreground outline-none"autocomplete=off>');
    const ndt = (t)=>{
        const { addWallet: e } = lr(), [n, r] = pe("choose"), [s, i] = pe(""), [o, a] = pe(!1), [c, l] = pe(null);
        let u;
        It(()=>clearTimeout(u));
        const [d, f] = pe([]), [p, h] = pe(Array(24).fill("")), [m, w] = pe(Array(24).fill("")), v = Ct(()=>{
            const Y = m();
            if (!Y.every((g)=>g.trim().length > 0)) return !1;
            const M = gM(Y.map((g)=>g.trim().toLowerCase()));
            return bU(M, IT);
        }), k = Ct(()=>{
            const Y = d(), M = p();
            return Y.length === 0 ? !1 : Y.every((g, y)=>M[y]?.trim().toLowerCase() === g.toLowerCase());
        }), _ = ()=>{
            const Y = ose();
            f(Y), r("create-backup");
        }, A = async (Y)=>{
            a(!0), l(null);
            try {
                const M = zQ(Y);
                await e(M, s().trim() || void 0, Y), t.onBack();
            } catch (M) {
                l(M instanceof Error ? M.message : "Failed to add wallet"), a(!1);
            }
        }, P = ()=>A(d().join(" ")), U = ()=>A(gM(m().map((Y)=>Y.trim().toLowerCase()))), K = (Y, M)=>{
            h((g)=>{
                const y = [
                    ...g
                ];
                return y[Y] = M, y;
            });
        }, X = (Y, M)=>{
            w((g)=>{
                const y = [
                    ...g
                ];
                return y[Y] = M, y;
            });
        }, G = (Y)=>(M)=>{
                const g = M.clipboardData?.getData("text");
                if (!g) return;
                const y = g.trim().split(/\s+/);
                y.length === 24 && (M.preventDefault(), Y(y));
            }, ce = ()=>{
            switch(n()){
                case "choose":
                    return "Add Wallet";
                case "create-backup":
                    return "Back Up Recovery Phrase";
                case "create-confirm":
                    return "Confirm Recovery Phrase";
                case "import":
                    return "Import Wallet";
            }
        }, ie = ()=>{
            switch(n()){
                case "choose":
                    t.onBack();
                    break;
                case "create-backup":
                    r("choose");
                    break;
                case "create-confirm":
                    r("create-backup");
                    break;
                case "import":
                    r("choose");
                    break;
            }
        };
        return (()=>{
            var Y = edt(), M = Y.firstChild, g = M.firstChild, y = g.nextSibling, C = M.nextSibling, R = C.firstChild;
            return g.$$click = ie, F(y, ce), F(R, I(de, {
                get when () {
                    return c();
                },
                get children () {
                    var N = $ut();
                    return F(N, c), N;
                }
            }), null), F(R, I(de, {
                get when () {
                    return n() === "choose";
                },
                get children () {
                    var N = Xut(), L = N.firstChild, z = L.firstChild, B = z.nextSibling, x = L.nextSibling, O = x.nextSibling;
                    return B.$$input = (q)=>i(q.currentTarget.value), x.$$click = _, O.$$click = ()=>r("import"), pt(()=>B.value = s()), N;
                }
            }), null), F(R, I(de, {
                get when () {
                    return n() === "create-backup";
                },
                get children () {
                    var N = Gut(), L = N.firstChild, z = L.nextSibling, B = z.firstChild, x = z.nextSibling, O = x.firstChild, q = O.nextSibling;
                    return F(B, I(_r, {
                        get each () {
                            return d();
                        },
                        children: (H, Z)=>(()=>{
                                var te = tdt(), J = te.firstChild, se = J.nextSibling;
                                return F(J, ()=>Z() + 1), F(se, H), te;
                            })()
                    })), O.$$click = async ()=>{
                        try {
                            await navigator.clipboard.writeText(d().join(" "));
                            const H = document.getElementById("copy-mnemonic-btn");
                            H && (H.textContent = "Copied!", setTimeout(()=>H.textContent = "Copy All", 2e3)), clearTimeout(u), u = setTimeout(()=>{
                                navigator.clipboard.writeText("").catch(()=>{});
                            }, 6e4);
                        } catch  {}
                    }, q.$$click = ()=>r("create-confirm"), N;
                }
            }), null), F(R, I(de, {
                get when () {
                    return n() === "create-confirm";
                },
                get children () {
                    var N = Jut(), L = N.firstChild, z = L.firstChild, B = z.nextSibling, x = L.nextSibling, O = x.firstChild, q = x.nextSibling;
                    return B.$$click = async ()=>{
                        const Z = (await navigator.clipboard.readText()).trim().split(/\s+/);
                        Z.length === 24 && h(Z);
                    }, F(O, I(_r, {
                        get each () {
                            return p();
                        },
                        children: (H, Z)=>(()=>{
                                var te = Uz(), J = te.firstChild, se = J.nextSibling;
                                return F(J, ()=>Z() + 1), r2(se, "paste", G(h)), se.$$input = (fe)=>K(Z(), fe.currentTarget.value), se.value = H, Ot(se, "spellcheck", !1), te;
                            })()
                    })), F(N, I(de, {
                        get when () {
                            return Ze(()=>!!p().every((H)=>H.trim()))() && !k();
                        },
                        get children () {
                            return Zut();
                        }
                    }), q), q.$$click = P, F(q, ()=>o() ? "Adding Wallet..." : "Confirm & Add Wallet"), pt(()=>q.disabled = o() || !k()), N;
                }
            }), null), F(R, I(de, {
                get when () {
                    return n() === "import";
                },
                get children () {
                    var N = Qut(), L = N.firstChild, z = L.nextSibling, B = z.firstChild, x = z.nextSibling;
                    return F(B, I(_r, {
                        get each () {
                            return m();
                        },
                        children: (O, q)=>(()=>{
                                var H = Uz(), Z = H.firstChild, te = Z.nextSibling;
                                return F(Z, ()=>q() + 1), r2(te, "paste", G(w)), te.$$input = (J)=>X(q(), J.currentTarget.value), te.value = O, Ot(te, "spellcheck", !1), H;
                            })()
                    })), F(N, I(de, {
                        get when () {
                            return Ze(()=>!!m().every((O)=>O.trim()))() && !v();
                        },
                        get children () {
                            return Yut();
                        }
                    }), x), x.$$click = U, F(x, ()=>o() ? "Adding Wallet..." : "Import Wallet"), pt(()=>x.disabled = o() || !v()), N;
                }
            }), null), pt(()=>Vt(R, `w-full max-w-md mx-auto p-4 md:p-6 lg:p-8 space-y-4 ${n() === "choose" ? "min-h-full flex flex-col justify-center" : ""}`)), Y;
        })();
    };
    Pi([
        "click",
        "input"
    ]);
    var rdt = Q('<div class="flex h-full w-full flex-col bg-background"><div class="flex-none flex items-center gap-3 px-4 py-3 bg-header border-b border-header-divider"><button class="flex items-center justify-center w-8 h-8 rounded-sm hover:bg-card/10 transition-colors"title=Back aria-label="Back to dashboard"><svg class="w-5 h-5 text-header-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M19 12H5M12 19l-7-7 7-7"></path></svg></button><h1 class="text-sm font-semibold text-header-foreground uppercase tracking-wider">Wallets</h1></div><div class="flex-1 overflow-y-auto"><div class="w-full max-w-md mx-auto p-4 md:p-6 space-y-3"><button class="w-full flex items-center justify-center gap-2 p-4 rounded-sm border-2 border-dashed border-border text-content-muted-light hover:border-foreground/30 hover:text-foreground transition-all"><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 5v14M5 12h14"></path></svg><span class="text-sm font-medium">Add Wallet</span></button><div class=h-4>'), sdt = Q('<div class="mx-auto flex h-full w-full max-w-[1280px] border-x border-border bg-background">'), idt = Q('<div class="flex-1 min-w-0"><div class="text-sm font-medium text-foreground truncate"></div><div class="text-xs text-content-muted-light"> account'), odt = Q('<button class="h-7 px-2.5 text-xs font-medium rounded-sm bg-white text-black hover:bg-white/80 transition-colors">Switch'), adt = Q('<button class="p-1.5 rounded-sm hover:bg-[var(--bg-error-primary)] transition-colors"title="Delete wallet"><svg class="w-3.5 h-3.5 text-[var(--fg-error-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">'), cdt = Q('<button class="w-full flex items-center gap-2 px-4 py-2.5 pl-10 text-content-muted-light hover:text-foreground hover:bg-muted transition-colors border-t border-border"><svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 5v14M5 12h14"></path></svg><span class="text-xs font-medium">Add Account'), ldt = Q('<div class="border-t border-border"><button class="w-full flex items-center gap-2 px-4 py-2 pl-10 text-icon-muted hover:text-content-muted hover:bg-muted transition-colors"><svg class="w-3 h-3"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1=1 y1=1 x2=23 y2=23></line></svg><span class="text-[10px] font-medium"></span><svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M6 9l6 6 6-6">'), udt = Q('<div><div class="flex items-center gap-3 px-4 py-3"><div><span class="text-sm font-bold"></span></div><div class="flex items-center gap-1 shrink-0"><button class="p-1.5 rounded-sm hover:bg-muted transition-colors"title="Rename wallet"><svg class="w-3.5 h-3.5 text-icon-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg></button></div></div><div class="border-t border-border">'), ddt = Q('<input type=text class="flex-1 h-8 px-2 text-sm border border-border rounded-sm text-foreground outline-none focus:border-foreground"autofocus>'), fdt = Q('<div class="flex items-center gap-1"><button class="h-6 px-2 text-[10px] font-medium rounded border border-border text-content-muted hover:bg-muted">No</button><button class="h-6 px-2 text-[10px] font-medium rounded bg-[var(--bg-error-solid)] text-primary-foreground hover:opacity-90">Yes'), pdt = Q('<span class="text-[10px] text-text-brand-tertiary ml-1.5">Active'), hdt = Q('<div class="flex-1 min-w-0"><div class="flex items-center"><span class="text-xs font-medium text-foreground">'), gdt = Q('<button class="h-6 px-2 text-[10px] font-medium rounded bg-white text-black hover:bg-white/80 transition-colors">Use'), bdt = Q('<button class="p-1 rounded hover:bg-muted transition-colors"title="Hide account"><svg class="w-3 h-3 text-icon-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1=1 y1=1 x2=23 y2=23>'), mdt = Q('<div><div></div><div class="flex items-center gap-1 shrink-0"><button class="p-1 rounded hover:bg-muted transition-colors"title=Rename><svg class="w-3 h-3 text-icon-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z">'), ydt = Q('<input type=text class="flex-1 h-7 px-2 text-xs border border-border rounded text-foreground outline-none focus:border-foreground"autofocus>'), wdt = Q('<div class="flex items-center gap-1"><svg class="w-2.5 h-2.5 text-content-muted-light shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx=12 cy=12 r=3></circle></svg><span class="text-[10px] font-mono text-content-muted-light truncate">'), _dt = Q('<div class="flex items-center gap-1"><svg class="w-2.5 h-2.5 text-content-muted-light shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg><span class="text-[10px] font-mono text-content-muted-light truncate">'), xdt = Q('<div class="flex items-center gap-3 px-4 py-2.5 pl-10 border-t border-border opacity-50"><div class="w-6 h-6 rounded-sm flex items-center justify-center shrink-0 text-[10px] font-bold bg-muted text-content-muted-light"></div><span class="text-xs font-medium text-foreground flex-1"></span><button class="h-6 px-2 text-[10px] font-medium rounded border border-border text-content-muted hover:bg-muted transition-colors">Unhide');
    const vdt = (t)=>{
        const { wallets: e, activeWalletId: n, activeAccountIndex: r, switchWallet: s, addAccount: i, renameWallet: o, removeWallet: a, switchAccount: c, renameAccount: l, hideAccount: u, unhideAccount: d, unshieldedAddress: f, shieldedAddress: p } = lr(), [h, m] = pe(!1), [w, v] = pe(!1), [k, _] = pe(null), [A, P] = pe(null), [U, K] = pe(""), [X, G] = pe(null), ce = (y, C)=>{
            _(y), K(C);
        }, ie = ()=>{
            const y = k();
            y !== null && U().trim() && o(y, U().trim()), _(null);
        }, Y = (y, C, R)=>{
            P(`${y}:${C}`), K(R);
        }, M = ()=>{
            const y = A();
            if (y && U().trim()) {
                const [, C] = y.split(":");
                l(parseInt(C), U().trim());
            }
            P(null);
        }, g = (y, C)=>{
            y.key === "Enter" && C(), y.key === "Escape" && (_(null), P(null));
        };
        return (()=>{
            var y = sdt();
            return F(y, I(de, {
                get when () {
                    return !w();
                },
                get fallback () {
                    return I(ndt, {
                        onBack: ()=>v(!1)
                    });
                },
                get children () {
                    var C = rdt(), R = C.firstChild, N = R.firstChild, L = R.nextSibling, z = L.firstChild, B = z.firstChild;
                    return r2(N, "click", t.onBack, !0), F(z, I(_r, {
                        get each () {
                            return e();
                        },
                        children: (x)=>{
                            const O = ()=>x.id === n();
                            return (()=>{
                                var q = udt(), H = q.firstChild, Z = H.firstChild, te = Z.firstChild, J = Z.nextSibling, se = J.firstChild, fe = H.nextSibling;
                                return F(te, ()=>x.name[0]), F(H, I(de, {
                                    get when () {
                                        return k() !== x.id;
                                    },
                                    get fallback () {
                                        return (()=>{
                                            var ge = ddt();
                                            return ge.addEventListener("blur", ie), ge.addEventListener("keypress", (Ce)=>g(Ce, ie)), ge.$$input = (Ce)=>K(Ce.currentTarget.value), pt(()=>ge.value = U()), ge;
                                        })();
                                    },
                                    get children () {
                                        var ge = idt(), Ce = ge.firstChild, Ue = Ce.nextSibling, Ie = Ue.firstChild;
                                        return F(Ce, ()=>x.name), F(Ue, ()=>x.accounts.length, Ie), F(Ue, ()=>x.accounts.length !== 1 ? "s" : "", null), F(Ue, ()=>O() ? " · Active" : "", null), ge;
                                    }
                                }), J), F(J, I(de, {
                                    get when () {
                                        return !O();
                                    },
                                    get children () {
                                        var ge = odt();
                                        return ge.$$click = ()=>s(x.id), ge;
                                    }
                                }), se), se.$$click = ()=>ce(x.id, x.name), F(J, I(de, {
                                    get when () {
                                        return x.id !== 0;
                                    },
                                    get children () {
                                        return I(de, {
                                            get when () {
                                                return X() !== x.id;
                                            },
                                            get fallback () {
                                                return (()=>{
                                                    var ge = fdt(), Ce = ge.firstChild, Ue = Ce.nextSibling;
                                                    return Ce.$$click = ()=>G(null), Ue.$$click = async ()=>{
                                                        await a(x.id), G(null);
                                                    }, ge;
                                                })();
                                            },
                                            get children () {
                                                var ge = adt();
                                                return ge.$$click = ()=>G(x.id), ge;
                                            }
                                        });
                                    }
                                }), null), F(fe, I(_r, {
                                    get each () {
                                        return x.accounts.filter((ge)=>!ge.hidden);
                                    },
                                    children: (ge)=>{
                                        const Ce = ()=>O() && ge.index === r(), Ue = ()=>`${x.id}:${ge.index}`;
                                        return (()=>{
                                            var Ie = mdt(), Le = Ie.firstChild, Ge = Le.nextSibling, Ve = Ge.firstChild;
                                            return F(Le, ()=>ge.index + 1), F(Ie, I(de, {
                                                get when () {
                                                    return A() !== Ue();
                                                },
                                                get fallback () {
                                                    return (()=>{
                                                        var Ne = ydt();
                                                        return Ne.addEventListener("blur", M), Ne.addEventListener("keypress", (be)=>g(be, M)), Ne.$$input = (be)=>K(be.currentTarget.value), pt(()=>Ne.value = U()), Ne;
                                                    })();
                                                },
                                                get children () {
                                                    var Ne = hdt(), be = Ne.firstChild, Qe = be.firstChild;
                                                    return F(Qe, ()=>ge.name), F(be, I(de, {
                                                        get when () {
                                                            return Ce();
                                                        },
                                                        get children () {
                                                            return pdt();
                                                        }
                                                    }), null), F(Ne, ()=>{
                                                        const le = Ce() ? f() : ge.cachedUnshieldedAddress, De = Ce() ? p() : ge.cachedShieldedAddress;
                                                        return [
                                                            I(de, {
                                                                when: le,
                                                                get children () {
                                                                    var Re = wdt(), ee = Re.firstChild, oe = ee.nextSibling;
                                                                    return Ot(Re, "title", le), F(oe, le), Re;
                                                                }
                                                            }),
                                                            I(de, {
                                                                when: De,
                                                                get children () {
                                                                    var Re = _dt(), ee = Re.firstChild, oe = ee.nextSibling;
                                                                    return Ot(Re, "title", De), F(oe, De), Re;
                                                                }
                                                            })
                                                        ];
                                                    }, null), Ne;
                                                }
                                            }), Ge), F(Ge, I(de, {
                                                get when () {
                                                    return Ze(()=>!!O())() && !Ce();
                                                },
                                                get children () {
                                                    var Ne = gdt();
                                                    return Ne.$$click = ()=>c(ge.index), Ne;
                                                }
                                            }), Ve), Ve.$$click = ()=>Y(x.id, ge.index, ge.name), F(Ge, I(de, {
                                                get when () {
                                                    return ge.index !== 0;
                                                },
                                                get children () {
                                                    var Ne = bdt();
                                                    return Ne.$$click = ()=>u(ge.index), Ne;
                                                }
                                            }), null), pt((Ne)=>{
                                                var be = `flex items-center gap-3 px-4 py-2.5 pl-10 border-b border-border last:border-b-0 ${Ce() ? "bg-brand-secondary" : ""}`, Qe = `w-6 h-6 rounded-sm flex items-center justify-center shrink-0 text-[10px] font-bold ${Ce() ? "bg-foreground text-background" : "bg-muted text-content-muted-light"}`;
                                                return be !== Ne.e && Vt(Ie, Ne.e = be), Qe !== Ne.t && Vt(Le, Ne.t = Qe), Ne;
                                            }, {
                                                e: void 0,
                                                t: void 0
                                            }), Ie;
                                        })();
                                    }
                                }), null), F(fe, I(de, {
                                    get when () {
                                        return O();
                                    },
                                    get children () {
                                        var ge = cdt();
                                        return ge.$$click = ()=>i(), ge;
                                    }
                                }), null), F(fe, I(de, {
                                    get when () {
                                        return x.accounts.some((ge)=>ge.hidden);
                                    },
                                    get children () {
                                        var ge = ldt(), Ce = ge.firstChild, Ue = Ce.firstChild, Ie = Ue.nextSibling, Le = Ie.nextSibling;
                                        return Ce.$$click = ()=>m(!h()), F(Ie, (()=>{
                                            var Ge = Ze(()=>!!h());
                                            return ()=>Ge() ? "Hide" : `${x.accounts.filter((Ve)=>Ve.hidden).length} hidden account${x.accounts.filter((Ve)=>Ve.hidden).length !== 1 ? "s" : ""}`;
                                        })()), F(ge, I(de, {
                                            get when () {
                                                return h();
                                            },
                                            get children () {
                                                return I(_r, {
                                                    get each () {
                                                        return x.accounts.filter((Ge)=>Ge.hidden);
                                                    },
                                                    children: (Ge)=>(()=>{
                                                            var Ve = xdt(), Ne = Ve.firstChild, be = Ne.nextSibling, Qe = be.nextSibling;
                                                            return F(Ne, ()=>Ge.index + 1), F(be, ()=>Ge.name), Qe.$$click = ()=>d(Ge.index), Ve;
                                                        })()
                                                });
                                            }
                                        }), null), pt(()=>Ot(Le, "class", `w-3 h-3 ml-auto transition-transform ${h() ? "rotate-180" : ""}`)), ge;
                                    }
                                }), null), pt((ge)=>{
                                    var Ce = `bg-card rounded-sm border overflow-hidden ${O() ? "border-foreground" : "border-border"}`, Ue = `w-9 h-9 rounded-sm flex items-center justify-center shrink-0 ${O() ? "bg-white text-black dark:bg-white dark:text-black" : "bg-background text-content-muted"}`;
                                    return Ce !== ge.e && Vt(q, ge.e = Ce), Ue !== ge.t && Vt(Z, ge.t = Ue), ge;
                                }, {
                                    e: void 0,
                                    t: void 0
                                }), q;
                            })();
                        }
                    }), B), B.$$click = ()=>v(!0), C;
                }
            })), y;
        })();
    };
    Pi([
        "click",
        "input"
    ]);
    const Sdt = "/assets/cardano-ada-logo-Di0wVzkC.svg";
    var kdt = Q('<img alt=Cardano class="w-full h-full">'), Tdt = Q('<div class="w-[30px] h-[30px] rounded-full bg-[#0033AD] flex items-center justify-center shrink-0"><img alt=ADA class="w-[18px] h-[18px]"style="filter:brightness(0) invert(1)">'), Cdt = Q('<tr class="border-b border-[var(--border-secondary)] last:border-0 hover:bg-muted/30 transition-colors"><td class="py-4 px-8 align-middle"><div class="flex items-center gap-3"><span class="text-sm font-medium text-foreground font-mono uppercase"></span></div></td><td class="py-4 px-8 align-middle"><div class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded border border-[var(--border-secondary)] bg-card"><i class="icon-box w-[14px] h-[14px] text-icon-muted"></i><span class="text-xs font-medium text-content-muted uppercase"></span></div></td><td class="py-4 px-8 align-middle text-right"><span class="text-sm font-medium text-foreground font-mono">'), Edt = Q('<i class="icon-box w-[30px] h-[30px] text-icon-muted shrink-0">'), Idt = Q('<div class="flex flex-col w-full"><div class="flex flex-col w-full"><table class="w-full border-collapse"><thead><tr class="border-b border-[var(--border-secondary)]"><th class="py-3 px-8 text-left text-xs font-medium text-content-muted font-mono">ASSET</th><th class="py-3 px-8 text-left text-xs font-medium text-content-muted font-mono">WALLET</th><th class="py-3 px-8 text-right text-xs font-medium text-content-muted font-mono">BALANCE</th></tr></thead><tbody>'), Adt = Q('<tr><td colspan=3><div class="flex flex-col items-center justify-center py-8 md:py-12 lg:py-20 text-content-muted"><i class="icon-box w-8 h-8 md:w-10 md:h-10 mb-2 md:mb-3 lg:mb-4 text-content-muted"></i><p class="text-xs md:text-sm lg:text-base uppercase">No assets yet</p><p class="text-[10px] md:text-xs lg:text-sm mt-1 uppercase text-content-muted-dark">Receive tokens to see them here');
    const Pdt = "0000000000000000000000000000000000000000000000000000000000000000";
    function Odt(t) {
        return t === "" ? "DUST" : t === Pdt ? "NIGHT" : t.length > 20 ? `${t.slice(0, 8)}...${t.slice(-8)}` : t;
    }
    const Mdt = ()=>{
        const { environmentSettings: t } = lr(), e = ()=>t().theme === "dark" ? cg : ab;
        return (()=>{
            var n = kdt();
            return pt(()=>Ot(n, "src", e())), n;
        })();
    }, Rdt = (t)=>{
        const { formatBalance: e } = lr(), n = ()=>t.asset.walletType === "shielded", r = ()=>t.asset.walletType === "cardano", s = ()=>r() ? I(Mdt, {}) : n() ? I(Ep, {}) : I(Ip, {}), i = ()=>r() ? e(t.asset.balance, 4) : e(t.asset.balance, 4, t.asset.token);
        return (()=>{
            var o = Cdt(), a = o.firstChild, c = a.firstChild, l = c.firstChild, u = a.nextSibling, d = u.firstChild, f = d.firstChild, p = f.nextSibling, h = u.nextSibling, m = h.firstChild;
            return F(c, I(de, {
                get when () {
                    return t.asset.token === "ADA";
                },
                get fallback () {
                    return (()=>{
                        var w = Edt();
                        return F(w, I(ew, {})), w;
                    })();
                },
                get children () {
                    var w = Tdt(), v = w.firstChild;
                    return Ot(v, "src", Sdt), w;
                }
            }), l), F(l, ()=>Odt(t.asset.token)), F(f, s), F(p, ()=>t.asset.walletType), F(m, i), pt(()=>Ot(l, "title", t.asset.token)), o;
        })();
    }, Ndt = ()=>{
        const { shieldedBalances: t, unshieldedBalances: e, cardanoBalance: n, cardanoEnabled: r, environmentSettings: s } = lr(), i = Ct(()=>{
            const o = [];
            for (const [a, c] of Object.entries(t()))o.push({
                token: a,
                balance: c,
                walletType: "shielded"
            });
            for (const [a, c] of e().entries())o.push({
                token: a,
                balance: c,
                walletType: "unshielded"
            });
            if (fg(s().environment) && r()) {
                const a = n();
                a && (a.night > 0n && o.push({
                    token: "NIGHT",
                    balance: a.night,
                    walletType: "cardano"
                }), a.lovelace > 0n && o.push({
                    token: "ADA",
                    balance: a.lovelace,
                    walletType: "cardano"
                }));
            }
            return o.sort((a, c)=>Number(c.balance - a.balance)), o;
        });
        return (()=>{
            var o = Idt(), a = o.firstChild, c = a.firstChild, l = c.firstChild, u = l.nextSibling;
            return F(u, I(de, {
                get when () {
                    return i().length > 0;
                },
                get fallback () {
                    return (()=>{
                        var d = Adt(), f = d.firstChild, p = f.firstChild, h = p.firstChild;
                        return F(h, I(ew, {})), d;
                    })();
                },
                get children () {
                    return I(_r, {
                        get each () {
                            return i();
                        },
                        children: (d)=>I(Rdt, {
                                asset: d
                            })
                    });
                }
            })), o;
        })();
    };
    var Vdt = {};
    bu(Vdt, {
        CloseButton: ()=>tw,
        Content: ()=>uO,
        Description: ()=>dO,
        Dialog: ()=>Ddt,
        Overlay: ()=>fO,
        Portal: ()=>pO,
        Root: ()=>hO,
        Title: ()=>gO,
        Trigger: ()=>bO,
        useDialogContext: ()=>Jd
    });
    var ute = ds();
    function Jd() {
        const t = fs(ute);
        if (t === void 0) throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");
        return t;
    }
    function tw(t) {
        const e = Jd(), [n, r] = rt(t, [
            "aria-label",
            "onClick"
        ]);
        return I(jc, qe({
            get "aria-label" () {
                return n["aria-label"] || e.translations().dismiss;
            },
            onClick: (i)=>{
                $n(i, n.onClick), e.close();
            }
        }, r));
    }
    function uO(t) {
        let e;
        const n = Jd(), r = qt({
            id: n.generateId("content")
        }, t), [s, i] = rt(r, [
            "ref",
            "onOpenAutoFocus",
            "onCloseAutoFocus",
            "onPointerDownOutside",
            "onFocusOutside",
            "onInteractOutside"
        ]);
        let o = !1, a = !1;
        const c = (f)=>{
            s.onPointerDownOutside?.(f), n.modal() && f.detail.isContextMenu && f.preventDefault();
        }, l = (f)=>{
            s.onFocusOutside?.(f), n.modal() && f.preventDefault();
        }, u = (f)=>{
            s.onInteractOutside?.(f), !n.modal() && (f.defaultPrevented || (o = !0, f.detail.originalEvent.type === "pointerdown" && (a = !0)), bo(n.triggerRef(), f.target) && f.preventDefault(), f.detail.originalEvent.type === "focusin" && a && f.preventDefault());
        }, d = (f)=>{
            s.onCloseAutoFocus?.(f), n.modal() ? (f.preventDefault(), jr(n.triggerRef())) : (f.defaultPrevented || (o || jr(n.triggerRef()), f.preventDefault()), o = !1, a = !1);
        };
        return JP({
            isDisabled: ()=>!(n.isOpen() && n.modal()),
            targets: ()=>e ? [
                    e
                ] : []
        }), QP({
            element: ()=>e ?? null,
            enabled: ()=>n.contentPresent() && n.preventScroll()
        }), ZP({
            trapFocus: ()=>n.isOpen() && n.modal(),
            onMountAutoFocus: s.onOpenAutoFocus,
            onUnmountAutoFocus: d
        }, ()=>e), lt(()=>It(n.registerContentId(i.id))), I(de, {
            get when () {
                return n.contentPresent();
            },
            get children () {
                return I(YP, qe({
                    ref (f) {
                        var p = yr((h)=>{
                            n.setContentRef(h), e = h;
                        }, s.ref);
                        typeof p == "function" && p(f);
                    },
                    role: "dialog",
                    tabIndex: -1,
                    get disableOutsidePointerEvents () {
                        return Ze(()=>!!n.modal())() && n.isOpen();
                    },
                    get excludedElements () {
                        return [
                            n.triggerRef
                        ];
                    },
                    get "aria-labelledby" () {
                        return n.titleId();
                    },
                    get "aria-describedby" () {
                        return n.descriptionId();
                    },
                    get "data-expanded" () {
                        return n.isOpen() ? "" : void 0;
                    },
                    get "data-closed" () {
                        return n.isOpen() ? void 0 : "";
                    },
                    onPointerDownOutside: c,
                    onFocusOutside: l,
                    onInteractOutside: u,
                    get onDismiss () {
                        return n.close;
                    }
                }, i));
            }
        });
    }
    function dO(t) {
        const e = Jd(), n = qt({
            id: e.generateId("description")
        }, t), [r, s] = rt(n, [
            "id"
        ]);
        return lt(()=>It(e.registerDescriptionId(r.id))), I(yn, qe({
            as: "p",
            get id () {
                return r.id;
            }
        }, s));
    }
    function fO(t) {
        const e = Jd(), [n, r] = rt(t, [
            "ref",
            "style",
            "onPointerDown"
        ]), s = (i)=>{
            $n(i, n.onPointerDown), i.target === i.currentTarget && i.preventDefault();
        };
        return I(de, {
            get when () {
                return e.overlayPresent();
            },
            get children () {
                return I(yn, qe({
                    as: "div",
                    ref (i) {
                        var o = yr(e.setOverlayRef, n.ref);
                        typeof o == "function" && o(i);
                    },
                    get style () {
                        return hg({
                            "pointer-events": "auto"
                        }, n.style);
                    },
                    get "data-expanded" () {
                        return e.isOpen() ? "" : void 0;
                    },
                    get "data-closed" () {
                        return e.isOpen() ? void 0 : "";
                    },
                    onPointerDown: s
                }, r));
            }
        });
    }
    function pO(t) {
        const e = Jd();
        return I(de, {
            get when () {
                return e.contentPresent() || e.overlayPresent();
            },
            get children () {
                return I(kT, t);
            }
        });
    }
    var Hz = {
        dismiss: "Dismiss"
    };
    function hO(t) {
        const e = `dialog-${ii()}`, n = qt({
            id: e,
            modal: !0,
            translations: Hz
        }, t), [r, s] = pe(), [i, o] = pe(), [a, c] = pe(), [l, u] = pe(), [d, f] = pe(), [p, h] = pe(), m = P9({
            open: ()=>n.open,
            defaultOpen: ()=>n.defaultOpen,
            onOpenChange: (A)=>n.onOpenChange?.(A)
        }), w = ()=>n.forceMount || m.isOpen(), { present: v } = Ny({
            show: w,
            element: ()=>l() ?? null
        }), { present: k } = Ny({
            show: w,
            element: ()=>d() ?? null
        }), _ = {
            translations: ()=>n.translations ?? Hz,
            isOpen: m.isOpen,
            modal: ()=>n.modal ?? !0,
            preventScroll: ()=>n.preventScroll ?? _.modal(),
            contentId: r,
            titleId: i,
            descriptionId: a,
            triggerRef: p,
            overlayRef: l,
            setOverlayRef: u,
            contentRef: d,
            setContentRef: f,
            overlayPresent: v,
            contentPresent: k,
            close: m.close,
            toggle: m.toggle,
            setTriggerRef: h,
            generateId: gu(()=>n.id),
            registerContentId: $s(s),
            registerTitleId: $s(o),
            registerDescriptionId: $s(c)
        };
        return I(ute.Provider, {
            value: _,
            get children () {
                return n.children;
            }
        });
    }
    function gO(t) {
        const e = Jd(), n = qt({
            id: e.generateId("title")
        }, t), [r, s] = rt(n, [
            "id"
        ]);
        return lt(()=>It(e.registerTitleId(r.id))), I(yn, qe({
            as: "h2",
            get id () {
                return r.id;
            }
        }, s));
    }
    function bO(t) {
        const e = Jd(), [n, r] = rt(t, [
            "ref",
            "onClick"
        ]);
        return I(jc, qe({
            ref (i) {
                var o = yr(e.setTriggerRef, n.ref);
                typeof o == "function" && o(i);
            },
            "aria-haspopup": "dialog",
            get "aria-expanded" () {
                return e.isOpen();
            },
            get "aria-controls" () {
                return Ze(()=>!!e.isOpen())() ? e.contentId() : void 0;
            },
            get "data-expanded" () {
                return e.isOpen() ? "" : void 0;
            },
            get "data-closed" () {
                return e.isOpen() ? void 0 : "";
            },
            onClick: (i)=>{
                $n(i, n.onClick), e.toggle();
            }
        }, r));
    }
    var Ddt = Object.assign(hO, {
        CloseButton: tw,
        Content: uO,
        Description: dO,
        Overlay: fO,
        Portal: pO,
        Title: gO,
        Trigger: bO
    }), dte = Q("<div>"), Bdt = Q('<i class="icon-box w-6 h-6">'), Fdt = Q('<div><h2 class="type-display-xs font-semibold text-header-foreground"></h2><div>');
    let nw, R9, Ldt, zdt, rw, Udt, Hdt, jdt, fte, Wdt, Kdt, $dt;
    nw = (t)=>I(hO, qe(t, {
            onOpenChange: (n)=>{
                n && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t.onOpenChange?.(n);
            }
        }));
    R9 = bO;
    Ldt = (t)=>{
        const [, e] = rt(t, [
            "children",
            "fullScreen"
        ]);
        return I(pO, qe(e, {
            get children () {
                var n = dte();
                return F(n, ()=>t.children), pt(()=>Vt(n, t.fullScreen ? "fixed inset-0 z-50 font-sans flex items-stretch justify-stretch p-0" : "fixed inset-0 z-50 font-sans flex items-center justify-center p-2")), n;
            }
        }));
    };
    zdt = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return I(fO, qe({
            get class () {
                return xn("fixed inset-0 z-50 bg-black/56 backdrop-blur-[4px] data-[expanded]:animate-dialog-overlay-in data-[closed]:animate-dialog-overlay-out", t.class);
            }
        }, e));
    };
    rw = (t)=>{
        const [, e] = rt(t, [
            "class",
            "children",
            "fullScreen"
        ]), n = ()=>t.fullScreen === !0;
        return I(Ldt, {
            get fullScreen () {
                return n();
            },
            get children () {
                return [
                    I(zdt, {}),
                    I(uO, qe({
                        get class () {
                            return xn("relative z-50 font-sans flex flex-col overflow-hidden bg-transparent data-[expanded]:animate-dialog-slide-in data-[closed]:animate-dialog-slide-out", n() ? "w-full min-h-full flex-1 max-w-full max-h-full rounded-none border-0 p-0" : "max-h-screen w-full max-w-lg border border-header-divider sm:rounded-lg", t.class);
                        }
                    }, e, {
                        get children () {
                            return t.children;
                        }
                    }))
                ];
            }
        });
    };
    Udt = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return (()=>{
            var n = dte();
            return Kx(n, qe({
                get class () {
                    return xn("flex flex-col space-y-1.5 text-center sm:text-left", t.class);
                }
            }, e), !1, !1), n;
        })();
    };
    Hdt = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return I(gO, qe({
            get class () {
                return xn("type-text-lg font-semibold tracking-tight", t.class);
            }
        }, e));
    };
    jdt = (t)=>{
        const [, e] = rt(t, [
            "class"
        ]);
        return I(dO, qe({
            get class () {
                return xn("type-text-sm text-content-muted", t.class);
            }
        }, e));
    };
    fte = (t)=>(()=>{
            var e = Fdt(), n = e.firstChild, r = n.nextSibling;
            return F(n, ()=>t.title), F(r, I(tw, {
                class: "flex h-full w-full items-center justify-center text-icon-muted hover:text-header-foreground hover:bg-header-divider/40 transition-colors outline-none cursor-pointer",
                title: "Close",
                "aria-label": "Close",
                get children () {
                    var s = Bdt();
                    return F(s, I(cO, {})), s;
                }
            })), pt((s)=>{
                var i = xn("flex flex-row justify-between items-center h-16 pl-4 bg-header shrink-0", t.noBorder ? "rounded-none" : "border-b border-header-divider rounded-t-lg rounded-b-[8px]", t.class), o = xn("ml-auto flex w-16 h-16 shrink-0 items-center justify-center", !t.noBorder && "border-l border-header-divider");
                return i !== s.e && Vt(e, s.e = i), o !== s.t && Vt(r, s.t = o), s;
            }, {
                e: void 0,
                t: void 0
            }), e;
        })();
    qdt = 2500000n;
    Wdt = "local:cardanoDustRegistrationLock";
    Kdt = "local:cardanoDustRegistrationInflight";
    $dt = 120 * 1e3;
    function sw(t) {
        return t.trim().toLowerCase();
    }
    function pte(t) {
        return `${Wdt}:${sw(t)}`;
    }
    function hte(t) {
        return `${Kdt}:${sw(t)}`;
    }
    function gte(t) {
        return Array.from(t, (e)=>e.toString(16).padStart(2, "0")).join("");
    }
    function Xdt(t) {
        const e = new Uint8Array(t.length / 2);
        for(let n = 0; n < t.length; n += 2)e[n / 2] = parseInt(t.slice(n, n + 2), 16);
        return e;
    }
    function jz(t, e) {
        try {
            const n = Xdt(t), r = e === "mainnet" ? "mn_dust" : `mn_dust_${String(e)}`, s = Pa.toWords(n);
            return Pa.encode(r, s, 200);
        } catch  {
            return null;
        }
    }
    y2t = function(t) {
        try {
            const { words: e } = Pa.decode(t.trim(), 200), n = Uint8Array.from(Pa.fromWords(e));
            return n.length < 32 ? null : gte(n.slice(0, 32));
        } catch  {
            return null;
        }
    };
    Gdt = function(t, e) {
        try {
            const r = Jr.parse(t.trim()).decode(Yu, e);
            return gte(r.serialize());
        } catch  {
            return null;
        }
    };
    bte = async function(t) {
        return await zt.getItem(pte(t)) ?? null;
    };
    mte = async function(t) {
        await zt.setItem(pte(t.cardanoAddress), {
            ...t,
            cardanoAddress: sw(t.cardanoAddress)
        });
    };
    w2t = async function(t) {
        const e = hte(t), n = Date.now(), r = await zt.getItem(e);
        return typeof r == "number" && n - r < $dt ? !1 : (await zt.setItem(e, n), !0);
    };
    _2t = async function(t) {
        await zt.removeItem(hte(t));
    };
    x2t = async function(t) {
        const e = {
            cardanoAddress: sw(t.cardanoAddress),
            dustPublicKey: t.dustPublicKey,
            txHash: t.txHash,
            submittedAt: Date.now(),
            status: "submitted"
        };
        return await mte(e), e;
    };
    Zdt = async function(t) {
        const e = await bte(t.cardanoAddress), n = {
            cardanoAddress: sw(t.cardanoAddress),
            dustPublicKey: t.dustPublicKey,
            txHash: t.txHash ?? e?.txHash ?? null,
            submittedAt: e?.submittedAt ?? Date.now(),
            status: "registered"
        };
        return await mte(n), n;
    };
    Jdt = function(t) {
        return t.registration ? t.registration.matchesCurrentDustPublicKey ? t.dustBalance > 0n || t.dustCoinsCount > 0 ? "active" : "pending" : "elsewhere" : "none";
    };
    Ydt = function(t) {
        return t.status === "registered" ? "This Cardano wallet is already registered for DUST generation. Do not submit another registration from 1AM." : "A Cardano DUST registration was already submitted from this wallet. DUST can take up to 12 hours to appear, so do not submit again.";
    };
    var Qdt = Q('<span class="flex h-4 w-4 items-center justify-center">'), eft = Q('<div class="flex items-center gap-2 border border-border bg-background px-3 py-2 text-xs text-content-muted"><div class="h-3 w-3 animate-spin rounded-full border-2 border-current border-t-transparent"></div>Checking Cardano DUST registration...'), tft = Q('<a target=_blank rel="noopener noreferrer"class="shrink-0 text-amber-700/80 transition-colors hover:text-amber-700"title="View on Cardanoscan"aria-label="View on Cardanoscan"><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>'), nft = Q('<div class="mt-3 flex items-start gap-2"><div class="min-w-0 flex-1"><p class="text-[10px] font-medium uppercase tracking-[0.18em] text-amber-700/80">Transaction Hash</p><p class="mt-1 break-all font-mono">'), rft = Q('<div class="border border-amber-500/30 bg-amber-500/10 px-3 py-3 text-xs text-amber-700"><p class=font-medium>Registration Pending</p><p class=mt-1>Your NIGHT on Cardano is registered for DUST generation in 1AM.</p><p class="mt-2 text-amber-700/80">The registration is recorded on Cardano, but DUST has not appeared in this wallet yet.</p><p class="mt-2 text-amber-700/80">DUST can take up to 12 hours to appear. Do not submit again.</p><p class="mt-3 text-amber-700/80">Cardano indexing may take a little time before this registration appears as active in 1AM.'), sft = Q('<p class="text-[10px] font-mono text-emerald-600/70 break-all">'), ift = Q('<div class="border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 space-y-1"><p class="text-xs text-emerald-700">This Cardano wallet is actively registered for DUST generation in 1AM.'), oft = Q('<p class="text-[10px] font-mono text-amber-600/70 break-all">On-chain: '), aft = Q('<p class="text-[10px] font-mono text-amber-600/70 break-all">This wallet: '), cft = Q('<div class="border border-amber-500/30 bg-amber-500/10 px-3 py-2 space-y-1.5"><p class="text-xs text-amber-700">This Cardano address is registered for DUST generation, but linked to a different Midnight account. Switch to the matching account, or use the cNIGHT-to-DUST dApp to update the registration.'), lft = Q('<div class="border border-rose-500/30 bg-rose-500/10 px-3 py-2 text-xs text-rose-600">You need cNIGHT in your Cardano wallet before you can generate DUST.'), uft = Q('<div class="border border-rose-500/30 bg-rose-500/10 px-3 py-2 text-xs text-rose-600">You need at least 2.5 ADA on Cardano for the registration output, fees, and buffer.'), dft = Q('<div class="border border-rose-500/30 bg-rose-500/10 px-3 py-2 text-xs text-rose-600">'), fft = Q('<a target=_blank rel="noopener noreferrer"class="shrink-0 text-emerald-700/80 hover:text-emerald-700 transition-colors"title="View on Cardanoscan"aria-label="View on Cardanoscan"><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>'), pft = Q('<div class="mt-3 flex items-start gap-2"><div class="min-w-0 flex-1"><p class="text-[10px] font-medium uppercase tracking-[0.18em] text-emerald-700/80">Transaction Hash</p><p class="mt-1 break-all font-mono">'), hft = Q('<div class="border border-emerald-500/30 bg-emerald-500/10 px-3 py-3 text-xs text-emerald-700"><p class=font-medium>Registration Submitted</p><p class=mt-1>Your NIGHT on Cardano is registered for DUST generation.</p><p class="mt-2 text-emerald-700/80">DUST can take up to 12 hours to appear. Do not submit again.</p><p class="mt-2 text-emerald-700/80">Submitting again can override your earlier registration, so this action is locked.</p><p class="mt-3 text-emerald-700/80">Cardano indexing may take a little time before this registration appears as active in 1AM.'), gft = Q('<div class="flex flex-col gap-4 bg-card p-4"><div class="flex gap-3 border border-border bg-background p-4"><div class="flex h-12 w-12 shrink-0 items-center justify-center rounded-full border border-border bg-[var(--bg-primary)]"></div><div class="flex flex-col gap-2"><div class="flex items-center gap-2"><span class="flex h-4 w-4 items-center justify-center"></span><p class="text-[10px] font-medium uppercase tracking-[0.18em] text-content-muted-light">DUST registration</p></div><p class="text-sm font-medium text-foreground">Register your NIGHT on Cardano to generate DUST.</p><p class="text-xs text-content-muted-light">This submits the standard NIGHT-to-DUST registration transaction and links this Cardano wallet to your 1AM wallet.</p></div></div><div class="grid grid-cols-2 gap-3"><div class="border border-border bg-background p-3"><p class="text-[10px] uppercase tracking-[0.18em] text-content-muted-light">cNIGHT</p><p class="mt-1 text-lg font-semibold text-foreground"></p></div><div class="border border-border bg-background p-3"><p class="text-[10px] uppercase tracking-[0.18em] text-content-muted-light">ADA</p><p class="mt-1 text-lg font-semibold text-foreground"></p></div></div><div class="flex gap-3">'), bft = Q('<div class="h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent">');
    const mft = ()=>{
        const { cardanoAddress: t, cardanoBalance: e, dustAddress: n, dustBalance: r, dustCoins: s, generateCardanoDust: i, updateCardanoDustReg: o } = lr(), [a, c] = pe(!1), [l, u] = pe(null), [d, f] = pe(!1), [p, h] = pe(!1), [m, w] = pe(null), [v, k] = pe(null), [_, A] = pe(null);
        let P = null;
        const U = ()=>e()?.night ?? 0n, K = ()=>e()?.lovelace ?? 0n, X = ()=>U() > 0n, G = ()=>K() >= qdt, ce = ()=>v() !== null, ie = ()=>m() ? Jdt({
                registration: m(),
                dustBalance: r(),
                dustCoinsCount: s().length
            }) : "none", Y = ()=>ie() === "pending", M = ()=>ie() === "active", g = ()=>Y() || M(), y = ()=>ie() === "elsewhere", C = ()=>_() ?? v()?.txHash ?? null, R = ()=>(!!_() || ce()) && !Y() && !M() && !y(), N = ()=>{
            const O = ir.mainnet;
            return vT(O.explorerBaseUrl, C() || "");
        }, L = ()=>_() ? "SUBMITTED" : Y() ? "PENDING" : M() ? "ACTIVE" : ce() ? v()?.status === "submitted" ? "SUBMITTED" : "LOCKED" : "GENERATE DUST", z = ()=>{
            u(null), A(null);
        }, B = async ()=>{
            const O = Gdt(n(), "mainnet");
            if (!t()) {
                w(null), k(null);
                return;
            }
            if (!O) {
                w(null), k(null);
                return;
            }
            P?.abort(), P = new AbortController;
            const q = P;
            h(!0), u(null);
            try {
                const H = await bte(t());
                k(H);
                const { findCardanoDustRegistration: Z } = await sr(async ()=>{
                    const { findCardanoDustRegistration: J } = await import("./cardano-dust-Dtj1ts72.js").then(async (m)=>{
                        await m.__tla;
                        return m;
                    });
                    return {
                        findCardanoDustRegistration: J
                    };
                }, __vite__mapDeps([10,4,8,2,11,3,6,7])), te = await Z({
                    cardanoAddress: t(),
                    currentDustPublicKey: O,
                    signal: q.signal
                });
                if (w(te), te) {
                    const J = await Zdt({
                        cardanoAddress: t(),
                        dustPublicKey: te.dustPublicKey,
                        txHash: te.txHash
                    });
                    k(J);
                }
            } catch (H) {
                if (q.signal.aborted) return;
                w(null), u(H instanceof Error ? H.message : "Failed to check Cardano DUST registration");
            } finally{
                q.signal.aborted || h(!1);
            }
        };
        lt(()=>{
            const O = a(), q = t(), H = n();
            if (!O) {
                P?.abort(), h(!1);
                return;
            }
            z(), q && H && B();
        }), It(()=>{
            P?.abort();
        });
        const x = async ()=>{
            if (u(null), !X()) {
                u("You need cNIGHT in your Cardano wallet to generate DUST.");
                return;
            }
            if (!G()) {
                u("You need at least 2.5 ADA in your Cardano wallet to generate DUST.");
                return;
            }
            if (ce()) {
                u(Ydt(v()));
                return;
            }
            f(!0), A(null);
            try {
                const O = await i();
                A(O), await B().catch(()=>{});
            } catch (O) {
                const q = O instanceof Error ? O.message : "Failed to generate DUST from Cardano";
                u(q);
            } finally{
                f(!1);
            }
        };
        return I(nw, {
            get open () {
                return a();
            },
            onOpenChange: c,
            get children () {
                return [
                    I(R9, {
                        class: "mt-3 flex h-10 w-full items-center justify-center gap-2 border border-[var(--border-secondary)] bg-[var(--bg-secondary)] px-3 text-xs font-medium text-foreground transition-colors hover:bg-foreground hover:text-background",
                        title: "Generate DUST",
                        "aria-label": "Generate DUST",
                        get children () {
                            return [
                                (()=>{
                                    var O = Qdt();
                                    return F(O, I(Dc, {
                                        kind: "symbol",
                                        class: "h-full w-full"
                                    })), O;
                                })(),
                                "GENERATE DUST"
                            ];
                        }
                    }),
                    I(rw, {
                        class: "max-w-lg border-0 p-0",
                        get children () {
                            return [
                                I(fte, {
                                    title: "GENERATE DUST"
                                }),
                                (()=>{
                                    var O = gft(), q = O.firstChild, H = q.firstChild, Z = H.nextSibling, te = Z.firstChild, J = te.firstChild, se = q.nextSibling, fe = se.firstChild, ge = fe.firstChild, Ce = ge.nextSibling, Ue = fe.nextSibling, Ie = Ue.firstChild, Le = Ie.nextSibling, Ge = se.nextSibling;
                                    return F(H, I(Dc, {
                                        kind: "token",
                                        class: "h-9 w-9"
                                    })), F(J, I(Dc, {
                                        kind: "symbol",
                                        class: "h-full w-full"
                                    })), F(Ce, ()=>(Number(U()) / 1e6).toFixed(2)), F(Le, ()=>(Number(K()) / 1e6).toFixed(2)), F(O, I(de, {
                                        get when () {
                                            return p();
                                        },
                                        get children () {
                                            return eft();
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return Y();
                                        },
                                        get children () {
                                            var Ve = rft(), Ne = Ve.firstChild, be = Ne.nextSibling, Qe = be.nextSibling, le = Qe.nextSibling, De = le.nextSibling;
                                            return F(Ve, I(de, {
                                                get when () {
                                                    return C();
                                                },
                                                get children () {
                                                    var Re = nft(), ee = Re.firstChild, oe = ee.firstChild, ye = oe.nextSibling;
                                                    return F(ye, C), F(Re, I(de, {
                                                        get when () {
                                                            return N();
                                                        },
                                                        get children () {
                                                            var D = tft();
                                                            return pt(()=>Ot(D, "href", N())), D;
                                                        }
                                                    }), null), Re;
                                                }
                                            }), De), Ve;
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return Ze(()=>!p())() && M();
                                        },
                                        get children () {
                                            var Ve = ift();
                                            return Ve.firstChild, F(Ve, I(de, {
                                                get when () {
                                                    return m()?.dustPublicKey;
                                                },
                                                get children () {
                                                    var Ne = sft();
                                                    return F(Ne, ()=>jz(m().dustPublicKey, "mainnet") || m().dustPublicKey), Ne;
                                                }
                                            }), null), Ve;
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return Ze(()=>!p())() && y();
                                        },
                                        get children () {
                                            var Ve = cft();
                                            return Ve.firstChild, F(Ve, I(de, {
                                                get when () {
                                                    return m()?.dustPublicKey;
                                                },
                                                get children () {
                                                    var Ne = oft();
                                                    return Ne.firstChild, F(Ne, ()=>jz(m().dustPublicKey, "mainnet") || m().dustPublicKey, null), Ne;
                                                }
                                            }), null), F(Ve, I(de, {
                                                get when () {
                                                    return n();
                                                },
                                                get children () {
                                                    var Ne = aft();
                                                    return Ne.firstChild, F(Ne, n, null), Ne;
                                                }
                                            }), null), Ve;
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return !X();
                                        },
                                        get children () {
                                            return lft();
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return Ze(()=>!!X())() && !G();
                                        },
                                        get children () {
                                            return uft();
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return l();
                                        },
                                        get children () {
                                            var Ve = dft();
                                            return F(Ve, l), Ve;
                                        }
                                    }), Ge), F(O, I(de, {
                                        get when () {
                                            return Ze(()=>!p())() && R();
                                        },
                                        get children () {
                                            var Ve = hft(), Ne = Ve.firstChild, be = Ne.nextSibling, Qe = be.nextSibling, le = Qe.nextSibling, De = le.nextSibling;
                                            return F(Ve, I(de, {
                                                get when () {
                                                    return C();
                                                },
                                                get children () {
                                                    var Re = pft(), ee = Re.firstChild, oe = ee.firstChild, ye = oe.nextSibling;
                                                    return F(ye, C), F(Re, I(de, {
                                                        get when () {
                                                            return N();
                                                        },
                                                        get children () {
                                                            var D = fft();
                                                            return pt(()=>Ot(D, "href", N())), D;
                                                        }
                                                    }), null), Re;
                                                }
                                            }), De), Ve;
                                        }
                                    }), Ge), F(Ge, I($r, {
                                        variant: "outline",
                                        class: "flex-1",
                                        onClick: ()=>c(!1),
                                        title: "Close",
                                        "aria-label": "Close",
                                        children: "CLOSE"
                                    }), null), F(Ge, I($r, {
                                        variant: "submit",
                                        size: "submit",
                                        class: "flex-1",
                                        onClick: ()=>void x(),
                                        get disabled () {
                                            return d() || p() || !!_() || ce() || g() || y() || !X() || !G();
                                        },
                                        title: "Generate DUST",
                                        "aria-label": "Generate DUST",
                                        get children () {
                                            return I(de, {
                                                get when () {
                                                    return !d();
                                                },
                                                get fallback () {
                                                    return [
                                                        bft(),
                                                        "SUBMITTING..."
                                                    ];
                                                },
                                                get children () {
                                                    return L();
                                                }
                                            });
                                        }
                                    }), null), O;
                                })()
                            ];
                        }
                    })
                ];
            }
        });
    };
    var yft = Q('<div aria-hidden=true class="pointer-events-none absolute inset-0"style="background-image:var(--color-diagonal-pattern);opacity:var(--shielded-pattern-opacity, 0.68)">'), wft = Q('<article class="relative flex flex-col p-4 md:p-5 gap-1 md:border-r border-b border-[var(--border-secondary)] last:border-r-0 min-w-0"><div class="relative flex items-center justify-between gap-4"><div class="flex items-center gap-2 px-2 py-1.5 bg-[var(--bg-primary)] border-y border-[var(--border-secondary)]"><i class="icon-box w-[14px] h-[14px]"></i><span class="text-[12px] md:text-sm font-medium text-content-muted"></span></div><button class="flex items-center gap-1 text-[12px] md:text-[14px] text-content-muted-dark hover:text-foreground"><i class="icon-box w-[16px] h-[16px]"></i></button></div><div class="relative flex flex-col gap-2"><p style=font-family:var(--font-family-body)></p><p class="text-xs text-content-muted">'), _ft = Q("<span class=text-[var(--text-warning-primary)]>Syncing..."), xft = Q('<img alt=Cardano class="w-full h-full">'), vft = Q('<div class="px-4 md:px-5 pb-4 border-b border-[var(--border-secondary)]">'), Sft = Q('<div class="flex flex-col">'), kft = Q("<section>");
    const S7 = (t)=>{
        const [e, n] = pe(!1);
        return (()=>{
            var r = wft(), s = r.firstChild, i = s.firstChild, o = i.firstChild, a = o.nextSibling, c = i.nextSibling, l = c.firstChild, u = s.nextSibling, d = u.firstChild, f = d.nextSibling;
            return F(r, I(de, {
                get when () {
                    return t.shielded;
                },
                get children () {
                    return yft();
                }
            }), s), F(o, ()=>t.icon), F(a, ()=>t.title), c.$$click = ()=>n((p)=>!p), F(c, I(de, {
                get when () {
                    return e();
                },
                fallback: "HIDE",
                children: "SHOW"
            }), l), F(l, I(de, {
                get when () {
                    return e();
                },
                get fallback () {
                    return I(_lt, {});
                },
                get children () {
                    return I(xlt, {});
                }
            })), F(d, (()=>{
                var p = Ze(()=>!!e());
                return ()=>p() ? "••••••" : t.amount;
            })()), F(f, (()=>{
                var p = Ze(()=>!!t.syncing);
                return ()=>p() ? _ft() : t.subtitle;
            })()), pt((p)=>{
                var h = e() ? "Show" : "Hide", m = e() ? "Show" : "Hide", w = `type-display-xs md:type-display-xl font-semibold ${t.syncing ? "text-foreground/30" : "text-foreground"} transition-colors duration-500`;
                return h !== p.e && Ot(c, "title", p.e = h), m !== p.t && Ot(c, "aria-label", p.t = m), w !== p.a && Vt(d, p.a = w), p;
            }, {
                e: void 0,
                t: void 0,
                a: void 0
            }), r;
        })();
    }, Tft = ()=>{
        const { environmentSettings: t } = lr(), e = ()=>t().theme === "dark" ? cg : ab;
        return (()=>{
            var n = xft();
            return pt(()=>Ot(n, "src", e())), n;
        })();
    }, Cft = ()=>{
        const { shieldedBalances: t, unshieldedBalances: e, formatBalance: n, environmentSettings: r, cardanoBalance: s, cardanoEnabled: i, isSynced: o } = lr(), a = ()=>{
            let P = 0n;
            const U = t();
            for (const [K, X] of Object.entries(U))P += X;
            return P;
        }, c = ()=>{
            let P = 0n;
            for (const [U, K] of e().entries())P += K;
            return P;
        }, l = ()=>n(a()), u = ()=>n(c()), d = ()=>!o() && a() === 0n, f = ()=>!o() && c() === 0n, p = ()=>"NIGHT", { cardanoLoading: h, cardanoError: m } = lr(), w = ()=>fg(r().environment) && i(), v = ()=>Hte(r().environment), k = ()=>{
            if (h()) return "...";
            if (m()) return "Error";
            const P = s();
            return P ? n(P.night, 2) : "0.00";
        }, _ = ()=>{
            const P = s();
            return !P || h() ? null : n(P.lovelace, 2);
        }, A = ()=>w() ? "grid-cols-1 md:grid-cols-3" : "grid-cols-1 md:grid-cols-2";
        return (()=>{
            var P = kft();
            return F(P, I(S7, {
                title: "SHIELDED BALANCE",
                get subtitle () {
                    return `Sum of all shielded ${p()} tokens`;
                },
                get icon () {
                    return I(Ep, {});
                },
                get amount () {
                    return l();
                },
                get syncing () {
                    return d();
                },
                shielded: !0
            }), null), F(P, I(S7, {
                title: "UNSHIELDED BALANCE",
                get subtitle () {
                    return `Sum of all unshielded ${p()} tokens`;
                },
                get icon () {
                    return I(Ip, {});
                },
                get amount () {
                    return u();
                },
                get syncing () {
                    return f();
                }
            }), null), F(P, I(de, {
                get when () {
                    return w();
                },
                get children () {
                    var U = Sft();
                    return F(U, I(S7, {
                        title: "CARDANO BALANCE",
                        get subtitle () {
                            return Ze(()=>!!_())() ? `ADA: ${_()}` : "NIGHT on Cardano L1";
                        },
                        get icon () {
                            return I(Tft, {});
                        },
                        get amount () {
                            return k();
                        }
                    }), null), F(U, I(de, {
                        get when () {
                            return v();
                        },
                        get children () {
                            var K = vft();
                            return F(K, I(mft, {})), K;
                        }
                    }), null), U;
                }
            }), null), pt(()=>Vt(P, `grid ${A()} bg-[var(--bg-primary)]`)), P;
        })();
    };
    Pi([
        "click"
    ]);
    var N9 = Q("<li>"), Eft = Q("<ul>"), Ift = {};
    bu(Ift, {
        Ellipsis: ()=>mO,
        Item: ()=>yO,
        Items: ()=>wO,
        Next: ()=>_O,
        Pagination: ()=>Aft,
        Previous: ()=>xO,
        Root: ()=>vO,
        usePaginationContext: ()=>iw
    });
    function mO(t) {
        return (()=>{
            var e = N9();
            return F(e, I(yn, qe({
                as: "div"
            }, t))), e;
        })();
    }
    var yte = ds();
    function iw() {
        const t = fs(yte);
        if (t === void 0) throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");
        return t;
    }
    function yO(t) {
        const e = iw(), [n, r] = rt(t, [
            "page",
            "onClick"
        ]), s = ()=>e.page() === n.page, i = ()=>{
            e.setPage(n.page);
        };
        return (()=>{
            var o = N9();
            return F(o, I(jc, qe({
                get "aria-current" () {
                    return s() ? "page" : void 0;
                },
                get "data-current" () {
                    return s() ? "" : void 0;
                },
                get onClick () {
                    return Yt([
                        n.onClick,
                        i
                    ]);
                }
            }, r))), o;
        })();
    }
    function wO(t) {
        const e = iw(), n = Ct(()=>{
            const { count: r, siblingCount: s, page: i, fixedItems: o, showFirst: a, showLast: c } = e, l = r() < 2 * s() + (o() ? 6 : 4);
            if (l) return {
                renderItemsDirectly: l
            };
            const u = a() && i() - 1 > s(), d = c() && r() - i() > s();
            let f = i() - (a() ? 2 : 1) > s(), p = r() - i() - (c() ? 1 : 0) > s(), h = Math.min(i() - 1, s()), m = Math.min(r() - i(), s());
            if (o() !== !1) {
                const w = h, v = m;
                h += Math.max(s() - v, 0), m += Math.max(s() - w, 0), u || m++, d || h++, o() === !0 && (f || m++, p || h++), i() - h - (a() ? 2 : 1) === 1 && (f = !1, h++), r() - i() - m - (c() ? 1 : 0) === 1 && (p = !1, m++);
            }
            return {
                showFirst: u,
                showLast: d,
                showFirstEllipsis: f,
                showLastEllipsis: p,
                previousSiblingCount: h,
                nextSiblingCount: m,
                renderItemsDirectly: l
            };
        });
        return I(de, {
            get when () {
                return n().renderItemsDirectly;
            },
            get fallback () {
                return [
                    I(de, {
                        get when () {
                            return n().showFirst;
                        },
                        get children () {
                            return e.renderItem(1);
                        }
                    }),
                    I(de, {
                        get when () {
                            return n().showFirstEllipsis;
                        },
                        get children () {
                            return e.renderEllipsis();
                        }
                    }),
                    I(_r, {
                        get each () {
                            return [
                                ...Array(n().previousSiblingCount).keys()
                            ].reverse();
                        },
                        children: (r)=>Ze(()=>e.renderItem(e.page() - (r + 1)))
                    }),
                    Ze(()=>e.renderItem(e.page())),
                    I(_r, {
                        get each () {
                            return [
                                ...Array(n().nextSiblingCount).keys()
                            ];
                        },
                        children: (r)=>Ze(()=>e.renderItem(e.page() + (r + 1)))
                    }),
                    I(de, {
                        get when () {
                            return n().showLastEllipsis;
                        },
                        get children () {
                            return e.renderEllipsis();
                        }
                    }),
                    I(de, {
                        get when () {
                            return n().showLast;
                        },
                        get children () {
                            return e.renderItem(e.count());
                        }
                    })
                ];
            },
            get children () {
                return I(_r, {
                    get each () {
                        return [
                            ...Array(e.count()).keys()
                        ];
                    },
                    children: (r)=>Ze(()=>e.renderItem(r + 1))
                });
            }
        });
    }
    function _O(t) {
        const e = iw(), [n, r] = rt(t, [
            "onClick"
        ]), s = ()=>{
            e.setPage(e.page() + 1);
        }, i = ()=>e.page() === e.count();
        return (()=>{
            var o = N9();
            return F(o, I(jc, qe({
                get tabIndex () {
                    return i() || e.page() === e.count() ? -1 : void 0;
                },
                get disabled () {
                    return i();
                },
                get "aria-disabled" () {
                    return i() || void 0;
                },
                get "data-disabled" () {
                    return i() ? "" : void 0;
                },
                get onClick () {
                    return Yt([
                        n.onClick,
                        s
                    ]);
                }
            }, r))), o;
        })();
    }
    function xO(t) {
        const e = iw(), [n, r] = rt(t, [
            "onClick"
        ]), s = ()=>{
            e.setPage(e.page() - 1);
        }, i = ()=>e.page() === 1;
        return (()=>{
            var o = N9();
            return F(o, I(jc, qe({
                get tabIndex () {
                    return i() || e.page() === 1 ? -1 : void 0;
                },
                get disabled () {
                    return i();
                },
                get "aria-disabled" () {
                    return i() || void 0;
                },
                get "data-disabled" () {
                    return i() ? "" : void 0;
                },
                get onClick () {
                    return Yt([
                        n.onClick,
                        s
                    ]);
                }
            }, r))), o;
        })();
    }
    function vO(t) {
        const e = `pagination-${ii()}`, n = qt({
            id: e
        }, t), [r, s] = rt(n, [
            "page",
            "defaultPage",
            "onPageChange",
            "count",
            "siblingCount",
            "showFirst",
            "showLast",
            "fixedItems",
            "itemComponent",
            "ellipsisComponent",
            "disabled",
            "children"
        ]), i = eh({
            defaultValue: ()=>r.defaultPage ?? 1,
            onChange: r.onPageChange,
            value: ()=>r.page
        }), o = {
            count: ()=>r.count,
            siblingCount: ()=>r.siblingCount ?? 1,
            showFirst: ()=>r.showFirst ?? !0,
            showLast: ()=>r.showLast ?? !0,
            fixedItems: ()=>r.fixedItems ?? !1,
            isDisabled: ()=>r.disabled ?? !1,
            renderItem: (a)=>r.itemComponent({
                    page: a
                }),
            renderEllipsis: r.ellipsisComponent,
            page: ()=>Math.min(i[0]() ?? 1, r.count),
            setPage: i[1]
        };
        return I(yte.Provider, {
            value: o,
            get children () {
                return I(yn, qe({
                    as: "nav",
                    get "data-disabled" () {
                        return r.disabled ? "" : void 0;
                    }
                }, s, {
                    get children () {
                        var a = Eft();
                        return F(a, ()=>r.children), a;
                    }
                }));
            }
        });
    }
    var Aft = Object.assign(vO, {
        Ellipsis: mO,
        Item: yO,
        Items: wO,
        Next: _O,
        Previous: xO
    }), Pft = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><circle cx=12 cy=12 r=1></circle><circle cx=19 cy=12 r=1></circle><circle cx=5 cy=12 r=1>'), Oft = Q("<span class=sr-only>More pages"), Mft = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M15 6l-6 6l6 6">'), Rft = Q("<span>Previous"), Nft = Q("<span>Next"), Vft = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M9 6l6 6l-6 6">');
    const Dft = wO, Bft = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(vO, qe({
            get class () {
                return xn("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1", e.class);
            }
        }, n));
    }, Fft = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(yO, qe({
            get class () {
                return xn(w9({
                    variant: "ghost"
                }), "size-10 data-[current]:border", e.class);
            }
        }, n));
    }, Lft = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(mO, qe({
            get class () {
                return xn("flex size-10 items-center justify-center", e.class);
            }
        }, n, {
            get children () {
                return [
                    Pft(),
                    Oft()
                ];
            }
        }));
    }, zft = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "children"
        ]);
        return I(xO, qe({
            get class () {
                return xn(w9({
                    variant: "ghost"
                }), "gap-1 pl-2.5", e.class);
            }
        }, n, {
            get children () {
                return I(de, {
                    get when () {
                        return e.children;
                    },
                    get fallback () {
                        return [
                            Mft(),
                            Rft()
                        ];
                    },
                    children: (r)=>r()
                });
            }
        }));
    }, Uft = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "children"
        ]);
        return I(_O, qe({
            get class () {
                return xn(w9({
                    variant: "ghost"
                }), "gap-1 pl-2.5", e.class);
            }
        }, n, {
            get children () {
                return I(de, {
                    get when () {
                        return e.children;
                    },
                    get fallback () {
                        return [
                            Nft(),
                            Vft()
                        ];
                    },
                    children: (r)=>r()
                });
            }
        }));
    };
    var Hft = Q('<img alt aria-hidden=true class="w-full h-full">'), jft = Q('<span class="text-[10px] font-normal text-content-muted font-mono truncate">'), qz = Q('<span class="text-[10px] text-content-muted-light truncate">'), qft = Q('<span class="text-[10px] text-[var(--text-error-primary)] truncate">'), Wft = Q('<tr><td class="py-3 px-4 md:px-8 align-middle"><div class="flex flex-row items-center gap-3"><i class="icon-box w-[30px] h-[30px] text-icon-muted shrink-0"></i><div class="flex flex-col justify-center gap-0.5 leading-tight min-w-0 overflow-hidden"><span class="text-xs font-normal text-foreground font-mono truncate"></span></div></div></td><td class="py-3 px-4 md:px-8 align-middle"><div class="flex flex-col gap-0.5 min-w-0 overflow-hidden"><div class="flex items-center gap-2 min-w-0 overflow-hidden"><span class="text-xs font-normal text-foreground font-mono truncate"></span></div></div></td><td class="py-3 px-4 md:px-8 align-middle text-right"><div class="flex flex-col items-end gap-0.5">'), wte = Q("<span> "), Kft = Q('<span class="whitespace-nowrap text-[10px] font-mono text-content-muted">fee: <!> ADA'), $ft = Q('<span class="inline-flex items-center justify-end gap-1.5 whitespace-nowrap text-[10px] font-mono text-content-muted"><span class="inline-flex h-3 w-3 items-center justify-center shrink-0"></span><span>'), Xft = Q('<tr class="border-b border-[var(--border-secondary)] last:border-0 hover:bg-muted/30 transition-colors cursor-pointer"><td class="py-3 px-4 md:px-8 align-middle"><div class="flex flex-row items-center gap-3"><i class="icon-box w-[30px] h-[30px] text-icon-muted shrink-0"></i><div class="flex flex-col justify-center gap-0 leading-tight h-[30px] min-w-0 overflow-hidden"><span class="text-xs font-normal text-foreground font-mono truncate"></span><span class="text-xs font-normal text-content-muted font-mono truncate"></span></div></div></td><td class="py-3 px-4 md:px-8 align-middle"><div class="flex flex-row items-center gap-3"><i class="icon-box w-[30px] h-[30px] text-icon-muted shrink-0"></i><div class="flex flex-col justify-center gap-0 leading-tight h-[30px] min-w-0 overflow-hidden"><span class="text-xs font-normal text-foreground font-mono truncate"></span><span class="text-xs font-normal text-content-muted font-mono truncate"></span></div></div></td><td class="py-3 px-4 md:px-8 align-middle text-right"><div class="flex flex-col items-end gap-0.5"><div class="inline-flex items-center gap-2"><i class="icon-box w-3.5 h-3.5 text-icon-muted">'), Gft = Q('<div class="flex items-center justify-between pt-4 border-t border-[var(--border-secondary)] mt-2 px-4 md:px-8"><p class="text-xs text-muted-foreground">Page <!> of '), Zft = Q('<div class="flex flex-col w-full"><div class="flex flex-col w-full"><table class="w-full table-fixed border-collapse"><thead><tr class="border-b border-[var(--border-secondary)]"><th class="w-[34%] py-3 px-4 md:px-8 text-left text-xs font-medium text-content-muted font-mono">TRANSACTION</th><th class="w-[38%] py-3 px-4 md:px-8 text-left text-xs font-medium text-content-muted font-mono">METHOD</th><th class="w-[124px] py-3 px-4 md:px-8 md:w-[143px]"></th></tr></thead><tbody>'), Jft = Q('<tr class=h-full><td colspan=3 class="h-full align-middle"><div class="flex h-full min-h-[200px] md:min-h-[320px] flex-col items-center justify-center text-content-muted"><i class="icon-box w-8 h-8 md:w-10 md:h-10 mb-2 md:mb-3 lg:mb-4 text-content-muted"></i><p class="text-xs md:text-sm lg:text-base uppercase">No transactions yet</p><p class="text-[10px] md:text-xs lg:text-sm mt-1 uppercase text-content-muted-dark">Your activity will appear here');
    const gT = "0000000000000000000000000000000000000000000000000000000000000000";
    function Yft(t) {
        const e = new Map;
        for (const n of t.createdUtxos)e.set(n.tokenType, (e.get(n.tokenType) ?? 0n) + n.value);
        for (const n of t.spentUtxos)e.set(n.tokenType, (e.get(n.tokenType) ?? 0n) - n.value);
        return Array.from(e.entries()).map(([n, r])=>({
                tokenType: n,
                net: r
            }));
    }
    function Qft(t) {
        const e = t.reduce((n, r)=>n + r.net, 0n);
        return e > 0n ? "receive" : e < 0n ? "send" : "self";
    }
    function ept(t) {
        const e = t.spentUtxos.some((r)=>(r.tokenType === "" || r.tokenType === gT) && r.registeredForDustGeneration === !1), n = t.createdUtxos.some((r)=>(r.tokenType === "" || r.tokenType === gT) && r.registeredForDustGeneration === !0);
        return e && n;
    }
    const tpt = {
        send: {
            icon: "↗️",
            color: "text-[var(--fg-error-secondary)]",
            label: "Sent"
        },
        receive: {
            icon: "↙️",
            color: "text-[var(--fg-success-secondary)]",
            label: "Received"
        },
        self: {
            icon: "🔄",
            color: "text-violet-500",
            label: "Self"
        }
    }, npt = {
        SUCCESS: {
            tone: "success",
            label: "Success"
        },
        FAILURE: {
            tone: "error",
            label: "Failed"
        },
        PARTIAL_SUCCESS: {
            tone: "warning",
            label: "Partial"
        }
    };
    function rpt(t, e) {
        return ept(t) ? "Generate DUST" : tpt[e].label;
    }
    function spt(t) {
        const e = Date.now() - t.getTime(), n = Math.floor(e / 6e4), r = Math.floor(e / 36e5), s = Math.floor(e / 864e5);
        return n < 1 ? "Just now" : n < 60 ? `${n}m ago` : r < 24 ? `${r}h ago` : s < 7 ? `${s}d ago` : t.toLocaleDateString();
    }
    function ipt(t) {
        const e = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0"), s = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0");
        return `${e}/${n}/${r} ${s}:${i}`;
    }
    function bT(t) {
        return t.length <= 16 ? t : `${t.slice(0, 8)}...${t.slice(-8)}`;
    }
    function opt(t) {
        const e = 1000000000n, n = t / e, r = t % e;
        if (n > 0n) {
            if (r === 0n) return `${n.toLocaleString()} DUST`;
            const s = r.toString().padStart(9, "0").slice(0, 4);
            return `${n.toLocaleString()}.${s} DUST`;
        }
        return `${t.toLocaleString()} dust`;
    }
    function _te(t) {
        return t.replace(/\.0+$/, "");
    }
    function apt(t) {
        return t.type === "dust_generation" ? "Generate DUST" : t.type === "dapp" ? "DApp" : t.type === "receive" ? "Received" : "Sent";
    }
    function Kb(t) {
        return t.type === "dust_generation" ? "DUST registration" : t.tokenType === "" || t.tokenType === gT || t.tokenType === "cNIGHT" ? "NIGHT" : t.tokenType;
    }
    function Wz(t) {
        if (!t) return "";
        const e = t.trim();
        return e.length <= 30 ? e : `${e.slice(0, 16)}...${e.slice(-12)}`;
    }
    const cpt = (t)=>{
        const { environmentSettings: e } = lr(), n = ()=>e().theme === "dark" ? cg : ab, r = ()=>{
            switch(t.transaction.status){
                case "submitting":
                    return {
                        label: "Submitting",
                        tone: "warning",
                        icon: "dot"
                    };
                case "pending":
                    return {
                        label: "Pending",
                        tone: "warning",
                        icon: "dot"
                    };
                case "confirmed":
                    return {
                        label: "Confirmed",
                        tone: "success",
                        icon: "none"
                    };
                case "failed":
                    return {
                        label: "Failed",
                        tone: "error",
                        icon: "none"
                    };
            }
        }, s = ()=>{
            if (!t.transaction.txHash) return;
            const i = t.transaction.chain === "cardano" ? vT(ir[e().environment].explorerBaseUrl, t.transaction.txHash) : oU(ir[e().environment].explorerBaseUrl, t.transaction.txHash, e().environment);
            i && (chrome.tabs?.create?.({
                url: i
            }) ?? window.open(i, "_blank"));
        };
        return (()=>{
            var i = Wft(), o = i.firstChild, a = o.firstChild, c = a.firstChild, l = c.nextSibling, u = l.firstChild, d = o.nextSibling, f = d.firstChild, p = f.firstChild, h = p.firstChild, m = d.nextSibling, w = m.firstChild;
            return i.$$click = s, F(c, I(de, {
                get when () {
                    return t.transaction.chain === "cardano";
                },
                get fallback () {
                    return I(ew, {});
                },
                get children () {
                    var v = Hft();
                    return Ot(v, "draggable", !1), pt(()=>Ot(v, "src", n())), v;
                }
            })), F(u, ()=>spt(new Date(t.transaction.createdAt))), F(l, I(de, {
                get when () {
                    return t.transaction.txHash;
                },
                get children () {
                    var v = jft();
                    return F(v, ()=>bT(t.transaction.txHash)), pt(()=>Ot(v, "title", t.transaction.txHash)), v;
                }
            }), null), F(h, ()=>apt(t.transaction)), F(p, I(de, {
                get when () {
                    return t.transaction.chain === "cardano";
                },
                get children () {
                    return I(lg, {
                        tone: "brand",
                        variant: "modern",
                        size: "sm",
                        class: "uppercase tracking-wide shrink-0",
                        children: "Cardano"
                    });
                }
            }), null), F(f, I(de, {
                get when () {
                    return Kb(t.transaction);
                },
                get children () {
                    var v = qz();
                    return F(v, ()=>Kb(t.transaction), null), F(v, I(de, {
                        get when () {
                            return t.transaction.recipientAddress;
                        },
                        get children () {
                            return [
                                " • ",
                                Ze(()=>Wz(t.transaction.recipientAddress))
                            ];
                        }
                    }), null), pt(()=>Ot(v, "title", t.transaction.recipientAddress ? `${Kb(t.transaction)} • ${t.transaction.recipientAddress}` : Kb(t.transaction))), v;
                }
            }), null), F(f, I(de, {
                get when () {
                    return Ze(()=>t.transaction.type === "dapp")() && t.transaction.recipientAddress;
                },
                get children () {
                    var v = qz();
                    return F(v, ()=>Wz(t.transaction.recipientAddress)), pt(()=>Ot(v, "title", t.transaction.recipientAddress)), v;
                }
            }), null), F(f, I(de, {
                get when () {
                    return t.transaction.error;
                },
                get children () {
                    var v = qft();
                    return F(v, ()=>(t.transaction.error || "").replace(/[<>&"']/g, "").slice(0, 120)), v;
                }
            }), null), F(w, I(lg, {
                get tone () {
                    return r().tone;
                },
                variant: "color",
                size: "sm",
                get icon () {
                    return r().icon;
                },
                class: "uppercase tracking-wide",
                get children () {
                    return r().label;
                }
            }), null), F(w, I(de, {
                get when () {
                    return Ze(()=>!!t.transaction.amount)() && t.transaction.amount !== "0";
                },
                get children () {
                    return (()=>{
                        const { formatBalance: v } = lr(), k = BigInt(t.transaction.amount), _ = t.transaction.chain === "cardano", A = t.transaction.tokenType === "cNIGHT" ? void 0 : t.transaction.tokenType, P = _te(_ ? v(k, 4) : v(k, 4, A)), U = Kb(t.transaction);
                        return (()=>{
                            var K = wte(), X = K.firstChild;
                            return F(K, ()=>t.transaction.type === "receive" ? "+" : "-", X), F(K, P, X), F(K, U, null), pt(()=>Vt(K, `whitespace-nowrap text-[10px] font-mono ${t.transaction.type === "receive" ? "text-[var(--fg-success-secondary)]" : "text-[var(--fg-error-secondary)]"}`)), K;
                        })();
                    })();
                }
            }), null), F(w, I(de, {
                get when () {
                    return Ze(()=>!!t.transaction.fee)() && t.transaction.fee !== "0";
                },
                get children () {
                    return (()=>{
                        const v = BigInt(t.transaction.fee);
                        return (()=>{
                            var k = Kft(), _ = k.firstChild, A = _.nextSibling;
                            return A.nextSibling, F(k, ()=>j7(v, 4), A), k;
                        })();
                    })();
                }
            }), null), pt(()=>Vt(i, `border-b border-[var(--border-secondary)] last:border-0 transition-colors ${t.transaction.txHash ? "hover:bg-muted/30 cursor-pointer" : "hover:bg-[var(--bg-warning-primary)]/30"}`)), i;
        })();
    }, lpt = (t)=>{
        const { formatBalance: e, environmentSettings: n } = lr(), r = Ct(()=>Yft(t.transaction)), s = Ct(()=>Qft(r())), i = ()=>npt[t.transaction.status], o = ()=>rpt(t.transaction, s()), a = ()=>{
            const l = ir[n().environment];
            return oU(l.explorerBaseUrl, t.transaction.hash, n().environment);
        }, c = ()=>{
            const l = a();
            l && (chrome.tabs?.create?.({
                url: l
            }) ?? window.open(l, "_blank"));
        };
        return (()=>{
            var l = Xft(), u = l.firstChild, d = u.firstChild, f = d.firstChild, p = f.nextSibling, h = p.firstChild, m = h.nextSibling, w = u.nextSibling, v = w.firstChild, k = v.firstChild, _ = k.nextSibling, A = _.firstChild, P = A.nextSibling, U = w.nextSibling, K = U.firstChild, X = K.firstChild, G = X.firstChild;
            return l.$$click = c, F(f, I(ew, {})), F(h, ()=>ipt(t.transaction.timestamp)), F(m, ()=>bT(t.transaction.hash)), F(k, I(ote, {})), F(A, o), F(P, ()=>bT(t.transaction.hash)), F(X, I(lg, {
                get tone () {
                    return i().tone;
                },
                variant: "color",
                size: "sm",
                class: "uppercase tracking-wide",
                get children () {
                    return i().label;
                }
            }), G), F(G, I(blt, {})), F(K, I(_r, {
                get each () {
                    return r().filter((ce)=>ce.net !== 0n);
                },
                children: (ce)=>{
                    const ie = ce.net > 0n, Y = ie ? ce.net : -ce.net, M = ce.tokenType === "" || ce.tokenType === "0000000000000000000000000000000000000000000000000000000000000000", g = M ? "NIGHT" : ce.tokenType.length > 8 ? ce.tokenType.slice(0, 8) + "..." : ce.tokenType, y = _te(e(Y, 4, M ? void 0 : ce.tokenType));
                    return (()=>{
                        var C = wte(), R = C.firstChild;
                        return Vt(C, `whitespace-nowrap text-[10px] font-mono ${ie ? "text-[var(--fg-success-secondary)]" : "text-[var(--fg-error-secondary)]"}`), F(C, ie ? "+" : "-", R), F(C, y, R), F(C, g, null), C;
                    })();
                }
            }), null), F(K, I(de, {
                get when () {
                    return Ze(()=>t.transaction.fees != null)() && t.transaction.fees > 0n;
                },
                get children () {
                    var ce = $ft(), ie = ce.firstChild, Y = ie.nextSibling;
                    return F(ie, I(Dc, {
                        kind: "symbol",
                        class: "h-full w-full"
                    })), F(Y, ()=>opt(t.transaction.fees)), ce;
                }
            }), null), pt((ce)=>{
                var ie = t.transaction.hash, Y = t.transaction.hash;
                return ie !== ce.e && Ot(m, "title", ce.e = ie), Y !== ce.t && Ot(P, "title", ce.t = Y), ce;
            }, {
                e: void 0,
                t: void 0
            }), l;
        })();
    }, upt = ()=>{
        const { paginatedTransactions: t, totalTransactions: e, currentPage: n, totalPages: r, setCurrentPage: s, pendingTransactions: i } = lr(), o = Ct(()=>i().filter((l)=>l.type === "dapp" || l.chain === "cardano")), a = Ct(()=>i().filter((l)=>l.chain !== "cardano" && l.type !== "dapp" && (l.status === "submitting" || l.status === "pending" || l.status === "failed"))), c = Ct(()=>{
            const l = [
                ...o().map((u)=>({
                        kind: "pending",
                        data: u,
                        time: u.createdAt
                    })),
                ...a().map((u)=>({
                        kind: "pending",
                        data: u,
                        time: u.createdAt
                    })),
                ...t().map((u)=>({
                        kind: "sdk",
                        data: u,
                        time: u.timestamp.getTime()
                    }))
            ];
            return l.sort((u, d)=>d.time - u.time), l;
        });
        return (()=>{
            var l = Zft(), u = l.firstChild, d = u.firstChild, f = d.firstChild, p = f.nextSibling;
            return F(p, I(de, {
                get when () {
                    return c().length > 0;
                },
                get fallback () {
                    return (()=>{
                        var h = Jft(), m = h.firstChild, w = m.firstChild, v = w.firstChild;
                        return F(v, I(ew, {})), h;
                    })();
                },
                get children () {
                    return I(_r, {
                        get each () {
                            return c();
                        },
                        children: (h)=>h.kind === "pending" ? I(cpt, {
                                get transaction () {
                                    return h.data;
                                }
                            }) : I(lpt, {
                                get transaction () {
                                    return h.data;
                                }
                            })
                    });
                }
            })), F(u, I(de, {
                get when () {
                    return r() > 1;
                },
                get children () {
                    var h = Gft(), m = h.firstChild, w = m.firstChild, v = w.nextSibling;
                    return v.nextSibling, F(m, n, v), F(m, r, null), F(h, I(Bft, {
                        get count () {
                            return r();
                        },
                        get page () {
                            return n();
                        },
                        onPageChange: s,
                        itemComponent: (k)=>I(Fft, {
                                get page () {
                                    return k.page;
                                },
                                get children () {
                                    return k.page;
                                }
                            }),
                        ellipsisComponent: ()=>I(Lft, {}),
                        siblingCount: 1,
                        fixedItems: !0,
                        class: "mx-0 w-auto",
                        get children () {
                            return [
                                I(zft, {}),
                                I(Dft, {}),
                                I(Uft, {})
                            ];
                        }
                    }), null), h;
                }
            }), null), l;
        })();
    };
    Pi([
        "click"
    ]);
    var dpt = Q("<option>"), fpt = Q("<div aria-hidden=true><input type=text style=font-size:16px><select tabindex=-1><option>");
    function ppt(t) {
        let e;
        const [n, r] = rt(t, [
            "ref",
            "onChange",
            "collection",
            "selectionManager",
            "isOpen",
            "isMultiple",
            "isVirtualized",
            "focusTrigger"
        ]), s = Zd(), [i, o] = pe(!1), a = (c)=>{
            const l = n.collection.getItem(c);
            return I(de, {
                get when () {
                    return l?.type === "item";
                },
                get children () {
                    var u = dpt();
                    return u.value = c, F(u, ()=>l?.textValue), pt(()=>u.selected = n.selectionManager.isSelected(c)), u;
                }
            });
        };
        return lt(Ji(()=>n.selectionManager.selectedKeys(), (c, l)=>{
            l && pee(c, l) || (o(!0), e?.dispatchEvent(new Event("input", {
                bubbles: !0,
                cancelable: !0
            })), e?.dispatchEvent(new Event("change", {
                bubbles: !0,
                cancelable: !0
            })));
        }, {
            defer: !0
        })), (()=>{
            var c = fpt(), l = c.firstChild, u = l.nextSibling;
            u.firstChild, l.addEventListener("focus", ()=>n.focusTrigger()), u.addEventListener("change", (f)=>{
                $n(f, n.onChange), i() || n.selectionManager.setSelectedKeys(new Set([
                    f.target.value
                ])), o(!1);
            });
            var d = yr((f)=>e = f, n.ref);
            return typeof d == "function" && H7(d, u), Kx(u, qe({
                get multiple () {
                    return n.isMultiple;
                },
                get name () {
                    return s.name();
                },
                get required () {
                    return s.isRequired();
                },
                get disabled () {
                    return s.isDisabled();
                },
                get size () {
                    return n.collection.getSize();
                },
                get value () {
                    return n.selectionManager.firstSelectedKey() ?? "";
                }
            }, r), !1, !0), F(u, I(de, {
                get when () {
                    return n.isVirtualized;
                },
                get fallback () {
                    return I(_r, {
                        get each () {
                            return [
                                ...n.collection.getKeys()
                            ];
                        },
                        children: a
                    });
                },
                get children () {
                    return I(_r, {
                        get each () {
                            return [
                                ...n.selectionManager.selectedKeys()
                            ];
                        },
                        children: a
                    });
                }
            }), null), pt((f)=>{
                var p = sH, h = n.selectionManager.isFocused() || n.isOpen ? -1 : 0, m = s.isRequired(), w = s.isDisabled(), v = s.isReadOnly();
                return f.e = aU(c, p, f.e), h !== f.t && Ot(l, "tabindex", f.t = h), m !== f.a && (l.required = f.a = m), w !== f.o && (l.disabled = f.o = w), v !== f.i && (l.readOnly = f.i = v), f;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0
            }), c;
        })();
    }
    var Kz = new WeakMap;
    function hpt(t) {
        let e = Kz.get(t);
        if (e != null) return e;
        e = 0;
        for (const n of t)n.type === "item" && e++;
        return Kz.set(t, e), e;
    }
    var gpt = {};
    bu(gpt, {
        Item: ()=>ow,
        ItemDescription: ()=>V9,
        ItemIndicator: ()=>aw,
        ItemLabel: ()=>cw,
        Listbox: ()=>bpt,
        Root: ()=>kO,
        Section: ()=>D9,
        useListboxContext: ()=>vte
    });
    var xte = ds();
    function vte() {
        const t = fs(xte);
        if (t === void 0) throw new Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");
        return t;
    }
    var Ste = ds();
    function SO() {
        const t = fs(Ste);
        if (t === void 0) throw new Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");
        return t;
    }
    function ow(t) {
        let e;
        const n = vte(), r = `${n.generateId("item")}-${ii()}`, s = qt({
            id: r
        }, t), [i, o] = rt(s, [
            "ref",
            "item",
            "aria-label",
            "aria-labelledby",
            "aria-describedby",
            "onPointerMove",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]), [a, c] = pe(), [l, u] = pe(), d = ()=>n.listState().selectionManager(), f = ()=>d().focusedKey() === i.item.key, p = S9({
            key: ()=>i.item.key,
            selectionManager: d,
            shouldSelectOnPressUp: n.shouldSelectOnPressUp,
            allowsDifferentPressOrigin: ()=>n.shouldSelectOnPressUp() && n.shouldFocusOnHover(),
            shouldUseVirtualFocus: n.shouldUseVirtualFocus,
            disabled: ()=>i.item.disabled
        }, ()=>e), h = ()=>{
            if (d().selectionMode() !== "none") return p.isSelected();
        }, m = Ct(()=>!(Uy() && QU())), w = ()=>m() ? i["aria-label"] : void 0, v = ()=>m() ? a() : void 0, k = ()=>m() ? l() : void 0, _ = ()=>{
            if (!n.isVirtualized()) return;
            const X = n.listState().collection().getItem(i.item.key)?.index;
            return X != null ? X + 1 : void 0;
        }, A = ()=>{
            if (n.isVirtualized()) return hpt(n.listState().collection());
        }, P = (X)=>{
            $n(X, i.onPointerMove), X.pointerType === "mouse" && !p.isDisabled() && n.shouldFocusOnHover() && (jr(X.currentTarget), d().setFocused(!0), d().setFocusedKey(i.item.key));
        }, U = Ct(()=>({
                "data-disabled": p.isDisabled() ? "" : void 0,
                "data-selected": p.isSelected() ? "" : void 0,
                "data-highlighted": f() ? "" : void 0
            })), K = {
            isSelected: p.isSelected,
            dataset: U,
            generateId: gu(()=>o.id),
            registerLabelId: $s(c),
            registerDescriptionId: $s(u)
        };
        return I(Ste.Provider, {
            value: K,
            get children () {
                return I(yn, qe({
                    as: "li",
                    ref (X) {
                        var G = yr((ce)=>e = ce, i.ref);
                        typeof G == "function" && G(X);
                    },
                    role: "option",
                    get tabIndex () {
                        return p.tabIndex();
                    },
                    get "aria-disabled" () {
                        return p.isDisabled();
                    },
                    get "aria-selected" () {
                        return h();
                    },
                    get "aria-label" () {
                        return w();
                    },
                    get "aria-labelledby" () {
                        return v();
                    },
                    get "aria-describedby" () {
                        return k();
                    },
                    get "aria-posinset" () {
                        return _();
                    },
                    get "aria-setsize" () {
                        return A();
                    },
                    get "data-key" () {
                        return p.dataKey();
                    },
                    get onPointerDown () {
                        return Yt([
                            i.onPointerDown,
                            p.onPointerDown
                        ]);
                    },
                    get onPointerUp () {
                        return Yt([
                            i.onPointerUp,
                            p.onPointerUp
                        ]);
                    },
                    get onClick () {
                        return Yt([
                            i.onClick,
                            p.onClick
                        ]);
                    },
                    get onKeyDown () {
                        return Yt([
                            i.onKeyDown,
                            p.onKeyDown
                        ]);
                    },
                    get onMouseDown () {
                        return Yt([
                            i.onMouseDown,
                            p.onMouseDown
                        ]);
                    },
                    get onFocus () {
                        return Yt([
                            i.onFocus,
                            p.onFocus
                        ]);
                    },
                    onPointerMove: P
                }, U, o));
            }
        });
    }
    function V9(t) {
        const e = SO(), n = qt({
            id: e.generateId("description")
        }, t);
        return lt(()=>It(e.registerDescriptionId(n.id))), I(yn, qe({
            as: "div"
        }, ()=>e.dataset(), n));
    }
    function aw(t) {
        const e = SO(), n = qt({
            id: e.generateId("indicator")
        }, t), [r, s] = rt(n, [
            "forceMount"
        ]);
        return I(de, {
            get when () {
                return r.forceMount || e.isSelected();
            },
            get children () {
                return I(yn, qe({
                    as: "div",
                    "aria-hidden": "true"
                }, ()=>e.dataset(), s));
            }
        });
    }
    function cw(t) {
        const e = SO(), n = qt({
            id: e.generateId("label")
        }, t);
        return lt(()=>It(e.registerLabelId(n.id))), I(yn, qe({
            as: "div"
        }, ()=>e.dataset(), n));
    }
    function kO(t) {
        let e;
        const n = `listbox-${ii()}`, r = qt({
            id: n,
            selectionMode: "single",
            virtualized: !1
        }, t), [s, i] = rt(r, [
            "ref",
            "children",
            "renderItem",
            "renderSection",
            "value",
            "defaultValue",
            "onChange",
            "options",
            "optionValue",
            "optionTextValue",
            "optionDisabled",
            "optionGroupChildren",
            "state",
            "keyboardDelegate",
            "autoFocus",
            "selectionMode",
            "shouldFocusWrap",
            "shouldUseVirtualFocus",
            "shouldSelectOnPressUp",
            "shouldFocusOnHover",
            "allowDuplicateSelectionEvents",
            "disallowEmptySelection",
            "selectionBehavior",
            "selectOnFocus",
            "disallowTypeAhead",
            "allowsTabNavigation",
            "virtualized",
            "scrollToItem",
            "scrollRef",
            "onKeyDown",
            "onMouseDown",
            "onFocusIn",
            "onFocusOut"
        ]), o = Ct(()=>s.state ? s.state : k9({
                selectedKeys: ()=>s.value,
                defaultSelectedKeys: ()=>s.defaultValue,
                onSelectionChange: s.onChange,
                allowDuplicateSelectionEvents: ()=>Ae(s.allowDuplicateSelectionEvents),
                disallowEmptySelection: ()=>Ae(s.disallowEmptySelection),
                selectionBehavior: ()=>Ae(s.selectionBehavior),
                selectionMode: ()=>Ae(s.selectionMode),
                dataSource: ()=>s.options ?? [],
                getKey: ()=>s.optionValue,
                getTextValue: ()=>s.optionTextValue,
                getDisabled: ()=>s.optionDisabled,
                getSectionChildren: ()=>s.optionGroupChildren
            })), a = Vee({
            selectionManager: ()=>o().selectionManager(),
            collection: ()=>o().collection(),
            autoFocus: ()=>Ae(s.autoFocus),
            shouldFocusWrap: ()=>Ae(s.shouldFocusWrap),
            keyboardDelegate: ()=>s.keyboardDelegate,
            disallowEmptySelection: ()=>Ae(s.disallowEmptySelection),
            selectOnFocus: ()=>Ae(s.selectOnFocus),
            disallowTypeAhead: ()=>Ae(s.disallowTypeAhead),
            shouldUseVirtualFocus: ()=>Ae(s.shouldUseVirtualFocus),
            allowsTabNavigation: ()=>Ae(s.allowsTabNavigation),
            isVirtualized: ()=>s.virtualized,
            scrollToKey: ()=>s.scrollToItem
        }, ()=>e, ()=>s.scrollRef?.()), c = {
            listState: o,
            generateId: gu(()=>i.id),
            shouldUseVirtualFocus: ()=>r.shouldUseVirtualFocus,
            shouldSelectOnPressUp: ()=>r.shouldSelectOnPressUp,
            shouldFocusOnHover: ()=>r.shouldFocusOnHover,
            isVirtualized: ()=>s.virtualized
        };
        return I(xte.Provider, {
            value: c,
            get children () {
                return I(yn, qe({
                    as: "ul",
                    ref (l) {
                        var u = yr((d)=>e = d, s.ref);
                        typeof u == "function" && u(l);
                    },
                    role: "listbox",
                    get tabIndex () {
                        return a.tabIndex();
                    },
                    get "aria-multiselectable" () {
                        return o().selectionManager().selectionMode() === "multiple" ? !0 : void 0;
                    },
                    get onKeyDown () {
                        return Yt([
                            s.onKeyDown,
                            a.onKeyDown
                        ]);
                    },
                    get onMouseDown () {
                        return Yt([
                            s.onMouseDown,
                            a.onMouseDown
                        ]);
                    },
                    get onFocusIn () {
                        return Yt([
                            s.onFocusIn,
                            a.onFocusIn
                        ]);
                    },
                    get onFocusOut () {
                        return Yt([
                            s.onFocusOut,
                            a.onFocusOut
                        ]);
                    }
                }, i, {
                    get children () {
                        return I(de, {
                            get when () {
                                return !s.virtualized;
                            },
                            get fallback () {
                                return s.children?.(o().collection);
                            },
                            get children () {
                                return I(bse, {
                                    get each () {
                                        return [
                                            ...o().collection()
                                        ];
                                    },
                                    by: "key",
                                    children: (l)=>I(TT, {
                                            get children () {
                                                return [
                                                    I(td, {
                                                        get when () {
                                                            return l().type === "section";
                                                        },
                                                        get children () {
                                                            return s.renderSection?.(l());
                                                        }
                                                    }),
                                                    I(td, {
                                                        get when () {
                                                            return l().type === "item";
                                                        },
                                                        get children () {
                                                            return s.renderItem?.(l());
                                                        }
                                                    })
                                                ];
                                            }
                                        })
                                });
                            }
                        });
                    }
                }));
            }
        });
    }
    function D9(t) {
        return I(yn, qe({
            as: "li",
            role: "presentation"
        }, t));
    }
    var bpt = Object.assign(kO, {
        Item: ow,
        ItemDescription: V9,
        ItemIndicator: aw,
        ItemLabel: cw,
        Section: D9
    }), mpt = {};
    bu(mpt, {
        Arrow: ()=>Q1,
        Content: ()=>TO,
        Description: ()=>_9,
        ErrorMessage: ()=>v9,
        HiddenSelect: ()=>Tte,
        Icon: ()=>CO,
        Item: ()=>ow,
        ItemDescription: ()=>V9,
        ItemIndicator: ()=>aw,
        ItemLabel: ()=>cw,
        Label: ()=>Cte,
        Listbox: ()=>EO,
        Portal: ()=>IO,
        Root: ()=>AO,
        Section: ()=>D9,
        Select: ()=>_pt,
        Trigger: ()=>PO,
        Value: ()=>OO,
        useSelectContext: ()=>Au
    });
    var kte = ds();
    function Au() {
        const t = fs(kte);
        if (t === void 0) throw new Error("[kobalte]: `useSelectContext` must be used within a `Select` component");
        return t;
    }
    function TO(t) {
        let e;
        const n = Au(), [r, s] = rt(t, [
            "ref",
            "style",
            "onCloseAutoFocus",
            "onFocusOutside"
        ]), i = (a)=>{
            n.close();
        }, o = (a)=>{
            r.onFocusOutside?.(a), n.isOpen() && n.isModal() && a.preventDefault();
        };
        return JP({
            isDisabled: ()=>!(n.isOpen() && n.isModal()),
            targets: ()=>e ? [
                    e
                ] : []
        }), QP({
            element: ()=>e ?? null,
            enabled: ()=>n.contentPresent() && n.preventScroll()
        }), ZP({
            trapFocus: ()=>n.isOpen() && n.isModal(),
            onMountAutoFocus: (a)=>{
                a.preventDefault();
            },
            onUnmountAutoFocus: (a)=>{
                r.onCloseAutoFocus?.(a), a.defaultPrevented || (jr(n.triggerRef()), a.preventDefault());
            }
        }, ()=>e), I(de, {
            get when () {
                return n.contentPresent();
            },
            get children () {
                return I(A9.Positioner, {
                    get children () {
                        return I(YP, qe({
                            ref (a) {
                                var c = yr((l)=>{
                                    n.setContentRef(l), e = l;
                                }, r.ref);
                                typeof c == "function" && c(a);
                            },
                            get disableOutsidePointerEvents () {
                                return Ze(()=>!!n.isModal())() && n.isOpen();
                            },
                            get excludedElements () {
                                return [
                                    n.triggerRef
                                ];
                            },
                            get style () {
                                return hg({
                                    "--kb-select-content-transform-origin": "var(--kb-popper-content-transform-origin)",
                                    position: "relative"
                                }, r.style);
                            },
                            onEscapeKeyDown: i,
                            onFocusOutside: o,
                            get onDismiss () {
                                return n.close;
                            }
                        }, ()=>n.dataset(), s));
                    }
                });
            }
        });
    }
    function Tte(t) {
        const e = Au();
        return I(ppt, qe({
            get collection () {
                return e.listState().collection();
            },
            get selectionManager () {
                return e.listState().selectionManager();
            },
            get isOpen () {
                return e.isOpen();
            },
            get isMultiple () {
                return e.isMultiple();
            },
            get isVirtualized () {
                return e.isVirtualized();
            },
            focusTrigger: ()=>e.triggerRef()?.focus()
        }, t));
    }
    function CO(t) {
        const e = Au(), n = qt({
            children: "▼"
        }, t);
        return I(yn, qe({
            as: "span",
            "aria-hidden": "true"
        }, ()=>e.dataset(), n));
    }
    function Cte(t) {
        const e = Au(), [n, r] = rt(t, [
            "onClick"
        ]);
        return I(x9, qe({
            as: "span",
            onClick: (i)=>{
                $n(i, n.onClick), e.isDisabled() || e.triggerRef()?.focus();
            }
        }, r));
    }
    function EO(t) {
        const e = Au(), n = qt({
            id: e.generateId("listbox")
        }, t), [r, s] = rt(n, [
            "ref",
            "id",
            "onKeyDown"
        ]);
        return lt(()=>It(e.registerListboxId(r.id))), I(kO, qe({
            ref (o) {
                var a = yr(e.setListboxRef, r.ref);
                typeof a == "function" && a(o);
            },
            get id () {
                return r.id;
            },
            get state () {
                return e.listState();
            },
            get virtualized () {
                return e.isVirtualized();
            },
            get autoFocus () {
                return e.autoFocus();
            },
            shouldSelectOnPressUp: !0,
            shouldFocusOnHover: !0,
            get shouldFocusWrap () {
                return e.shouldFocusWrap();
            },
            get disallowTypeAhead () {
                return e.disallowTypeAhead();
            },
            get "aria-labelledby" () {
                return e.listboxAriaLabelledBy();
            },
            get renderItem () {
                return e.renderItem;
            },
            get renderSection () {
                return e.renderSection;
            },
            onKeyDown: (o)=>{
                $n(o, r.onKeyDown), o.key === "Escape" && o.preventDefault();
            }
        }, s));
    }
    function IO(t) {
        const e = Au();
        return I(de, {
            get when () {
                return e.contentPresent();
            },
            get children () {
                return I(kT, t);
            }
        });
    }
    function ypt(t) {
        const e = `select-${ii()}`, n = qt({
            id: e,
            selectionMode: "single",
            disallowEmptySelection: !1,
            closeOnSelection: t.selectionMode === "single",
            allowDuplicateSelectionEvents: !0,
            gutter: 8,
            sameWidth: !0,
            modal: !1
        }, t), [r, s, i, o] = rt(n, [
            "itemComponent",
            "sectionComponent",
            "open",
            "defaultOpen",
            "onOpenChange",
            "value",
            "defaultValue",
            "onChange",
            "placeholder",
            "options",
            "optionValue",
            "optionTextValue",
            "optionDisabled",
            "optionGroupChildren",
            "keyboardDelegate",
            "allowDuplicateSelectionEvents",
            "disallowEmptySelection",
            "closeOnSelection",
            "disallowTypeAhead",
            "shouldFocusWrap",
            "selectionBehavior",
            "selectionMode",
            "virtualized",
            "modal",
            "preventScroll",
            "forceMount"
        ], [
            "getAnchorRect",
            "placement",
            "gutter",
            "shift",
            "flip",
            "slide",
            "overlap",
            "sameWidth",
            "fitViewport",
            "hideWhenDetached",
            "detachedPadding",
            "arrowPadding",
            "overflowPadding"
        ], qQ), [a, c] = pe(), [l, u] = pe(), [d, f] = pe(), [p, h] = pe(), [m, w] = pe(), [v, k] = pe(), [_, A] = pe(), [P, U] = pe(!0), K = (te)=>{
            const J = r.optionValue;
            return J == null ? String(te) : String(UT(J) ? J(te) : te[J]);
        }, X = Ct(()=>{
            const te = r.optionGroupChildren;
            return te == null ? r.options : r.options.flatMap((J)=>J[te] ?? J);
        }), G = Ct(()=>X().map((te)=>K(te))), ce = (te)=>[
                ...te
            ].map((J)=>X().find((se)=>K(se) === J)).filter((J)=>J != null), ie = P9({
            open: ()=>r.open,
            defaultOpen: ()=>r.defaultOpen,
            onOpenChange: (te)=>r.onOpenChange?.(te)
        }), Y = k9({
            selectedKeys: ()=>r.value != null ? r.value.map(K) : r.value,
            defaultSelectedKeys: ()=>r.defaultValue != null ? r.defaultValue.map(K) : r.defaultValue,
            onSelectionChange: (te)=>{
                r.onChange?.(ce(te)), r.closeOnSelection && N();
            },
            allowDuplicateSelectionEvents: ()=>Ae(r.allowDuplicateSelectionEvents),
            disallowEmptySelection: ()=>Ae(r.disallowEmptySelection),
            selectionBehavior: ()=>Ae(r.selectionBehavior),
            selectionMode: ()=>r.selectionMode,
            dataSource: ()=>r.options ?? [],
            getKey: ()=>r.optionValue,
            getTextValue: ()=>r.optionTextValue,
            getDisabled: ()=>r.optionDisabled,
            getSectionChildren: ()=>r.optionGroupChildren
        }), M = Ct(()=>ce(Y.selectionManager().selectedKeys())), g = (te)=>{
            Y.selectionManager().toggleSelection(K(te));
        }, { present: y } = Ny({
            show: ()=>r.forceMount || ie.isOpen(),
            element: ()=>m() ?? null
        }), C = ()=>{
            const te = v();
            te && jr(te);
        }, R = (te)=>{
            if (r.options.length <= 0) return;
            U(te), ie.open();
            let J = Y.selectionManager().firstSelectedKey();
            J == null && (te === "first" ? J = Y.collection().getFirstKey() : te === "last" && (J = Y.collection().getLastKey())), C(), Y.selectionManager().setFocused(!0), Y.selectionManager().setFocusedKey(J);
        }, N = ()=>{
            ie.close(), Y.selectionManager().setFocused(!1), Y.selectionManager().setFocusedKey(void 0);
        }, L = (te)=>{
            ie.isOpen() ? N() : R(te);
        }, { formControlContext: z } = WQ(i);
        KQ(p, ()=>{
            const te = r.defaultValue ? [
                ...r.defaultValue
            ].map(K) : new vc;
            Y.selectionManager().setSelectedKeys(te);
        });
        const B = uee({
            usage: "search",
            sensitivity: "base"
        }), x = Ct(()=>{
            const te = Ae(r.keyboardDelegate);
            return te || new Nee(Y.collection, void 0, B);
        }), O = (te)=>r.itemComponent?.({
                item: te
            }), q = (te)=>r.sectionComponent?.({
                section: te
            });
        lt(Ji([
            G
        ], ([te])=>{
            const se = [
                ...Y.selectionManager().selectedKeys()
            ].filter((fe)=>te.includes(fe));
            Y.selectionManager().setSelectedKeys(se);
        }, {
            defer: !0
        }));
        const H = Ct(()=>({
                "data-expanded": ie.isOpen() ? "" : void 0,
                "data-closed": ie.isOpen() ? void 0 : ""
            })), Z = {
            dataset: H,
            isOpen: ie.isOpen,
            isDisabled: ()=>z.isDisabled() ?? !1,
            isMultiple: ()=>Ae(r.selectionMode) === "multiple",
            isVirtualized: ()=>r.virtualized ?? !1,
            isModal: ()=>r.modal ?? !1,
            preventScroll: ()=>r.preventScroll ?? Z.isModal(),
            disallowTypeAhead: ()=>r.disallowTypeAhead ?? !1,
            shouldFocusWrap: ()=>r.shouldFocusWrap ?? !1,
            selectedOptions: M,
            contentPresent: y,
            autoFocus: P,
            triggerRef: p,
            listState: ()=>Y,
            keyboardDelegate: x,
            triggerId: a,
            valueId: l,
            listboxId: d,
            listboxAriaLabelledBy: _,
            setListboxAriaLabelledBy: A,
            setTriggerRef: h,
            setContentRef: w,
            setListboxRef: k,
            open: R,
            close: N,
            toggle: L,
            placeholder: ()=>r.placeholder,
            renderItem: O,
            renderSection: q,
            removeOptionFromSelection: g,
            generateId: gu(()=>Ae(i.id)),
            registerTriggerId: $s(c),
            registerValueId: $s(u),
            registerListboxId: $s(f)
        };
        return I(OP.Provider, {
            value: z,
            get children () {
                return I(kte.Provider, {
                    value: Z,
                    get children () {
                        return I(A9, qe({
                            anchorRef: p,
                            contentRef: m
                        }, s, {
                            get children () {
                                return I(yn, qe({
                                    as: "div",
                                    role: "group",
                                    get id () {
                                        return Ae(i.id);
                                    }
                                }, ()=>z.dataset(), H, o));
                            }
                        }));
                    }
                });
            }
        });
    }
    function AO(t) {
        const [e, n] = rt(t, [
            "value",
            "defaultValue",
            "onChange",
            "multiple"
        ]), r = Ct(()=>e.value != null ? e.multiple ? e.value : [
                e.value
            ] : e.value), s = Ct(()=>e.defaultValue != null ? e.multiple ? e.defaultValue : [
                e.defaultValue
            ] : e.defaultValue);
        return I(ypt, qe({
            get value () {
                return r();
            },
            get defaultValue () {
                return s();
            },
            onChange: (o)=>{
                e.multiple ? e.onChange?.(o ?? []) : e.onChange?.(o[0] ?? null);
            },
            get selectionMode () {
                return e.multiple ? "multiple" : "single";
            }
        }, n));
    }
    function PO(t) {
        const e = Zd(), n = Au(), r = qt({
            id: n.generateId("trigger")
        }, t), [s, i, o] = rt(r, [
            "ref",
            "disabled",
            "onPointerDown",
            "onClick",
            "onKeyDown",
            "onFocus",
            "onBlur"
        ], XQ), a = ()=>n.listState().selectionManager(), c = ()=>n.keyboardDelegate(), l = ()=>s.disabled || n.isDisabled(), { fieldProps: u } = GQ(i), { typeSelectHandlers: d } = hee({
            keyboardDelegate: c,
            selectionManager: a,
            onTypeSelect: (k)=>a().select(k)
        }), f = ()=>[
                n.listboxAriaLabelledBy(),
                n.valueId()
            ].filter(Boolean).join(" ") || void 0, p = (k)=>{
            $n(k, s.onPointerDown), k.currentTarget.dataset.pointerType = k.pointerType, !l() && k.pointerType !== "touch" && k.button === 0 && (k.preventDefault(), n.toggle(!0));
        }, h = (k)=>{
            $n(k, s.onClick), !l() && k.currentTarget.dataset.pointerType === "touch" && n.toggle(!0);
        }, m = (k)=>{
            if ($n(k, s.onKeyDown), !l()) switch($n(k, d.onKeyDown), k.key){
                case "Enter":
                case " ":
                case "ArrowDown":
                    k.stopPropagation(), k.preventDefault(), n.toggle("first");
                    break;
                case "ArrowUp":
                    k.stopPropagation(), k.preventDefault(), n.toggle("last");
                    break;
                case "ArrowLeft":
                    {
                        if (k.preventDefault(), n.isMultiple()) return;
                        const _ = a().firstSelectedKey(), A = _ != null ? c().getKeyAbove?.(_) : c().getFirstKey?.();
                        A != null && a().select(A);
                        break;
                    }
                case "ArrowRight":
                    {
                        if (k.preventDefault(), n.isMultiple()) return;
                        const _ = a().firstSelectedKey(), A = _ != null ? c().getKeyBelow?.(_) : c().getFirstKey?.();
                        A != null && a().select(A);
                        break;
                    }
            }
        }, w = (k)=>{
            $n(k, s.onFocus), !a().isFocused() && a().setFocused(!0);
        }, v = (k)=>{
            $n(k, s.onBlur), !n.isOpen() && a().setFocused(!1);
        };
        return lt(()=>It(n.registerTriggerId(u.id()))), lt(()=>{
            n.setListboxAriaLabelledBy([
                u.ariaLabelledBy(),
                u.ariaLabel() && !u.ariaLabelledBy() ? u.id() : null
            ].filter(Boolean).join(" ") || void 0);
        }), I(jc, qe({
            ref (k) {
                var _ = yr(n.setTriggerRef, s.ref);
                typeof _ == "function" && _(k);
            },
            get id () {
                return u.id();
            },
            get disabled () {
                return l();
            },
            "aria-haspopup": "listbox",
            get "aria-expanded" () {
                return n.isOpen();
            },
            get "aria-controls" () {
                return Ze(()=>!!n.isOpen())() ? n.listboxId() : void 0;
            },
            get "aria-label" () {
                return u.ariaLabel();
            },
            get "aria-labelledby" () {
                return f();
            },
            get "aria-describedby" () {
                return u.ariaDescribedBy();
            },
            onPointerDown: p,
            onClick: h,
            onKeyDown: m,
            onFocus: w,
            onBlur: v
        }, ()=>n.dataset(), ()=>e.dataset(), o));
    }
    function OO(t) {
        const e = Zd(), n = Au(), r = qt({
            id: n.generateId("value")
        }, t), [s, i] = rt(r, [
            "id",
            "children"
        ]), o = ()=>n.listState().selectionManager(), a = ()=>{
            const c = o().selectedKeys();
            return c.size === 1 && c.has("") ? !0 : o().isEmpty();
        };
        return lt(()=>It(n.registerValueId(s.id))), I(yn, qe({
            as: "span",
            get id () {
                return s.id;
            },
            get "data-placeholder-shown" () {
                return a() ? "" : void 0;
            }
        }, ()=>e.dataset(), i, {
            get children () {
                return I(de, {
                    get when () {
                        return !a();
                    },
                    get fallback () {
                        return n.placeholder();
                    },
                    get children () {
                        return I(wpt, {
                            state: {
                                selectedOption: ()=>n.selectedOptions()[0],
                                selectedOptions: ()=>n.selectedOptions(),
                                remove: (c)=>n.removeOptionFromSelection(c),
                                clear: ()=>o().clearSelection()
                            },
                            get children () {
                                return s.children;
                            }
                        });
                    }
                });
            }
        }));
    }
    function wpt(t) {
        const e = $te(()=>{
            const n = t.children;
            return UT(n) ? n(t.state) : n;
        });
        return Ze(e);
    }
    var _pt = Object.assign(AO, {
        Arrow: Q1,
        Content: TO,
        Description: _9,
        ErrorMessage: v9,
        HiddenSelect: Tte,
        Icon: CO,
        Item: ow,
        ItemDescription: V9,
        ItemIndicator: aw,
        ItemLabel: cw,
        Label: Cte,
        Listbox: EO,
        Portal: IO,
        Section: D9,
        Trigger: PO,
        Value: OO
    }), xpt = Q('<svg><path d="M8 9l4 -4l4 4"></svg>', !1, !0, !1), vpt = Q('<svg><path d="M16 15l-4 4l-4 -4"></svg>', !1, !0, !1), Spt = Q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path stroke=none d="M0 0h24v24H0z"fill=none></path><path d="M5 12l5 5l10 -10">');
    const kpt = AO, Tpt = OO, Cpt = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "children"
        ]);
        return I(PO, qe({
            get class () {
                return xn("flex h-[40px] w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 type-text-sm uppercase ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-[1px] focus:ring-ring focus:ring-offset-[1px] disabled:cursor-not-allowed disabled:opacity-50", e.class);
            }
        }, n, {
            get children () {
                return [
                    Ze(()=>e.children),
                    I(CO, {
                        as: "svg",
                        xmlns: "http://www.w3.org/2000/svg",
                        viewBox: "0 0 24 24",
                        fill: "none",
                        stroke: "currentColor",
                        "stroke-width": "2",
                        "stroke-linecap": "round",
                        "stroke-linejoin": "round",
                        class: "size-4 opacity-50",
                        get children () {
                            return [
                                xpt(),
                                vpt()
                            ];
                        }
                    })
                ];
            }
        }));
    }, Ept = (t)=>{
        const [e, n] = rt(t, [
            "class"
        ]);
        return I(IO, {
            get children () {
                return I(TO, qe({
                    get class () {
                        return xn("relative z-50 font-sans min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80", e.class);
                    }
                }, n, {
                    get children () {
                        return I(EO, {
                            class: "m-0 p-1"
                        });
                    }
                }));
            }
        });
    }, Ipt = (t)=>{
        const [e, n] = rt(t, [
            "class",
            "children"
        ]);
        return I(ow, qe({
            get class () {
                return xn("relative mt-0 flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 type-text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", e.class);
            }
        }, n, {
            get children () {
                return [
                    I(aw, {
                        class: "absolute right-2 flex size-3.5 items-center justify-center",
                        get children () {
                            return Spt();
                        }
                    }),
                    I(cw, {
                        get children () {
                            return e.children;
                        }
                    })
                ];
            }
        }));
    };
    var Apt = Q('<i class="icon-box w-6 h-6">'), Ppt = Q('<button title="Cardano L1"aria-label="Cardano L1"><img alt class="w-4 h-4 brightness-0 invert">CARDANO'), Opt = Q('<div class="flex flex-col gap-1.5 px-3 py-2 bg-muted rounded border border-border"><div class="flex items-center justify-between"><span class="text-xs text-content-muted">Cardano balance</span><span class="text-sm font-mono font-medium text-foreground"> ADA</span></div><div class="flex items-center justify-between"><span class="text-xs text-content-muted">Estimated network fee</span><span class="text-xs font-mono text-content-muted">'), Mpt = Q('<div class="bg-rose-500/10 border-l-[3px] border-rose-500 px-3 py-2"><p class="text-xs text-rose-600">Cardano token sends need ADA for both the required output and the network fee.'), Rpt = Q('<div class="bg-rose-500/10 text-rose-500 p-3 rounded-lg"><div class="max-h-32 overflow-auto whitespace-pre-wrap break-all text-xs leading-relaxed">'), Npt = Q('<a target=_blank rel="noopener noreferrer"class="shrink-0 text-[var(--fg-success-secondary)] hover:text-[var(--text-success-primary)] transition-colors"title="View on 1AM Explorer"aria-label="View on 1AM Explorer"><svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1=10 y1=14 x2=21 y2=3>'), Vpt = Q('<div class="flex items-center gap-2"><span class="text-xs font-mono text-[var(--text-success-primary)] opacity-80 truncate min-w-0"></span><button class="shrink-0 text-[var(--fg-success-secondary)] hover:text-[var(--text-success-primary)] transition-colors"title="Copy transaction hash"aria-label="Copy transaction hash"><svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=9 y=9 width=13 height=13 rx=2></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1">'), Dpt = Q('<div class="bg-[var(--bg-success-primary)] border border-[var(--border-success-subtle)] p-3 rounded-lg text-sm space-y-2"><div class="font-medium text-[var(--text-success-primary)]">Transaction submitted!'), Bpt = Q('<div class="flex items-center justify-center gap-2 py-2"><div class="w-3 h-3 border-2 border-content-muted-light border-t-transparent rounded-full animate-spin"></div><p class="text-xs text-content-muted-light">Syncing with the network... Please wait before sending.'), Fpt = Q('<div class="flex flex-col w-full h-full"><div><h2 class="text-2xl font-semibold text-header-foreground">SEND TOKEN</h2><div></div></div><div class="flex flex-row justify-center items-center h-[60px] p-[6px] gap-0 bg-bg-primary-solid border-b border-header-divider rounded-[8px] shrink-0"><button title="Shield on"aria-label="Shield on"><i class="icon-box w-4 h-4"></i>SHIELD ON</button><button title="Shield off"aria-label="Shield off"><i class="icon-box w-[14px] h-[14px]"></i>SHIELD OFF</button></div><div><div><div><section class="flex flex-col gap-1 p-4 bg-bg-primary-solid border-b border-header-divider rounded-[8px] shrink-0"><div class="flex flex-row items-center gap-[5px]"><i class="icon-box w-4 h-4 text-border"></i><span class="text-sm text-header-muted"></span><span class="text-[10px] text-header-muted/60 ml-auto truncate max-w-[140px]"> / </span></div><div class="text-[10px] font-mono text-header-muted/40 truncate"></div><div class="flex flex-row justify-between items-center gap-2 rounded-md"><div class="flex-1 min-w-0"><input type=number placeholder="ENTER AMOUNT"step=0.0001 inputmode=decimal aria-label=Amount></div><button class="flex items-center justify-center py-3 px-3 h-[40px] bg-header-divider rounded-md text-sm text-header-foreground hover:bg-header-divider/80 transition-colors shrink-0 uppercase"title="Use maximum amount"aria-label="Use maximum amount">MAX</button></div><div class="flex flex-row justify-between text-sm text-header-muted"><span>$0</span><span> </span></div></section><div class="flex flex-col justify-between flex-1 p-4 gap-6 bg-card rounded-tl-[8px] rounded-tr-[8px] rounded-bl-[4px] rounded-br-[4px] min-h-0 overflow-auto border-none"><div class="flex flex-col gap-5"><div class="flex flex-col gap-1.5 w-full"><label class="text-sm font-medium text-content-muted-dark">ASSET'), Lpt = Q('<div class="flex justify-between items-center gap-4 w-full"><span></span><span class="text-content-muted-light text-xs">'), zpt = Q('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full">');
    const Ete = "0000000000000000000000000000000000000000000000000000000000000000";
    function $z(t) {
        return t === "" || t === Ete ? "NIGHT" : t;
    }
    const Upt = (t)=>{
        const [e] = rt(t, [
            "edgeToEdge"
        ]), n = ()=>e.edgeToEdge === !0, { shieldedBalances: r, unshieldedBalances: s, sendTokens: i, sendCardanoTokens: o, formatBalance: a, isSynced: c, sendTokensError: l, sendTokensStatus: u, cardanoBalance: d, cardanoEnabled: f, environmentSettings: p, wallets: h, activeWalletId: m, activeAccountIndex: w, unshieldedAddress: v, shieldedAddress: k, cardanoAddress: _ } = lr(), A = ()=>fg(p().environment) && f(), [P, U] = pe(""), [K, X] = pe(""), [G, ce] = pe("unshielded"), [ie, Y] = pe(null), [M, g] = pe(!1), [y, C] = pe(null), [R, N] = pe(!1), [L, z] = pe(null), [B, x] = pe(null), [O, q] = pe(!1), [H, Z] = pe(null), [te, J] = pe(null), [se, fe] = pe(null), [ge, Ce] = pe(!1);
        let Ue;
        lt(()=>{
            const le = H();
            if (!le) return;
            const De = ()=>{
                document.body.style.setProperty("--send-token-select-width", `${le.offsetWidth}px`);
            };
            De();
            const Re = new ResizeObserver(De);
            Re.observe(le), It(()=>{
                Re.disconnect(), document.body.style.removeProperty("--send-token-select-width");
            });
        }), lt(()=>{
            const le = te();
            if (!le) return;
            const De = ()=>{
                fe(le.scrollHeight), Ce(!0);
            };
            De();
            const Re = new ResizeObserver(De);
            Re.observe(le), It(()=>{
                Re.disconnect();
            });
        }), It(()=>{
            Ue !== void 0 && window.cancelAnimationFrame(Ue);
        });
        const Ie = (le)=>{
            if (le === G()) return;
            const De = te();
            De && (Ce(!0), fe(De.scrollHeight)), ce(le), Y(le === "cardano" ? "cNIGHT" : null), Ue !== void 0 && window.cancelAnimationFrame(Ue), Ue = window.requestAnimationFrame(()=>{
                const Re = te();
                Re && fe(Re.scrollHeight), Ue = void 0;
            });
        }, Le = Ct(()=>{
            if (G() === "cardano") {
                const le = d(), De = [];
                return le && le.night > 0n && De.push({
                    rawType: "cNIGHT",
                    displayName: "NIGHT",
                    balance: le.night
                }), le && le.lovelace > 0n && De.push({
                    rawType: "ADA",
                    displayName: "ADA",
                    balance: le.lovelace
                }), De;
            }
            return G() === "shielded" ? Object.entries(r()).map(([le, De])=>({
                    rawType: le,
                    displayName: $z(le),
                    balance: De
                })) : [
                ...s().entries()
            ].map(([le, De])=>({
                    rawType: le,
                    displayName: $z(le),
                    balance: De
                }));
        }), Ge = ()=>Le().find((le)=>le.displayName === ie()), Ve = ()=>Ge()?.balance ?? 0n, Ne = (le)=>{
            const De = le.trim();
            if (!/^\d+(?:\.\d{0,6})?$/.test(De)) return null;
            const Re = De.split("."), ee = BigInt(Re[0] || "0") * 1000000n, oe = (Re[1] || "").slice(0, 6).padEnd(6, "0");
            return ee + BigInt(oe);
        };
        lt(()=>{
            if (G() !== "cardano") {
                x(null), q(!1);
                return;
            }
            const le = Ge(), De = _(), Re = P().trim(), ee = Ne(K());
            if (!le || !De || !Re || ee == null || ee <= 0n) {
                x(null), q(!1);
                return;
            }
            let oe = !1;
            const ye = window.setTimeout(async ()=>{
                q(!0);
                try {
                    const D = await Tne({
                        fromAddress: De,
                        toAddress: Re,
                        nightAmount: le.rawType === "ADA" ? 0n : ee,
                        adaAmount: le.rawType === "ADA" ? ee : void 0,
                        adaOnly: le.rawType === "ADA",
                        network: p().environment
                    });
                    oe || x(D);
                } catch  {
                    oe || x(null);
                } finally{
                    oe || q(!1);
                }
            }, 250);
            It(()=>{
                oe = !0, window.clearTimeout(ye);
            });
        });
        const be = ()=>{
            const le = Ge();
            if (le) {
                if (le.rawType === "cNIGHT" || le.rawType === "ADA") {
                    let De = le.balance;
                    if (le.rawType === "ADA") {
                        const oe = 500000n;
                        De = De > oe ? De - oe : 0n;
                    }
                    const Re = De / 1000000n, ee = (De % 1000000n).toString().padStart(6, "0").replace(/0+$/, "");
                    X(ee ? `${Re}.${ee}` : Re.toString());
                    return;
                }
                X(a(le.balance, 4, le.rawType));
            }
        }, Qe = async ()=>{
            if (C(null), !P() || !K() || !ie()) {
                C("Please fill in all fields");
                return;
            }
            const le = Ge();
            if (!le) {
                C("Please select an asset");
                return;
            }
            const De = G() === "cardano", Re = !De && (le.rawType === "" || le.rawType === Ete), ee = K().trim();
            if (!(Re || De ? /^\d+(?:\.\d{0,6})?$/ : /^\d+$/).test(ee)) {
                C(Re || De ? "Enter a valid amount with up to 6 decimals" : "Enter a whole-number token amount");
                return;
            }
            let ye;
            if (Re || De ? ye = Ne(ee) ?? 0n : ye = BigInt(ee || "0"), ye <= 0n) {
                C("Amount must be greater than 0");
                return;
            }
            if (ye > Ve()) {
                C("Insufficient balance");
                return;
            }
            g(!0), N(!1), z(null);
            try {
                if (De) {
                    const D = le.rawType === "ADA", S = await o({
                        toAddress: P(),
                        amount: ye,
                        asset: D ? "ADA" : "cNIGHT"
                    });
                    z(S);
                } else {
                    const D = await i(P(), ye, le.rawType, G());
                    z(D);
                }
                N(!0), U(""), X("");
            } catch (D) {
                const S = D instanceof Error ? D.message : "Failed to send tokens";
                C(S.includes("Decryption") ? "Wrong password" : S);
            } finally{
                g(!1);
            }
        };
        return (()=>{
            var le = Fpt(), De = le.firstChild, Re = De.firstChild, ee = Re.nextSibling, oe = De.nextSibling, ye = oe.firstChild, D = ye.firstChild, S = ye.nextSibling, E = S.firstChild, $ = oe.nextSibling, re = $.firstChild, ae = re.firstChild, me = ae.firstChild, Oe = me.firstChild, ut = Oe.firstChild, dt = ut.nextSibling, Ut = dt.nextSibling, at = Ut.firstChild, Qt = Oe.nextSibling, ci = Qt.nextSibling, Sn = ci.firstChild, Hn = Sn.firstChild, Qc = Sn.nextSibling, jn = ci.nextSibling, An = jn.firstChild, ya = An.nextSibling, ar = ya.firstChild, Ln = me.nextSibling, el = Ln.firstChild, Gn = el.firstChild;
            return Gn.firstChild, F(ee, I(tw, {
                class: "flex h-full w-full items-center justify-center text-icon-muted hover:text-header-foreground hover:bg-card/10 transition-colors outline-none cursor-pointer",
                title: "Close",
                "aria-label": "Close",
                get children () {
                    var _e = Apt();
                    return F(_e, I(cO, {})), _e;
                }
            })), ye.$$click = ()=>Ie("shielded"), F(D, I(Ep, {})), S.$$click = ()=>Ie("unshielded"), F(E, I(Ip, {})), F(oe, I(de, {
                get when () {
                    return A();
                },
                get children () {
                    var _e = Ppt(), an = _e.firstChild;
                    return _e.$$click = ()=>Ie("cardano"), Ot(an, "src", ab), pt(()=>Vt(_e, `flex flex-1 flex-row justify-center items-center py-2 px-3 gap-2 h-12 font-semibold text-sm transition-[background-color,color,border-radius] duration-[264ms] ease-[cubic-bezier(0.16,1,0.3,1)] ${G() === "cardano" ? "bg-[#0033AD] text-header-foreground rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`)), _e;
                }
            }), null), H7(J, re), F(ut, I(de, {
                get when () {
                    return G() === "shielded";
                },
                get fallback () {
                    return I(Ip, {});
                },
                get children () {
                    return I(Ep, {});
                }
            })), F(dt, (()=>{
                var _e = Ze(()=>G() === "shielded");
                return ()=>_e() ? "SHIELDED SEND" : G() === "cardano" ? "CARDANO SEND" : "UNSHIELDED SEND";
            })()), F(Ut, ()=>h().find((_e)=>_e.id === m())?.name || "Wallet", at), F(Ut, ()=>h().find((_e)=>_e.id === m())?.accounts.find((_e)=>_e.index === w())?.name || "Account 1", null), F(Qt, (()=>{
                var _e = Ze(()=>G() === "cardano");
                return ()=>_e() ? _() : Ze(()=>G() === "shielded")() ? k() : v();
            })()), Hn.$$input = (_e)=>X(_e.currentTarget.value), Qc.$$click = be, F(ya, ()=>a(Ve(), 4, Ge()?.rawType === "cNIGHT" || Ge()?.rawType === "ADA" ? void 0 : Ge()?.rawType), ar), F(ya, ()=>ie() || "—", null), H7(Z, Gn), F(Gn, I(kpt, {
                get value () {
                    return ie();
                },
                onChange: (_e)=>Y(_e || null),
                get options () {
                    return Le().map((_e)=>_e.displayName);
                },
                placeholder: "Select an asset",
                itemComponent: (_e)=>I(Ipt, {
                        get item () {
                            return _e.item;
                        },
                        get children () {
                            var an = Lpt(), kt = an.firstChild, je = kt.nextSibling;
                            return F(kt, ()=>_e.item.rawValue), F(je, ()=>{
                                const Lt = Le().find((hn)=>hn.displayName === _e.item.rawValue), pn = Lt?.rawType === "cNIGHT" || Lt?.rawType === "ADA" ? void 0 : Lt?.rawType;
                                return a(Lt?.balance ?? 0n, 4, pn);
                            }), an;
                        }
                    }),
                get children () {
                    return [
                        I(Cpt, {
                            class: "w-full h-[40px] px-3 border border-border rounded-none bg-card text-content-muted-light uppercase",
                            get children () {
                                return I(Tpt, {
                                    children: (_e)=>_e.selectedOption() || "SELECT AN ASSET"
                                });
                            }
                        }),
                        I(Ept, {
                            class: "w-[var(--send-token-select-width)] min-w-[var(--send-token-select-width)] max-w-[var(--send-token-select-width)]"
                        })
                    ];
                }
            }), null), F(el, I(og, {
                get value () {
                    return P();
                },
                onChange: U,
                get children () {
                    return [
                        I(YQ, {
                            class: "text-sm font-medium text-content-muted-dark",
                            children: "RECIPIENT"
                        }),
                        I(Vy, {
                            placeholder: "PASTE ADDRESS",
                            class: "h-11 px-3.5 border border-border rounded-none bg-card text-content-muted-light placeholder:text-content-muted-light"
                        })
                    ];
                }
            }), null), F(Ln, I(de, {
                get when () {
                    return G() === "cardano";
                },
                get children () {
                    return [
                        (()=>{
                            var _e = Opt(), an = _e.firstChild, kt = an.firstChild, je = kt.nextSibling, Lt = je.firstChild, pn = an.nextSibling, hn = pn.firstChild, nr = hn.nextSibling;
                            return F(je, ()=>j7(d()?.lovelace ?? 0n), Lt), F(nr, (()=>{
                                var gn = Ze(()=>!!O());
                                return ()=>gn() ? "Calculating..." : Ze(()=>B() != null)() ? `~${j7(B(), 4)} ADA` : "—";
                            })()), _e;
                        })(),
                        I(de, {
                            get when () {
                                return Ze(()=>Ge()?.rawType === "cNIGHT")() && (d()?.lovelace ?? 0n) < 1500000n;
                            },
                            get children () {
                                return Mpt();
                            }
                        })
                    ];
                }
            }), null), F(Ln, I(de, {
                get when () {
                    return y() || l();
                },
                get children () {
                    var _e = Rpt(), an = _e.firstChild;
                    return F(an, ()=>y() || l()), _e;
                }
            }), null), F(Ln, I(de, {
                get when () {
                    return R();
                },
                get children () {
                    var _e = Dpt();
                    return _e.firstChild, F(_e, I(de, {
                        get when () {
                            return L();
                        },
                        get children () {
                            var an = Vpt(), kt = an.firstChild, je = kt.nextSibling;
                            return F(kt, L), je.$$click = async ()=>{
                                try {
                                    await navigator.clipboard.writeText(L());
                                } catch  {}
                            }, F(an, I(de, {
                                get when () {
                                    return G() === "cardano";
                                },
                                get children () {
                                    var Lt = Npt();
                                    return pt(()=>Ot(Lt, "href", vT(ir[p().environment].explorerBaseUrl, L() || ""))), Lt;
                                }
                            }), null), an;
                        }
                    }), null), _e;
                }
            }), null), F(Ln, I($r, {
                variant: "submit",
                size: "submit",
                onClick: Qe,
                get disabled () {
                    return Ze(()=>G() !== "cardano")() && !c() || M() || !P() || !K() || !ie();
                },
                title: "Send",
                "aria-label": "Send",
                get children () {
                    return I(de, {
                        get when () {
                            return !M();
                        },
                        get fallback () {
                            return [
                                zpt(),
                                Ze(()=>u() || "Processing...")
                            ];
                        },
                        children: "SEND"
                    });
                }
            }), null), F(Ln, I(de, {
                get when () {
                    return !c();
                },
                get children () {
                    return Bpt();
                }
            }), null), pt((_e)=>{
                var an = xn("flex flex-row justify-between items-center h-16 pl-4 bg-bg-primary-solid shrink-0", !n() && "border-b border-header-divider rounded-tl-[4px] rounded-tr-[4px] rounded-bl-[8px] rounded-br-[8px]"), kt = xn("ml-auto flex w-16 h-16 shrink-0 items-center justify-center", !n() && "border-l border-header-divider"), je = `flex flex-1 flex-row justify-center items-center py-2 px-3 gap-2 h-12 font-semibold text-sm transition-[background-color,color,border-radius] duration-[264ms] ease-[cubic-bezier(0.16,1,0.3,1)] ${G() === "shielded" ? "bg-white text-black rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`, Lt = `flex flex-1 flex-row justify-center items-center py-2 px-3 gap-2 h-12 font-semibold text-sm transition-[background-color,color,border-radius] duration-[264ms] ease-[cubic-bezier(0.16,1,0.3,1)] ${G() === "unshielded" ? "bg-[#F04438] text-white rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`, pn = xn("overflow-hidden transition-[height] motion-reduce:transition-none", ge() && "duration-[264ms] ease-[cubic-bezier(0.16,1,0.3,1)]"), hn = ge() && se() !== null ? {
                    height: `${se()}px`
                } : void 0, nr = G() === "cardano" ? _() : G() === "shielded" ? k() : v(), gn = G() === "cardano" ? _() : G() === "shielded" ? k() : v(), Wt = xn("type-display-sm font-bold bg-transparent border-0 p-0 h-[40px] min-w-0 w-full appearance-none focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 placeholder:text-[var(--color-grey-dark-500)] focus:placeholder-transparent [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", K().trim().length > 0 ? "text-header-foreground" : "text-header-muted");
                return an !== _e.e && Vt(De, _e.e = an), kt !== _e.t && Vt(ee, _e.t = kt), je !== _e.a && Vt(ye, _e.a = je), Lt !== _e.o && Vt(S, _e.o = Lt), pn !== _e.i && Vt($, _e.i = pn), _e.n = aU($, hn, _e.n), nr !== _e.s && Ot(Ut, "title", _e.s = nr), gn !== _e.h && Ot(Qt, "title", _e.h = gn), Wt !== _e.r && Vt(Hn, _e.r = Wt), _e;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0,
                n: void 0,
                s: void 0,
                h: void 0,
                r: void 0
            }), pt(()=>Hn.value = K()), le;
        })();
    };
    Pi([
        "click",
        "input"
    ]);
    const Hpt = "/assets/midnight_onchain_runtime_wasm_bg-DwR8u1Y3.wasm";
    let ne;
    function jpt(t) {
        ne = t;
    }
    function Yd(t) {
        const e = ne.__externref_table_alloc();
        return ne.__wbindgen_export_2.set(e, t), e;
    }
    function Ro(t, e) {
        try {
            return t.apply(this, e);
        } catch (n) {
            const r = Yd(n);
            ne.__wbindgen_exn_store(r);
        }
    }
    let g_ = null;
    function Mm() {
        return (g_ === null || g_.byteLength === 0) && (g_ = new Uint8Array(ne.memory.buffer)), g_;
    }
    let Q_ = new TextDecoder("utf-8", {
        ignoreBOM: !0,
        fatal: !0
    });
    Q_.decode();
    const qpt = 2146435072;
    let k7 = 0;
    function Wpt(t, e) {
        return k7 += e, k7 >= qpt && (Q_ = new TextDecoder("utf-8", {
            ignoreBOM: !0,
            fatal: !0
        }), Q_.decode(), k7 = e), Q_.decode(Mm().subarray(t, t + e));
    }
    function In(t, e) {
        return t = t >>> 0, Wpt(t, e);
    }
    let Vs = 0;
    const Rm = new TextEncoder;
    "encodeInto" in Rm || (Rm.encodeInto = function(t, e) {
        const n = Rm.encode(t);
        return e.set(n), {
            read: t.length,
            written: n.length
        };
    });
    function si(t, e, n) {
        if (n === void 0) {
            const a = Rm.encode(t), c = e(a.length, 1) >>> 0;
            return Mm().subarray(c, c + a.length).set(a), Vs = a.length, c;
        }
        let r = t.length, s = e(r, 1) >>> 0;
        const i = Mm();
        let o = 0;
        for(; o < r; o++){
            const a = t.charCodeAt(o);
            if (a > 127) break;
            i[s + o] = a;
        }
        if (o !== r) {
            o !== 0 && (t = t.slice(o)), s = n(s, r, r = o + t.length * 3, 1) >>> 0;
            const a = Mm().subarray(s + o, s + r), c = Rm.encodeInto(t, a);
            o += c.written, s = n(s, r, o, 1) >>> 0;
        }
        return Vs = o, s;
    }
    let Eh = null;
    function Xa() {
        return (Eh === null || Eh.buffer.detached === !0 || Eh.buffer.detached === void 0 && Eh.buffer !== ne.memory.buffer) && (Eh = new DataView(ne.memory.buffer)), Eh;
    }
    function mr(t) {
        return t == null;
    }
    function B9(t, e) {
        return t = t >>> 0, Mm().subarray(t / 1, t / 1 + e);
    }
    function mT(t) {
        const e = typeof t;
        if (e == "number" || e == "boolean" || t == null) return `${t}`;
        if (e == "string") return `"${t}"`;
        if (e == "symbol") {
            const s = t.description;
            return s == null ? "Symbol" : `Symbol(${s})`;
        }
        if (e == "function") {
            const s = t.name;
            return typeof s == "string" && s.length > 0 ? `Function(${s})` : "Function";
        }
        if (Array.isArray(t)) {
            const s = t.length;
            let i = "[";
            s > 0 && (i += mT(t[0]));
            for(let o = 1; o < s; o++)i += ", " + mT(t[o]);
            return i += "]", i;
        }
        const n = /\[object ([^\]]+)\]/.exec(toString.call(t));
        let r;
        if (n && n.length > 1) r = n[1];
        else return toString.call(t);
        if (r == "Object") try {
            return "Object(" + JSON.stringify(t) + ")";
        } catch  {
            return "Object";
        }
        return t instanceof Error ? `${t.name}: ${t.message}
${t.stack}` : r;
    }
    const Xz = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>{
        ne.__wbindgen_export_5.get(t.dtor)(t.a, t.b);
    });
    function Kpt(t, e, n, r) {
        const s = {
            a: t,
            b: e,
            cnt: 1,
            dtor: n
        }, i = (...o)=>{
            s.cnt++;
            const a = s.a;
            s.a = 0;
            try {
                return r(a, s.b, ...o);
            } finally{
                --s.cnt === 0 ? (ne.__wbindgen_export_5.get(s.dtor)(a, s.b), Xz.unregister(s)) : s.a = a;
            }
        };
        return i.original = s, Xz.register(i, s, s), i;
    }
    function ke(t) {
        const e = ne.__wbindgen_export_2.get(t);
        return ne.__externref_table_dealloc(t), e;
    }
    v2t = function() {
        let t, e;
        try {
            const s = ne.dummyUserAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    S2t = function(t) {
        const e = ne.leafHash(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    k2t = function(t) {
        let e, n;
        try {
            const i = ne.entryPointHash(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    T2t = function() {
        let t, e;
        try {
            const s = ne.sampleContractAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    C2t = function(t, e, n) {
        const r = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), s = Vs, i = si(n, ne.__wbindgen_malloc, ne.__wbindgen_realloc), o = Vs, a = ne.verifySignature(r, s, e, i, o);
        if (a[2]) throw ke(a[1]);
        return a[0] !== 0;
    };
    $pt = function() {
        let t, e;
        try {
            const s = ne.dummyContractAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    E2t = function(t) {
        const e = ne.ecMulGenerator(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    I2t = function(t, e, n) {
        const r = ne.persistentCommit(t, e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    A2t = function(t, e, n, r, s) {
        var i = mr(s) ? 0 : si(s, ne.__wbindgen_malloc, ne.__wbindgen_realloc), o = Vs;
        const a = ne.proofDataIntoSerializedPreimage(t, e, n, r, i, o);
        if (a[2]) throw ke(a[1]);
        return ke(a[0]);
    };
    Xpt = function() {
        const t = ne.maxField();
        if (t[2]) throw ke(t[1]);
        return ke(t[0]);
    };
    P2t = function() {
        let t, e;
        try {
            const s = ne.sampleSigningKey();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    O2t = function(t) {
        let e, n;
        try {
            const i = ne.signingKeyFromBip340(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    M2t = function() {
        let t, e;
        try {
            const s = ne.communicationCommitmentRandomness();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    R2t = function(t, e) {
        let n, r;
        try {
            const o = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), a = Vs, c = ne.signData(o, a, e);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, ke(c[2]);
            return n = s, r = i, In(s, i);
        } finally{
            ne.__wbindgen_free(n, r, 1);
        }
    };
    N2t = function(t, e) {
        const n = ne.ecMul(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    V2t = function(t, e, n) {
        let r, s;
        try {
            const a = si(n, ne.__wbindgen_malloc, ne.__wbindgen_realloc), c = Vs, l = ne.communicationCommitment(t, e, a, c);
            var i = l[0], o = l[1];
            if (l[3]) throw i = 0, o = 0, ke(l[2]);
            return r = i, s = o, In(i, o);
        } finally{
            ne.__wbindgen_free(r, s, 1);
        }
    };
    D2t = function(t, e, n) {
        const r = ne.transientCommit(t, e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    B2t = function(t, e) {
        let n, r;
        try {
            const o = si(e, ne.__wbindgen_malloc, ne.__wbindgen_realloc), a = Vs, c = ne.rawTokenType(t, o, a);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, ke(c[2]);
            return n = s, r = i, In(s, i);
        } finally{
            ne.__wbindgen_free(n, r, 1);
        }
    };
    F2t = function(t) {
        const e = ne.upgradeFromTransient(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    L2t = function(t) {
        let e, n;
        try {
            const i = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), o = Vs, a = ne.signatureVerifyingKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, ke(a[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    z2t = function(t) {
        const e = ne.bigIntToValue(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    U2t = function() {
        let t, e;
        try {
            const s = ne.sampleRawTokenType();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    H2t = function(t) {
        const e = ne.maxAlignedSize(t);
        if (e[2]) throw ke(e[1]);
        return BigInt.asUintN(64, e[0]);
    };
    j2t = function(t, e) {
        const n = ne.persistentHash(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    q2t = function(t) {
        const e = ne.bigIntModFr(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    W2t = function(t, e) {
        const n = ne.ecAdd(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    K2t = function(t) {
        const e = ne.valueToBigInt(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    $2t = function(t, e) {
        const n = ne.transientHash(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    X2t = function() {
        let t, e;
        try {
            const s = ne.sampleUserAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, ke(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            ne.__wbindgen_free(t, e, 1);
        }
    };
    G2t = function(t, e) {
        const n = ne.runtimeCoinCommitment(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    Z2t = function(t, e) {
        const n = ne.hashToCurve(t, e);
        if (n[2]) throw ke(n[1]);
        return ke(n[0]);
    };
    J2t = function(t) {
        const e = ne.degradeToTransient(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    Y2t = function(t) {
        const e = ne.encodeShieldedCoinInfo(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    Q2t = function(t) {
        const e = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), n = Vs, r = ne.encodeCoinPublicKey(e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    ext = function(t) {
        const e = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), n = Vs, r = ne.encodeContractAddress(e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    txt = function(t) {
        const e = ne.decodeQualifiedShieldedCoinInfo(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    nxt = function(t) {
        const e = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), n = Vs, r = ne.encodeUserAddress(e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    rxt = function(t) {
        let e, n;
        try {
            const i = ne.decodeUserAddress(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    sxt = function(t) {
        const e = ne.decodeShieldedCoinInfo(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    ixt = function(t) {
        let e, n;
        try {
            const i = ne.decodeCoinPublicKey(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    oxt = function(t) {
        const e = si(t, ne.__wbindgen_malloc, ne.__wbindgen_realloc), n = Vs, r = ne.encodeRawTokenType(e, n);
        if (r[2]) throw ke(r[1]);
        return ke(r[0]);
    };
    axt = function(t) {
        let e, n;
        try {
            const i = ne.decodeContractAddress(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    cxt = function(t) {
        let e, n;
        try {
            const i = ne.decodeRawTokenType(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, ke(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            ne.__wbindgen_free(e, n, 1);
        }
    };
    lxt = function(t) {
        const e = ne.encodeQualifiedShieldedCoinInfo(t);
        if (e[2]) throw ke(e[1]);
        return ke(e[0]);
    };
    function _i(t, e) {
        if (!(t instanceof e)) throw new Error(`expected instance of ${e.name}`);
    }
    uxt = function(t, e, n, r) {
        _i(t, Op), _i(n, hu);
        const s = ne.runProgram(t.__wbg_ptr, e, n.__wbg_ptr, r);
        if (s[2]) throw ke(s[1]);
        return zy.__wrap(s[0]);
    };
    function MO(t, e) {
        t = t >>> 0;
        const n = Xa(), r = [];
        for(let s = t; s < t + 4 * e; s += 4)r.push(ne.__wbindgen_export_2.get(n.getUint32(s, !0)));
        return ne.__externref_drop_slice(t, e), r;
    }
    function Gpt(t, e, n) {
        ne.closure567_externref_shim(t, e, n);
    }
    function Zpt(t, e, n, r) {
        ne.closure607_externref_shim(t, e, n, r);
    }
    const T7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_chargedstate_free(t >>> 0, 1));
    Hd = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Hd.prototype);
            return n.__wbg_ptr = e, T7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, T7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_chargedstate_free(e, 0);
        }
        constructor(e){
            _i(e, rs);
            const n = ne.chargedstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, T7.register(this, this.__wbg_ptr, this), this;
        }
        get state() {
            const e = ne.chargedstate_state(this.__wbg_ptr);
            return rs.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.chargedstate_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Hd.prototype[Symbol.dispose] = Hd.prototype.free);
    const C7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_contractmaintenanceauthority_free(t >>> 0, 1));
    Ap = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ap.prototype);
            return n.__wbg_ptr = e, C7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, C7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_contractmaintenanceauthority_free(e, 0);
        }
        static deserialize(e) {
            const n = ne.contractmaintenanceauthority_deserialize(e);
            if (n[2]) throw ke(n[1]);
            return Ap.__wrap(n[0]);
        }
        constructor(e, n, r){
            const s = ne.contractmaintenanceauthority_new(e, n, mr(r) ? 0 : Yd(r));
            if (s[2]) throw ke(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, C7.register(this, this.__wbg_ptr, this), this;
        }
        get counter() {
            return ne.contractmaintenanceauthority_counter(this.__wbg_ptr);
        }
        get committee() {
            const e = ne.contractmaintenanceauthority_committee(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        serialize() {
            const e = ne.contractmaintenanceauthority_serialize(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        get threshold() {
            return ne.contractmaintenanceauthority_threshold(this.__wbg_ptr) >>> 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.contractmaintenanceauthority_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Ap.prototype[Symbol.dispose] = Ap.prototype.free);
    const E7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_contractoperation_free(t >>> 0, 1));
    Pp = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Pp.prototype);
            return n.__wbg_ptr = e, E7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, E7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_contractoperation_free(e, 0);
        }
        static deserialize(e) {
            const n = ne.contractoperation_deserialize(e);
            if (n[2]) throw ke(n[1]);
            return Pp.__wrap(n[0]);
        }
        get verifierKey() {
            const e = ne.contractoperation_verifier_key(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        set verifierKey(e) {
            const n = ne.contractoperation_set_verifier_key(this.__wbg_ptr, e);
            if (n[1]) throw ke(n[0]);
        }
        constructor(){
            const e = ne.contractoperation_new();
            if (e[2]) throw ke(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, E7.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = ne.contractoperation_serialize(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.contractoperation_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Pp.prototype[Symbol.dispose] = Pp.prototype.free);
    const I7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_contractstate_free(t >>> 0, 1));
    ug = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ug.prototype);
            return n.__wbg_ptr = e, I7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, I7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_contractstate_free(e, 0);
        }
        operations() {
            const e = ne.contractstate_operations(this.__wbg_ptr);
            var n = MO(e[0], e[1]).slice();
            return ne.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e) {
            const n = ne.contractstate_deserialize(e);
            if (n[2]) throw ke(n[1]);
            return ug.__wrap(n[0]);
        }
        set balance(e) {
            const n = ne.contractstate_set_balance(this.__wbg_ptr, e);
            if (n[1]) throw ke(n[0]);
        }
        setOperation(e, n) {
            _i(n, Pp);
            const r = ne.contractstate_setOperation(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[1]) throw ke(r[0]);
        }
        get maintenanceAuthority() {
            const e = ne.contractstate_maintenance_authority(this.__wbg_ptr);
            return Ap.__wrap(e);
        }
        set maintenanceAuthority(e) {
            _i(e, Ap), ne.contractstate_set_maintenance_authority(this.__wbg_ptr, e.__wbg_ptr);
        }
        constructor(){
            const e = ne.contractstate_new();
            return this.__wbg_ptr = e >>> 0, I7.register(this, this.__wbg_ptr, this), this;
        }
        get data() {
            const e = ne.contractstate_data(this.__wbg_ptr);
            return Hd.__wrap(e);
        }
        query(e, n) {
            _i(n, hu);
            const r = ne.contractstate_query(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw ke(r[1]);
            return ke(r[0]);
        }
        get balance() {
            const e = ne.contractstate_balance(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        set data(e) {
            _i(e, Hd), ne.contractstate_set_data(this.__wbg_ptr, e.__wbg_ptr);
        }
        operation(e) {
            const n = ne.contractstate_operation(this.__wbg_ptr, e);
            if (n[2]) throw ke(n[1]);
            return n[0] === 0 ? void 0 : Pp.__wrap(n[0]);
        }
        serialize() {
            const e = ne.contractstate_serialize(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.contractstate_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (ug.prototype[Symbol.dispose] = ug.prototype.free);
    const A7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_costmodel_free(t >>> 0, 1));
    hu = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(hu.prototype);
            return n.__wbg_ptr = e, A7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, A7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_costmodel_free(e, 0);
        }
        static initialCostModel() {
            const e = ne.costmodel_initialCostModel();
            return hu.__wrap(e);
        }
        constructor(){
            const e = ne.costmodel_new();
            if (e[2]) throw ke(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, A7.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.costmodel_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (hu.prototype[Symbol.dispose] = hu.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>ne.__wbg_intounderlyingbytesource_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>ne.__wbg_intounderlyingsink_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>ne.__wbg_intounderlyingsource_free(t >>> 0, 1));
    const P7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_querycontext_free(t >>> 0, 1));
    Qf = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Qf.prototype);
            return n.__wbg_ptr = e, P7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, P7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_querycontext_free(e, 0);
        }
        get comIndices() {
            const e = ne.querycontext_com_indices(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        set effects(e) {
            const n = ne.querycontext_set_effects(this.__wbg_ptr, e);
            if (n[1]) throw ke(n[0]);
        }
        toVmStack() {
            const e = ne.querycontext_toVmStack(this.__wbg_ptr);
            return Op.__wrap(e);
        }
        runTranscript(e, n) {
            _i(n, hu);
            const r = ne.querycontext_runTranscript(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw ke(r[1]);
            return Qf.__wrap(r[0]);
        }
        insertCommitment(e, n) {
            const r = si(e, ne.__wbindgen_malloc, ne.__wbindgen_realloc), s = Vs, i = ne.querycontext_insertCommitment(this.__wbg_ptr, r, s, n);
            if (i[2]) throw ke(i[1]);
            return Qf.__wrap(i[0]);
        }
        constructor(e, n){
            _i(e, Hd);
            const r = si(n, ne.__wbindgen_malloc, ne.__wbindgen_realloc), s = Vs, i = ne.querycontext_new(e.__wbg_ptr, r, s);
            if (i[2]) throw ke(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, P7.register(this, this.__wbg_ptr, this), this;
        }
        get block() {
            const e = ne.querycontext_block(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        query(e, n, r) {
            _i(n, hu);
            const s = ne.querycontext_query(this.__wbg_ptr, e, n.__wbg_ptr, r);
            if (s[2]) throw ke(s[1]);
            return Ly.__wrap(s[0]);
        }
        get state() {
            const e = ne.querycontext_state(this.__wbg_ptr);
            return Hd.__wrap(e);
        }
        get address() {
            let e, n;
            try {
                const i = ne.querycontext_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, ke(i[2]);
                return e = r, n = s, In(r, s);
            } finally{
                ne.__wbindgen_free(e, n, 1);
            }
        }
        get effects() {
            const e = ne.querycontext_effects(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        qualify(e) {
            const n = ne.querycontext_qualify(this.__wbg_ptr, e);
            if (n[2]) throw ke(n[1]);
            return ke(n[0]);
        }
        set block(e) {
            const n = ne.querycontext_set_block(this.__wbg_ptr, e);
            if (n[1]) throw ke(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.querycontext_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Qf.prototype[Symbol.dispose] = Qf.prototype.free);
    const O7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_queryresults_free(t >>> 0, 1));
    Ly = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ly.prototype);
            return n.__wbg_ptr = e, O7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, O7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_queryresults_free(e, 0);
        }
        constructor(){
            const e = ne.queryresults_new();
            if (e[2]) throw ke(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, O7.register(this, this.__wbg_ptr, this), this;
        }
        get events() {
            const e = ne.queryresults_events(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        get context() {
            const e = ne.queryresults_context(this.__wbg_ptr);
            return Qf.__wrap(e);
        }
        get gasCost() {
            const e = ne.queryresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.queryresults_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Ly.prototype[Symbol.dispose] = Ly.prototype.free);
    const M7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_stateboundedmerkletree_free(t >>> 0, 1));
    zl = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(zl.prototype);
            return n.__wbg_ptr = e, M7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, M7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_stateboundedmerkletree_free(e, 0);
        }
        pathForLeaf(e, n) {
            const r = ne.stateboundedmerkletree_pathForLeaf(this.__wbg_ptr, e, n);
            if (r[2]) throw ke(r[1]);
            return ke(r[0]);
        }
        findPathForLeaf(e) {
            const n = ne.stateboundedmerkletree_findPathForLeaf(this.__wbg_ptr, e);
            if (n[2]) throw ke(n[1]);
            return ke(n[0]);
        }
        root() {
            const e = ne.stateboundedmerkletree_root(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        constructor(e){
            const n = ne.stateboundedmerkletree_blank(e);
            return this.__wbg_ptr = n >>> 0, M7.register(this, this.__wbg_ptr, this), this;
        }
        get height() {
            return ne.stateboundedmerkletree_height(this.__wbg_ptr);
        }
        rehash() {
            const e = ne.stateboundedmerkletree_rehash(this.__wbg_ptr);
            return zl.__wrap(e);
        }
        update(e, n) {
            const r = ne.stateboundedmerkletree_update(this.__wbg_ptr, e, n);
            if (r[2]) throw ke(r[1]);
            return zl.__wrap(r[0]);
        }
        collapse(e, n) {
            const r = ne.stateboundedmerkletree_collapse(this.__wbg_ptr, e, n);
            return zl.__wrap(r);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.stateboundedmerkletree_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (zl.prototype[Symbol.dispose] = zl.prototype.free);
    const R7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_statemap_free(t >>> 0, 1));
    hd = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(hd.prototype);
            return n.__wbg_ptr = e, R7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, R7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_statemap_free(e, 0);
        }
        get(e) {
            const n = ne.statemap_get(this.__wbg_ptr, e);
            if (n[2]) throw ke(n[1]);
            return n[0] === 0 ? void 0 : rs.__wrap(n[0]);
        }
        constructor(){
            const e = ne.statemap_new();
            return this.__wbg_ptr = e >>> 0, R7.register(this, this.__wbg_ptr, this), this;
        }
        keys() {
            const e = ne.statemap_keys(this.__wbg_ptr);
            if (e[3]) throw ke(e[2]);
            var n = MO(e[0], e[1]).slice();
            return ne.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        insert(e, n) {
            _i(n, rs);
            const r = ne.statemap_insert(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw ke(r[1]);
            return hd.__wrap(r[0]);
        }
        remove(e) {
            const n = ne.statemap_remove(this.__wbg_ptr, e);
            if (n[2]) throw ke(n[1]);
            return hd.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.statemap_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (hd.prototype[Symbol.dispose] = hd.prototype.free);
    const N7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_statevalue_free(t >>> 0, 1));
    rs = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(rs.prototype);
            return n.__wbg_ptr = e, N7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, N7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_statevalue_free(e, 0);
        }
        arrayPush(e) {
            _i(e, rs);
            const n = ne.statevalue_arrayPush(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw ke(n[1]);
            return rs.__wrap(n[0]);
        }
        asBoundedMerkleTree() {
            const e = ne.statevalue_asBoundedMerkleTree(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return e[0] === 0 ? void 0 : zl.__wrap(e[0]);
        }
        static newBoundedMerkleTree(e) {
            _i(e, zl);
            const n = ne.statevalue_newBoundedMerkleTree(e.__wbg_ptr);
            return rs.__wrap(n);
        }
        constructor(){
            const e = ne.statevalue_new();
            if (e[2]) throw ke(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, N7.register(this, this.__wbg_ptr, this), this;
        }
        type() {
            let e, n;
            try {
                const r = ne.statevalue_type(this.__wbg_ptr);
                return e = r[0], n = r[1], In(r[0], r[1]);
            } finally{
                ne.__wbindgen_free(e, n, 1);
            }
        }
        asMap() {
            const e = ne.statevalue_asMap(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return e[0] === 0 ? void 0 : hd.__wrap(e[0]);
        }
        static decode(e) {
            const n = ne.statevalue_decode(e);
            if (n[2]) throw ke(n[1]);
            return rs.__wrap(n[0]);
        }
        encode() {
            const e = ne.statevalue_encode(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        asCell() {
            const e = ne.statevalue_asCell(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        static newMap(e) {
            _i(e, hd);
            const n = ne.statevalue_newMap(e.__wbg_ptr);
            return rs.__wrap(n);
        }
        asArray() {
            const e = ne.statevalue_asArray(this.__wbg_ptr);
            if (e[3]) throw ke(e[2]);
            let n;
            return e[0] !== 0 && (n = MO(e[0], e[1]).slice(), ne.__wbindgen_free(e[0], e[1] * 4, 4)), n;
        }
        logSize() {
            return ne.statevalue_logSize(this.__wbg_ptr) >>> 0;
        }
        static newCell(e) {
            const n = ne.statevalue_newCell(e);
            if (n[2]) throw ke(n[1]);
            return rs.__wrap(n[0]);
        }
        static newNull() {
            const e = ne.statevalue_newNull();
            return rs.__wrap(e);
        }
        static newArray() {
            const e = ne.statevalue_newArray();
            return rs.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.statevalue_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (rs.prototype[Symbol.dispose] = rs.prototype.free);
    const Gz = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_vmresults_free(t >>> 0, 1));
    zy = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(zy.prototype);
            return n.__wbg_ptr = e, Gz.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Gz.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_vmresults_free(e, 0);
        }
        constructor(){
            const e = ne.vmresults_new();
            if (e[2]) throw ke(e[1]);
            return rs.__wrap(e[0]);
        }
        get stack() {
            const e = ne.vmresults_stack(this.__wbg_ptr);
            return Op.__wrap(e);
        }
        get events() {
            const e = ne.vmresults_events(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        get gasCost() {
            const e = ne.vmresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw ke(e[1]);
            return ke(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.vmresults_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (zy.prototype[Symbol.dispose] = zy.prototype.free);
    const V7 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>ne.__wbg_vmstack_free(t >>> 0, 1));
    Op = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Op.prototype);
            return n.__wbg_ptr = e, V7.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, V7.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            ne.__wbg_vmstack_free(e, 0);
        }
        removeLast() {
            ne.vmstack_removeLast(this.__wbg_ptr);
        }
        get(e) {
            const n = ne.vmstack_get(this.__wbg_ptr, e);
            return n === 0 ? void 0 : rs.__wrap(n);
        }
        constructor(){
            const e = ne.vmstack_new();
            return this.__wbg_ptr = e >>> 0, V7.register(this, this.__wbg_ptr, this), this;
        }
        push(e, n) {
            _i(e, rs), ne.vmstack_push(this.__wbg_ptr, e.__wbg_ptr, n);
        }
        length() {
            return ne.vmstack_length(this.__wbg_ptr) >>> 0;
        }
        isStrong(e) {
            const n = ne.vmstack_isStrong(this.__wbg_ptr, e);
            return n === 16777215 ? void 0 : n !== 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = ne.vmstack_toString(this.__wbg_ptr, mr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                ne.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Op.prototype[Symbol.dispose] = Op.prototype.free);
    function Jpt() {
        return Ro(function(t) {
            return BigInt(t);
        }, arguments);
    }
    function Ypt(t) {
        return BigInt(t);
    }
    function Qpt(t, e) {
        return Error(In(t, e));
    }
    function eht(t) {
        return Number(t);
    }
    function tht(t, e) {
        const n = String(e), r = si(n, ne.__wbindgen_malloc, ne.__wbindgen_realloc), s = Vs;
        Xa().setInt32(t + 4, s, !0), Xa().setInt32(t + 0, r, !0);
    }
    function nht(t) {
        return t.buffer;
    }
    function rht(t) {
        const e = t.byobRequest;
        return mr(e) ? 0 : Yd(e);
    }
    function sht(t) {
        return t.byteLength;
    }
    function iht(t) {
        return t.byteOffset;
    }
    function oht() {
        return Ro(function(t, e) {
            return t.call(e);
        }, arguments);
    }
    function aht() {
        return Ro(function(t, e, n) {
            return t.call(e, n);
        }, arguments);
    }
    function cht() {
        return Ro(function(t) {
            t.close();
        }, arguments);
    }
    function lht() {
        return Ro(function(t) {
            t.close();
        }, arguments);
    }
    function uht(t) {
        return ug.__wrap(t);
    }
    function dht(t) {
        return t.crypto;
    }
    function fht(t) {
        return t.done;
    }
    function pht() {
        return Ro(function(t, e) {
            t.enqueue(e);
        }, arguments);
    }
    function hht(t) {
        return Object.entries(t);
    }
    function ght(t) {
        return Array.from(t);
    }
    function bht() {
        return Ro(function(t, e) {
            t.getRandomValues(e);
        }, arguments);
    }
    function mht(t, e) {
        return t[e >>> 0];
    }
    function yht() {
        return Ro(function(t, e) {
            return Reflect.get(t, e);
        }, arguments);
    }
    function wht(t, e) {
        return t.get(e);
    }
    function _ht(t, e) {
        return t[e];
    }
    function xht(t) {
        let e;
        try {
            e = t instanceof ArrayBuffer;
        } catch  {
            e = !1;
        }
        return e;
    }
    function vht(t) {
        let e;
        try {
            e = t instanceof Map;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Sht(t) {
        let e;
        try {
            e = t instanceof Uint8Array;
        } catch  {
            e = !1;
        }
        return e;
    }
    function kht(t) {
        return Array.isArray(t);
    }
    function Tht(t) {
        return Number.isSafeInteger(t);
    }
    function Cht() {
        return Symbol.iterator;
    }
    function Eht(t) {
        return t.keys();
    }
    function Iht(t) {
        return t.length;
    }
    function Aht(t) {
        return t.length;
    }
    function Pht(t) {
        return t.msCrypto;
    }
    function Oht() {
        return new Object;
    }
    function Mht() {
        return new Array;
    }
    function Rht(t, e) {
        try {
            var n = {
                a: t,
                b: e
            }, r = (i, o)=>{
                const a = n.a;
                n.a = 0;
                try {
                    return Zpt(a, n.b, i, o);
                } finally{
                    n.a = a;
                }
            };
            return new Promise(r);
        } finally{
            n.a = n.b = 0;
        }
    }
    function Nht() {
        return new Map;
    }
    function Vht(t) {
        return new Uint8Array(t);
    }
    function Dht(t, e) {
        return new Error(In(t, e));
    }
    function Bht(t, e) {
        return new Uint8Array(B9(t, e));
    }
    function Fht(t, e) {
        return new Function(In(t, e));
    }
    function Lht(t, e, n) {
        return new Uint8Array(t, e >>> 0, n >>> 0);
    }
    function zht(t) {
        return new Uint8Array(t >>> 0);
    }
    function Uht(t) {
        return t.next;
    }
    function Hht() {
        return Ro(function(t) {
            return t.next();
        }, arguments);
    }
    function jht(t) {
        return t.node;
    }
    function qht(t) {
        return t.process;
    }
    function Wht(t, e, n) {
        Uint8Array.prototype.set.call(B9(t, e), n);
    }
    function Kht(t, e) {
        return t.push(e);
    }
    function $ht(t) {
        queueMicrotask(t);
    }
    function Xht(t) {
        return t.queueMicrotask;
    }
    function Ght() {
        return Ro(function(t, e) {
            t.randomFillSync(e);
        }, arguments);
    }
    function Zht() {
        return Ro(function() {
            return module.require;
        }, arguments);
    }
    function Jht(t) {
        return Promise.resolve(t);
    }
    function Yht() {
        return Ro(function(t, e) {
            t.respond(e >>> 0);
        }, arguments);
    }
    function Qht(t, e, n) {
        t.set(B9(e, n));
    }
    function e0t(t, e, n) {
        t[e] = n;
    }
    function t0t(t, e, n) {
        t[e >>> 0] = n;
    }
    function n0t(t, e, n) {
        return t.set(e, n);
    }
    function r0t(t) {
        return rs.__wrap(t);
    }
    function s0t() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return mr(t) ? 0 : Yd(t);
    }
    function i0t() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return mr(t) ? 0 : Yd(t);
    }
    function o0t() {
        const t = typeof self > "u" ? null : self;
        return mr(t) ? 0 : Yd(t);
    }
    function a0t() {
        const t = typeof window > "u" ? null : window;
        return mr(t) ? 0 : Yd(t);
    }
    function c0t(t, e, n) {
        return t.subarray(e >>> 0, n >>> 0);
    }
    function l0t(t, e) {
        return t.then(e);
    }
    function u0t() {
        return Ro(function(t, e) {
            return t.toString(e);
        }, arguments);
    }
    function d0t(t) {
        return t.toString();
    }
    function f0t(t) {
        return t.value;
    }
    function p0t(t) {
        return t.versions;
    }
    function h0t(t) {
        const e = t.view;
        return mr(e) ? 0 : Yd(e);
    }
    function g0t(t, e) {
        const n = e, r = typeof n == "bigint" ? n : void 0;
        Xa().setBigInt64(t + 8, mr(r) ? BigInt(0) : r, !0), Xa().setInt32(t + 0, !mr(r), !0);
    }
    function b0t(t) {
        const e = t, n = typeof e == "boolean" ? e : void 0;
        return mr(n) ? 16777215 : n ? 1 : 0;
    }
    function m0t(t) {
        const e = t.original;
        return e.cnt-- == 1 ? (e.a = 0, !0) : !1;
    }
    function y0t(t, e) {
        const n = mT(e), r = si(n, ne.__wbindgen_malloc, ne.__wbindgen_realloc), s = Vs;
        Xa().setInt32(t + 4, s, !0), Xa().setInt32(t + 0, r, !0);
    }
    function w0t(t, e) {
        return t in e;
    }
    function _0t(t) {
        return typeof t == "bigint";
    }
    function x0t(t) {
        return typeof t == "function";
    }
    function v0t(t) {
        return t === null;
    }
    function S0t(t) {
        const e = t;
        return typeof e == "object" && e !== null;
    }
    function k0t(t) {
        return typeof t == "string";
    }
    function T0t(t) {
        return t === void 0;
    }
    function C0t(t, e) {
        return t === e;
    }
    function E0t(t, e) {
        return t == e;
    }
    function I0t(t, e) {
        const n = e, r = typeof n == "number" ? n : void 0;
        Xa().setFloat64(t + 8, mr(r) ? 0 : r, !0), Xa().setInt32(t + 0, !mr(r), !0);
    }
    function A0t(t, e) {
        return t >> e;
    }
    function P0t(t, e) {
        const n = e, r = typeof n == "string" ? n : void 0;
        var s = mr(r) ? 0 : si(r, ne.__wbindgen_malloc, ne.__wbindgen_realloc), i = Vs;
        Xa().setInt32(t + 4, i, !0), Xa().setInt32(t + 0, s, !0);
    }
    function O0t(t, e) {
        throw new Error(In(t, e));
    }
    function M0t(t, e) {
        return In(t, e);
    }
    function R0t(t) {
        return BigInt.asUintN(64, t);
    }
    function N0t(t, e) {
        return Kpt(t, e, 566, Gpt);
    }
    function V0t(t) {
        return t;
    }
    function D0t(t, e) {
        return B9(t, e);
    }
    function B0t(t) {
        return t;
    }
    function F0t(t, e) {
        return BigInt.asUintN(64, t) | BigInt.asUintN(64, e) << BigInt(64);
    }
    function L0t() {
        const t = ne.__wbindgen_export_2, e = t.grow(4);
        t.set(0, void 0), t.set(e + 0, void 0), t.set(e + 1, null), t.set(e + 2, !0), t.set(e + 3, !1);
    }
    URL = globalThis.URL;
    const he = await lU({
        "./midnight_onchain_runtime_wasm_bg.js": {
            __wbg_statevalue_new: r0t,
            __wbg_contractstate_new: uht,
            __wbg_getwithrefkey_1dc361bd10053bfe: _ht,
            __wbg_set_3f1d0b984ed272ed: e0t,
            __wbg_String_8f0eb39a4a4c2f66: tht,
            __wbg_queueMicrotask_25d0739ac89e8c88: $ht,
            __wbg_queueMicrotask_4488407636f5bf24: Xht,
            __wbg_respond_6c2c4e20ef85138e: Yht,
            __wbg_view_91cc97d57ab30530: h0t,
            __wbg_byobRequest_2c036bceca1e6037: rht,
            __wbg_close_cccada6053ee3a65: cht,
            __wbg_enqueue_452bc2343d1c2ff9: pht,
            __wbg_close_d71a78219dc23e91: lht,
            __wbg_crypto_86f2631e91b51511: dht,
            __wbg_process_3975fd6c72f520aa: qht,
            __wbg_versions_4e31226f5e8dc909: p0t,
            __wbg_node_e1f24f89a7336c2e: jht,
            __wbg_require_b74f47fc2d022fd6: Zht,
            __wbg_msCrypto_d562bbe83e0d4b91: Pht,
            __wbg_getRandomValues_b3f15fcbfabb0f8b: bht,
            __wbg_randomFillSync_f8c153b79f285817: Ght,
            __wbg_byteLength_331a6b5545834024: sht,
            __wbg_byteOffset_49a5b5608000358b: iht,
            __wbg_newfromslice_074c56947bd43469: Bht,
            __wbg_newwithlength_a167dcc7aaa3ba77: zht,
            __wbg_newwithbyteoffsetandlength_e8f53910b4d42b45: Lht,
            __wbg_new_638ebfaedbf32a5e: Vht,
            __wbg_buffer_8d40b1d762fb3c66: nht,
            __wbg_length_6bb7e81f9d7713e4: Aht,
            __wbg_prototypesetcall_3d4a26c1ed734349: Wht,
            __wbg_subarray_70fd07feefe14294: c0t,
            __wbg_set_1353b2a5e96bc48c: Qht,
            __wbg_BigInt_40a77d45cca49470: Jpt,
            __wbg_done_75ed0ee6dd243d9d: fht,
            __wbg_value_dd9372230531eade: f0t,
            __wbg_instanceof_Map_ebb01a5b6b5ffd0b: vht,
            __wbg_instanceof_Uint8Array_9a8378d955933db7: Sht,
            __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd: xht,
            __wbg_BigInt_6adbfd8eb0f7ec07: Ypt,
            __wbg_get_5ee3191755594360: wht,
            __wbg_new_2ff1f68f3676ea53: Nht,
            __wbg_set_b7f1cf4fae26fe2a: n0t,
            __wbg_keys_822161a7faf55538: Eht,
            __wbg_get_0da715ceaecea5c8: mht,
            __wbg_new_1f3a344cf3123716: Mht,
            __wbg_set_90f6c0f7bd8c0415: t0t,
            __wbg_from_88bc52ce20ba6318: ght,
            __wbg_push_330b2eb93e4e1212: Kht,
            __wbg_length_186546c51cd61acd: Iht,
            __wbg_isArray_030cce220591fb41: kht,
            __wbg_new_da9dc54c5db29dfa: Dht,
            __wbg_toString_d8f537919ef401d6: d0t,
            __wbg_toString_7268338f40012a03: u0t,
            __wbg_isSafeInteger_1c0d1af5542e102a: Tht,
            __wbg_new_19c25a3f2fa63a02: Oht,
            __wbg_entries_2be2f15bd5554996: hht,
            __wbg_iterator_f370b34483c71a1c: Cht,
            __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184: i0t,
            __wbg_static_accessor_SELF_995b214ae681ff99: o0t,
            __wbg_static_accessor_GLOBAL_8921f820c2ce3f12: s0t,
            __wbg_static_accessor_WINDOW_cde3890479c675ea: a0t,
            __wbg_new_2e3c58a15f39f5f9: Rht,
            __wbg_then_e22500defe16819f: l0t,
            __wbg_resolve_4055c623acdd6a1b: Jht,
            __wbg_get_458e874b43b18b25: yht,
            __wbg_newnoargs_254190557c45b4ec: Fht,
            __wbg_call_13410aac570ffff7: oht,
            __wbg_call_a5400b25a865cfd8: aht,
            __wbg_next_5b3530e612fde77d: Uht,
            __wbg_next_692e82279131b03c: Hht,
            __wbg_wbindgenin_d7a1ee10933d2d55: w0t,
            __wbg_wbindgenshr_7d2aae6044c0dab1: A0t,
            __wbg_wbindgenthrow_451ec1a8469d7eb6: O0t,
            __wbg_wbindgencbdrop_eb10308566512b88: m0t,
            __wbg_wbindgenisnull_f3037694abe4d97a: v0t,
            __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58: C0t,
            __wbg_Number_998bea33bd87c3e0: eht,
            __wbg_Error_e17e777aac105295: Qpt,
            __wbg_wbindgenisbigint_ecb90cc08a5a9154: _0t,
            __wbg_wbindgenisobject_307a53c6bd97fbf8: S0t,
            __wbg_wbindgenisstring_d4fa939789f003b0: k0t,
            __wbg_wbindgennumberget_f74b4c7525ac05cb: I0t,
            __wbg_wbindgenstringget_0f16a6ddddef376f: P0t,
            __wbg_wbindgenbooleanget_3fe6f642c7d97746: b0t,
            __wbg_wbindgenisfunction_8cee7dce3725ae74: x0t,
            __wbg_wbindgenisundefined_c4b71d073b92f3c5: T0t,
            __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1: E0t,
            __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1: g0t,
            __wbg_wbindgendebugstring_99ef257a3ddda34d: y0t,
            __wbindgen_init_externref_table: L0t,
            __wbindgen_cast_4b5eaebe94e9fac3: N0t,
            __wbindgen_cast_4625c577ab2ec9ee: R0t,
            __wbindgen_cast_9ae0607507abb057: V0t,
            __wbindgen_cast_cb9088102bce6b30: D0t,
            __wbindgen_cast_e7b45dd881f38ce3: F0t,
            __wbindgen_cast_2241b6af4c4b2941: M0t,
            __wbindgen_cast_d6cd19b81560fd6e: B0t
        }
    }, Hpt), z0t = he.memory, U0t = he.__wbg_chargedstate_free, H0t = he.__wbg_contractmaintenanceauthority_free, j0t = he.__wbg_contractoperation_free, q0t = he.__wbg_contractstate_free, W0t = he.__wbg_costmodel_free, K0t = he.__wbg_querycontext_free, $0t = he.__wbg_queryresults_free, X0t = he.__wbg_stateboundedmerkletree_free, G0t = he.__wbg_statemap_free, Z0t = he.__wbg_statevalue_free, J0t = he.__wbg_vmresults_free, Y0t = he.__wbg_vmstack_free, Q0t = he.bigIntModFr, egt = he.bigIntToValue, tgt = he.chargedstate_new, ngt = he.chargedstate_state, rgt = he.chargedstate_toString, sgt = he.communicationCommitment, igt = he.communicationCommitmentRandomness, ogt = he.contractmaintenanceauthority_committee, agt = he.contractmaintenanceauthority_counter, cgt = he.contractmaintenanceauthority_deserialize, lgt = he.contractmaintenanceauthority_new, ugt = he.contractmaintenanceauthority_serialize, dgt = he.contractmaintenanceauthority_threshold, fgt = he.contractmaintenanceauthority_toString, pgt = he.contractoperation_deserialize, hgt = he.contractoperation_new, ggt = he.contractoperation_serialize, bgt = he.contractoperation_set_verifier_key, mgt = he.contractoperation_toString, ygt = he.contractoperation_verifier_key, wgt = he.contractstate_balance, _gt = he.contractstate_data, xgt = he.contractstate_deserialize, vgt = he.contractstate_maintenance_authority, Sgt = he.contractstate_new, kgt = he.contractstate_operation, Tgt = he.contractstate_operations, Cgt = he.contractstate_query, Egt = he.contractstate_serialize, Igt = he.contractstate_setOperation, Agt = he.contractstate_set_balance, Pgt = he.contractstate_set_data, Ogt = he.contractstate_set_maintenance_authority, Mgt = he.contractstate_toString, Rgt = he.costmodel_initialCostModel, Ngt = he.costmodel_new, Vgt = he.costmodel_toString, Dgt = he.decodeCoinPublicKey, Bgt = he.decodeContractAddress, Fgt = he.decodeQualifiedShieldedCoinInfo, Lgt = he.decodeRawTokenType, zgt = he.decodeShieldedCoinInfo, Ugt = he.decodeUserAddress, Hgt = he.degradeToTransient, jgt = he.dummyContractAddress, qgt = he.dummyUserAddress, Wgt = he.ecAdd, Kgt = he.ecMul, $gt = he.ecMulGenerator, Xgt = he.encodeCoinPublicKey, Ggt = he.encodeContractAddress, Zgt = he.encodeQualifiedShieldedCoinInfo, Jgt = he.encodeRawTokenType, Ygt = he.encodeShieldedCoinInfo, Qgt = he.encodeUserAddress, ebt = he.entryPointHash, tbt = he.hashToCurve, nbt = he.leafHash, rbt = he.maxAlignedSize, sbt = he.maxField, ibt = he.persistentCommit, obt = he.persistentHash, abt = he.proofDataIntoSerializedPreimage, cbt = he.querycontext_address, lbt = he.querycontext_block, ubt = he.querycontext_com_indices, dbt = he.querycontext_effects, fbt = he.querycontext_insertCommitment, pbt = he.querycontext_new, hbt = he.querycontext_qualify, gbt = he.querycontext_query, bbt = he.querycontext_runTranscript, mbt = he.querycontext_set_block, ybt = he.querycontext_set_effects, wbt = he.querycontext_state, _bt = he.querycontext_toString, xbt = he.querycontext_toVmStack, vbt = he.queryresults_context, Sbt = he.queryresults_events, kbt = he.queryresults_gas_cost, Tbt = he.queryresults_new, Cbt = he.queryresults_toString, Ebt = he.rawTokenType, Ibt = he.runProgram, Abt = he.runtimeCoinCommitment, Pbt = he.runtimeCoinNullifier, Obt = he.sampleContractAddress, Mbt = he.sampleRawTokenType, Rbt = he.sampleSigningKey, Nbt = he.sampleUserAddress, Vbt = he.signData, Dbt = he.signatureVerifyingKey, Bbt = he.signingKeyFromBip340, Fbt = he.stateboundedmerkletree_blank, Lbt = he.stateboundedmerkletree_collapse, zbt = he.stateboundedmerkletree_findPathForLeaf, Ubt = he.stateboundedmerkletree_height, Hbt = he.stateboundedmerkletree_pathForLeaf, jbt = he.stateboundedmerkletree_rehash, qbt = he.stateboundedmerkletree_root, Wbt = he.stateboundedmerkletree_toString, Kbt = he.stateboundedmerkletree_update, $bt = he.statemap_get, Xbt = he.statemap_insert, Gbt = he.statemap_keys, Zbt = he.statemap_new, Jbt = he.statemap_remove, Ybt = he.statemap_toString, Qbt = he.statevalue_arrayPush, emt = he.statevalue_asArray, tmt = he.statevalue_asBoundedMerkleTree, nmt = he.statevalue_asCell, rmt = he.statevalue_asMap, smt = he.statevalue_decode, imt = he.statevalue_encode, omt = he.statevalue_logSize, amt = he.statevalue_new, cmt = he.statevalue_newArray, lmt = he.statevalue_newBoundedMerkleTree, umt = he.statevalue_newCell, dmt = he.statevalue_newMap, fmt = he.statevalue_newNull, pmt = he.statevalue_toString, hmt = he.statevalue_type, gmt = he.transientCommit, bmt = he.transientHash, mmt = he.upgradeFromTransient, ymt = he.valueToBigInt, wmt = he.verifySignature, _mt = he.vmresults_events, xmt = he.vmresults_gas_cost, vmt = he.vmresults_new, Smt = he.vmresults_stack, kmt = he.vmresults_toString, Tmt = he.vmstack_get, Cmt = he.vmstack_isStrong, Emt = he.vmstack_length, Imt = he.vmstack_new, Amt = he.vmstack_push, Pmt = he.vmstack_removeLast, Omt = he.vmstack_toString, Mmt = he.__wbg_intounderlyingbytesource_free, Rmt = he.__wbg_intounderlyingsink_free, Nmt = he.__wbg_intounderlyingsource_free, Vmt = he.intounderlyingbytesource_autoAllocateChunkSize, Dmt = he.intounderlyingbytesource_cancel, Bmt = he.intounderlyingbytesource_pull, Fmt = he.intounderlyingbytesource_start, Lmt = he.intounderlyingbytesource_type, zmt = he.intounderlyingsink_abort, Umt = he.intounderlyingsink_close, Hmt = he.intounderlyingsink_write, jmt = he.intounderlyingsource_cancel, qmt = he.intounderlyingsource_pull, Wmt = he.__wbindgen_exn_store, Kmt = he.__externref_table_alloc, $mt = he.__wbindgen_export_2, Xmt = he.__wbindgen_malloc, Gmt = he.__wbindgen_realloc, Zmt = he.__wbindgen_export_5, Jmt = he.__externref_table_dealloc, Ymt = he.__wbindgen_free, Qmt = he.__externref_drop_slice, eyt = he.closure567_externref_shim, tyt = he.closure607_externref_shim, Ite = he.__wbindgen_start, nyt = Object.freeze(Object.defineProperty({
        __proto__: null,
        __externref_drop_slice: Qmt,
        __externref_table_alloc: Kmt,
        __externref_table_dealloc: Jmt,
        __wbg_chargedstate_free: U0t,
        __wbg_contractmaintenanceauthority_free: H0t,
        __wbg_contractoperation_free: j0t,
        __wbg_contractstate_free: q0t,
        __wbg_costmodel_free: W0t,
        __wbg_intounderlyingbytesource_free: Mmt,
        __wbg_intounderlyingsink_free: Rmt,
        __wbg_intounderlyingsource_free: Nmt,
        __wbg_querycontext_free: K0t,
        __wbg_queryresults_free: $0t,
        __wbg_stateboundedmerkletree_free: X0t,
        __wbg_statemap_free: G0t,
        __wbg_statevalue_free: Z0t,
        __wbg_vmresults_free: J0t,
        __wbg_vmstack_free: Y0t,
        __wbindgen_exn_store: Wmt,
        __wbindgen_export_2: $mt,
        __wbindgen_export_5: Zmt,
        __wbindgen_free: Ymt,
        __wbindgen_malloc: Xmt,
        __wbindgen_realloc: Gmt,
        __wbindgen_start: Ite,
        bigIntModFr: Q0t,
        bigIntToValue: egt,
        chargedstate_new: tgt,
        chargedstate_state: ngt,
        chargedstate_toString: rgt,
        closure567_externref_shim: eyt,
        closure607_externref_shim: tyt,
        communicationCommitment: sgt,
        communicationCommitmentRandomness: igt,
        contractmaintenanceauthority_committee: ogt,
        contractmaintenanceauthority_counter: agt,
        contractmaintenanceauthority_deserialize: cgt,
        contractmaintenanceauthority_new: lgt,
        contractmaintenanceauthority_serialize: ugt,
        contractmaintenanceauthority_threshold: dgt,
        contractmaintenanceauthority_toString: fgt,
        contractoperation_deserialize: pgt,
        contractoperation_new: hgt,
        contractoperation_serialize: ggt,
        contractoperation_set_verifier_key: bgt,
        contractoperation_toString: mgt,
        contractoperation_verifier_key: ygt,
        contractstate_balance: wgt,
        contractstate_data: _gt,
        contractstate_deserialize: xgt,
        contractstate_maintenance_authority: vgt,
        contractstate_new: Sgt,
        contractstate_operation: kgt,
        contractstate_operations: Tgt,
        contractstate_query: Cgt,
        contractstate_serialize: Egt,
        contractstate_setOperation: Igt,
        contractstate_set_balance: Agt,
        contractstate_set_data: Pgt,
        contractstate_set_maintenance_authority: Ogt,
        contractstate_toString: Mgt,
        costmodel_initialCostModel: Rgt,
        costmodel_new: Ngt,
        costmodel_toString: Vgt,
        decodeCoinPublicKey: Dgt,
        decodeContractAddress: Bgt,
        decodeQualifiedShieldedCoinInfo: Fgt,
        decodeRawTokenType: Lgt,
        decodeShieldedCoinInfo: zgt,
        decodeUserAddress: Ugt,
        degradeToTransient: Hgt,
        dummyContractAddress: jgt,
        dummyUserAddress: qgt,
        ecAdd: Wgt,
        ecMul: Kgt,
        ecMulGenerator: $gt,
        encodeCoinPublicKey: Xgt,
        encodeContractAddress: Ggt,
        encodeQualifiedShieldedCoinInfo: Zgt,
        encodeRawTokenType: Jgt,
        encodeShieldedCoinInfo: Ygt,
        encodeUserAddress: Qgt,
        entryPointHash: ebt,
        hashToCurve: tbt,
        intounderlyingbytesource_autoAllocateChunkSize: Vmt,
        intounderlyingbytesource_cancel: Dmt,
        intounderlyingbytesource_pull: Bmt,
        intounderlyingbytesource_start: Fmt,
        intounderlyingbytesource_type: Lmt,
        intounderlyingsink_abort: zmt,
        intounderlyingsink_close: Umt,
        intounderlyingsink_write: Hmt,
        intounderlyingsource_cancel: jmt,
        intounderlyingsource_pull: qmt,
        leafHash: nbt,
        maxAlignedSize: rbt,
        maxField: sbt,
        memory: z0t,
        persistentCommit: ibt,
        persistentHash: obt,
        proofDataIntoSerializedPreimage: abt,
        querycontext_address: cbt,
        querycontext_block: lbt,
        querycontext_com_indices: ubt,
        querycontext_effects: dbt,
        querycontext_insertCommitment: fbt,
        querycontext_new: pbt,
        querycontext_qualify: hbt,
        querycontext_query: gbt,
        querycontext_runTranscript: bbt,
        querycontext_set_block: mbt,
        querycontext_set_effects: ybt,
        querycontext_state: wbt,
        querycontext_toString: _bt,
        querycontext_toVmStack: xbt,
        queryresults_context: vbt,
        queryresults_events: Sbt,
        queryresults_gas_cost: kbt,
        queryresults_new: Tbt,
        queryresults_toString: Cbt,
        rawTokenType: Ebt,
        runProgram: Ibt,
        runtimeCoinCommitment: Abt,
        runtimeCoinNullifier: Pbt,
        sampleContractAddress: Obt,
        sampleRawTokenType: Mbt,
        sampleSigningKey: Rbt,
        sampleUserAddress: Nbt,
        signData: Vbt,
        signatureVerifyingKey: Dbt,
        signingKeyFromBip340: Bbt,
        stateboundedmerkletree_blank: Fbt,
        stateboundedmerkletree_collapse: Lbt,
        stateboundedmerkletree_findPathForLeaf: zbt,
        stateboundedmerkletree_height: Ubt,
        stateboundedmerkletree_pathForLeaf: Hbt,
        stateboundedmerkletree_rehash: jbt,
        stateboundedmerkletree_root: qbt,
        stateboundedmerkletree_toString: Wbt,
        stateboundedmerkletree_update: Kbt,
        statemap_get: $bt,
        statemap_insert: Xbt,
        statemap_keys: Gbt,
        statemap_new: Zbt,
        statemap_remove: Jbt,
        statemap_toString: Ybt,
        statevalue_arrayPush: Qbt,
        statevalue_asArray: emt,
        statevalue_asBoundedMerkleTree: tmt,
        statevalue_asCell: nmt,
        statevalue_asMap: rmt,
        statevalue_decode: smt,
        statevalue_encode: imt,
        statevalue_logSize: omt,
        statevalue_new: amt,
        statevalue_newArray: cmt,
        statevalue_newBoundedMerkleTree: lmt,
        statevalue_newCell: umt,
        statevalue_newMap: dmt,
        statevalue_newNull: fmt,
        statevalue_toString: pmt,
        statevalue_type: hmt,
        transientCommit: gmt,
        transientHash: bmt,
        upgradeFromTransient: mmt,
        valueToBigInt: ymt,
        verifySignature: wmt,
        vmresults_events: _mt,
        vmresults_gas_cost: xmt,
        vmresults_new: vmt,
        vmresults_stack: Smt,
        vmresults_toString: kmt,
        vmstack_get: Tmt,
        vmstack_isStrong: Cmt,
        vmstack_length: Emt,
        vmstack_new: Imt,
        vmstack_push: Amt,
        vmstack_removeLast: Pmt,
        vmstack_toString: Omt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    jpt(nyt);
    Ite();
    dxt = Xpt();
    fxt = $pt();
    ryt = /^([0-9A-Fa-f]{2})*$/;
    Ate = 32;
    pxt = function(t) {
        return typeof t == "string" && t.length === Ate * 2 && ryt.test(t);
    };
    hxt = function(t) {
        return typeof t == "object" && t !== null && t !== void 0 && "bytes" in t && t.bytes instanceof Uint8Array && t.bytes.length == Ate;
    };
    dg = (t)=>Buffer.from(t, "hex");
    lw = (t)=>Buffer.from(t).toString("hex");
    Pi([
        "click"
    ]);
    var syt = Q('<div class="flex items-center gap-3 py-1.5"><span class="text-xs font-medium text-content-muted font-mono">#</span><div class="flex-1 h-1 bg-border overflow-hidden rounded-full"><div class="h-full bg-foreground rounded-full"></div></div><span class="text-xs font-mono text-foreground">'), iyt = Q('<p class="text-[10px] text-center text-content-muted-light py-1 uppercase">+<!> more coins'), oyt = Q('<section class="flex flex-col p-4 gap-2 bg-background rounded-lg shrink-0 lg:hidden"><div class="flex items-center justify-between"><div class="flex flex-row items-center gap-1"><div class="w-1.5 h-2.5 bg-border shrink-0"></div><span class="text-sm text-content-muted">DUST COINS</span></div><span class="text-xs text-content-muted-light font-mono"> TOTAL</span></div><div class="max-h-[100px] overflow-y-auto">'), ayt = Q('<div class="bg-rose-500/10 border border-rose-500/20 text-rose-500 rounded-lg text-sm p-3">'), cyt = Q('<div class="flex items-center justify-center gap-2 py-1"><div class="w-3 h-3 border-2 border-content-muted-light border-t-transparent rounded-full animate-spin"></div><p class="text-xs text-content-muted-light">Syncing with the network...'), lyt = Q('<div class="flex flex-col w-full gap-2 p-2"><section class="flex flex-col p-4 gap-3 bg-background rounded-lg shrink-0"><div class="flex flex-row items-center gap-1"><div class="w-1.5 h-2.5 bg-border shrink-0"></div><span class="text-sm text-content-muted">DUST OVERVIEW</span></div><div class="grid grid-cols-3 gap-2"><div class="flex flex-col items-center p-3 bg-card rounded-md"><p class="text-xl font-bold font-mono text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">Total</p></div><div class="flex flex-col items-center p-3 bg-card rounded-md"><p class="text-xl font-bold font-mono text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">Available</p></div><div class="flex flex-col items-center p-3 bg-card rounded-md"><p class="text-xl font-bold font-mono text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">Maturing</p></div></div></section><section class="flex flex-col p-4 gap-2 bg-card shrink-0"><div class="flex flex-row items-center gap-1 mb-1"><div class="w-1.5 h-2.5 bg-border shrink-0"></div><span class="text-sm text-content-muted">BALANCE BREAKDOWN</span></div><div class="flex justify-between items-center"><span class="text-sm text-content-muted-light">Available Balance</span><span class="text-sm font-mono font-medium text-foreground"> DUST</span></div><div class="flex justify-between items-center"><span class="text-sm text-content-muted-light">Pending Maturity</span><span class="text-sm font-mono font-medium text-content-muted-light"> DUST</span></div><div class="border-t border-border pt-2 mt-1"><div class="flex justify-between items-center"><span class="text-sm font-medium text-content-muted-dark">Total Balance</span><span class="text-base font-mono font-bold text-foreground"> DUST</span></div></div></section><section class="flex flex-col p-4 gap-3 bg-card border border-border rounded-lg shrink-0"><div class="flex flex-row items-center gap-1"><div class="w-1.5 h-2.5 bg-border shrink-0"></div><span class="text-sm text-content-muted">DUST GENERATION</span></div><p class="text-xs text-icon-muted">Register unshielded NIGHT UTXOs to generate DUST. Only NIGHT tokens can be used for dust generation.</p><div class="grid grid-cols-2 gap-2"><div class="flex flex-col p-3 bg-background rounded-md"><p class="text-lg font-mono font-bold text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">NIGHT Balance</p></div><div class="flex flex-col p-3 bg-background rounded-md"><p class="text-lg font-mono font-bold text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">NIGHT UTXOs Available</p></div></div></section><section class="flex flex-col p-4 gap-6 bg-card rounded-t-lg rounded-b-[4px] shrink-0"><div class="flex flex-col gap-2"><button class="flex flex-row justify-center items-center gap-2 text-base text-content-muted-light hover:text-content-muted transition-colors lg:hidden"title="Open full view"aria-label="Open full view"><i class="icon-box w-[14px] h-[14px] text-content-muted"></i>Open Full View'), uyt = Q('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full">');
    const dyt = (t)=>{
        const { formatBalance: e } = lr(), n = ()=>{
            const r = Number(t.coin.generatedNow), s = Number(t.coin.maxCap);
            return s > 0 ? Math.min(r / s * 100, 100) : 0;
        };
        return (()=>{
            var r = syt(), s = r.firstChild;
            s.firstChild;
            var i = s.nextSibling, o = i.firstChild, a = i.nextSibling;
            return F(s, ()=>t.index + 1, null), F(a, ()=>e(t.coin.generatedNow, 4, "DUST")), pt((c)=>Vf(o, "width", `${n()}%`)), r;
        })();
    }, fyt = ()=>{
        typeof xi < "u" ? xi.tabs.create({
            url: xi.runtime.getURL("/fullpage.html")
        }) : typeof chrome < "u" && chrome.tabs.create({
            url: chrome.runtime.getURL("/fullpage.html")
        });
    }, pyt = ()=>{
        const [t, e] = pe(void 0), { dustCoins: n, dustBalance: r, unshieldedBalances: s, availableUtxoForDustGeneration: i, isGeneratingDust: o, dustGenerationError: a, startDustGeneration: c, formatBalance: l, isSynced: u } = lr(), d = "0000000000000000000000000000000000000000000000000000000000000000", f = ()=>s().get(d) ?? 0n, p = Ct(()=>{
            const h = n(), m = h.filter((_)=>_.maxCapReachedAt <= new Date), w = h.filter((_)=>_.maxCapReachedAt > new Date), v = h.reduce((_, A)=>_ + A.maxCap, 0n), k = h.reduce((_, A)=>_ + A.generatedNow, 0n);
            return {
                totalCoins: h.length,
                availableCoins: m.length,
                pendingCoins: w.length,
                totalValue: v,
                availableValue: k,
                pendingValue: v - k
            };
        });
        return (()=>{
            var h = lyt(), m = h.firstChild, w = m.firstChild, v = w.nextSibling, k = v.firstChild, _ = k.firstChild, A = k.nextSibling, P = A.firstChild, U = A.nextSibling, K = U.firstChild, X = m.nextSibling, G = X.firstChild, ce = G.nextSibling, ie = ce.firstChild, Y = ie.nextSibling, M = Y.firstChild, g = ce.nextSibling, y = g.firstChild, C = y.nextSibling, R = C.firstChild, N = g.nextSibling, L = N.firstChild, z = L.firstChild, B = z.nextSibling, x = B.firstChild, O = X.nextSibling, q = O.firstChild, H = q.nextSibling, Z = H.nextSibling, te = Z.firstChild, J = te.firstChild, se = te.nextSibling, fe = se.firstChild, ge = O.nextSibling, Ce = ge.firstChild, Ue = Ce.firstChild, Ie = Ue.firstChild;
            return F(_, ()=>p().totalCoins), F(P, ()=>p().availableCoins), F(K, ()=>p().pendingCoins), F(Y, ()=>l(p().availableValue, 4, "DUST"), M), F(C, ()=>l(p().pendingValue, 4, "DUST"), R), F(B, ()=>l(r(), 4, "DUST"), x), F(J, ()=>l(f())), F(fe, i), F(O, I(og, {
                get value () {
                    return t();
                },
                onChange: (Le)=>e(Le.toString()),
                class: "w-full",
                get children () {
                    return I(Vy, {
                        placeholder: "DESIGNATED DUST ADDRESS (OPTIONAL)",
                        class: "text-sm font-medium bg-transparent border border-border px-3 h-[38px] text-content-muted-light uppercase focus-visible:ring-0 focus-visible:ring-offset-0"
                    });
                }
            }), null), F(h, I(de, {
                get when () {
                    return n().length > 0;
                },
                get children () {
                    var Le = oyt(), Ge = Le.firstChild, Ve = Ge.firstChild, Ne = Ve.nextSibling, be = Ne.firstChild, Qe = Ge.nextSibling;
                    return F(Ne, ()=>n().length, be), F(Qe, I(_r, {
                        get each () {
                            return n().slice(0, 3);
                        },
                        children: (le, De)=>I(dyt, {
                                coin: le,
                                get index () {
                                    return De();
                                }
                            })
                    }), null), F(Qe, I(de, {
                        get when () {
                            return n().length > 3;
                        },
                        get children () {
                            var le = iyt(), De = le.firstChild, Re = De.nextSibling;
                            return Re.nextSibling, F(le, ()=>n().length - 3, Re), le;
                        }
                    }), null), Le;
                }
            }), ge), F(Ce, I(de, {
                get when () {
                    return a();
                },
                get children () {
                    var Le = ayt();
                    return F(Le, a), Le;
                }
            }), Ue), F(Ce, I(de, {
                get when () {
                    return !u();
                },
                get children () {
                    return cyt();
                }
            }), Ue), F(Ce, I($r, {
                variant: "submit",
                size: "submit",
                onClick: ()=>c(t()),
                get disabled () {
                    return !u() || o() || i() === 0;
                },
                title: "Generate DUST",
                "aria-label": "Generate DUST",
                get children () {
                    return I(de, {
                        get when () {
                            return !o();
                        },
                        get fallback () {
                            return [
                                uyt(),
                                "Generating..."
                            ];
                        },
                        children: "GENERATE DUST"
                    });
                }
            }), Ue), Ue.$$click = fyt, F(Ie, I(wlt, {})), h;
        })();
    };
    Pi([
        "click"
    ]);
    var hyt = Q("<span>🤝"), gyt = Q('<div class="bg-rose-500/10 border border-rose-500/20 text-rose-500 p-3 rounded-lg text-sm">'), byt = Q('<div class=space-y-4><div class="bg-muted/50 rounded-lg p-4"><div class="flex items-center justify-between mb-2"><span class="text-sm text-muted-foreground">Using Dust Coin</span><span class="text-xs font-mono text-muted-foreground"></span></div><div class="flex items-baseline justify-between"><span class="text-2xl font-mono font-bold"></span><span class="text-sm text-muted-foreground">DUST available</span></div></div><div class="border-2 border-dashed border-border rounded-lg p-4 transition-colors hover:border-primary/50"></div><div class="bg-rose-500/10 border border-rose-500/20 rounded-lg p-3"><div class="flex items-start gap-2"><svg class="w-4 h-4 text-rose-500 shrink-0 mt-0.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><div class="text-xs text-rose-700"><p class="font-semibold mb-1">Warning: This will sign and submit a raw transaction</p><p>A malicious transaction could drain your wallet. Only proceed if you trust the source and have verified the transaction contents.</p></div></div></div><label class="flex items-start gap-3 p-3 rounded-lg border border-[#E9EAEB] cursor-pointer hover:border-primary transition-colors"><input type=checkbox class="w-4 h-4 mt-0.5 rounded border-gray-300"><span class="text-xs text-muted-foreground">I understand the risk. I trust the source of this transaction and want to sign and submit it with my wallet.</span></label><div class="flex gap-3">'), myt = Q('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full mr-2">');
    const yyt = (t)=>{
        const { formatBalance: e, getWallet: n, getDustSecretKey: r, getZswapSecretKeys: s, acquireTxLock: i, releaseTxLock: o } = lr(), [a, c] = pe(""), [l, u] = pe(!1), [d, f] = pe(null), [p, h] = pe(!1), m = (_)=>{
            _.preventDefault();
            const A = _.dataTransfer?.files[0];
            if (A) {
                const P = new FileReader;
                P.onload = (U)=>{
                    const K = U.target?.result;
                    c(K);
                }, P.readAsText(A);
            }
        }, w = (_)=>{
            _.preventDefault();
        }, v = async ()=>{
            if (!a().trim()) {
                f("Please paste or drop a serialized transaction");
                return;
            }
            if (!p()) {
                f("You must confirm that you trust the source of this transaction");
                return;
            }
            if (!await i(0)) {
                f("Another transaction is in progress");
                return;
            }
            u(!0), f(null);
            let A = !1;
            try {
                const P = n();
                if (!P) throw new Error("Wallet not found");
                const U = await s(), K = await r();
                if (!U || !K) throw new Error("Zswap secret key or dust secret key not found");
                const X = _n.deserialize("signature", "proof", "binding", dg(a())), G = await P.balanceFinalizedTransaction(X, {
                    shieldedSecretKeys: U,
                    dustSecretKey: K
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3)
                }), ce = await P.finalizeRecipe(G);
                A = !0;
                const ie = await P.submitTransaction(ce);
            } catch (P) {
                f(A ? "Transaction status uncertain — it may have been submitted. Do not retry." : P instanceof Error ? P.message : "Failed to sponsor transaction");
            } finally{
                u(!1), o();
            }
        }, k = ()=>{
            c(""), f(null), h(!1), t.onClose();
        };
        return I(nw, {
            get open () {
                return t.open;
            },
            onOpenChange: (_)=>!_ && k(),
            get children () {
                return I(rw, {
                    class: "max-w-lg",
                    get children () {
                        return [
                            I(Udt, {
                                get children () {
                                    return [
                                        I(Hdt, {
                                            class: "flex items-center gap-2",
                                            get children () {
                                                return [
                                                    hyt(),
                                                    "Sponsor a Transaction"
                                                ];
                                            }
                                        }),
                                        I(jdt, {
                                            children: "Pay transaction fees for another user using your DUST"
                                        })
                                    ];
                                }
                            }),
                            I(de, {
                                get when () {
                                    return t.selectedCoin;
                                },
                                get children () {
                                    var _ = byt(), A = _.firstChild, P = A.firstChild, U = P.nextSibling, K = U.firstChild, X = A.nextSibling, G = X.nextSibling, ce = G.nextSibling, ie = ce.firstChild, Y = ce.nextSibling;
                                    return F(K, ()=>e(t.selectedCoin.generatedNow, 4, "DUST")), X.addEventListener("dragover", w), X.addEventListener("drop", m), F(X, I(og, {
                                        get value () {
                                            return a();
                                        },
                                        onChange: c,
                                        get children () {
                                            return [
                                                I(YQ, {
                                                    children: "Serialized UnbalancedTransaction"
                                                }),
                                                I(sot, {
                                                    placeholder: "Paste the serialized transaction here, or drag & drop a file...",
                                                    class: "min-h-[150px] font-mono text-xs"
                                                })
                                            ];
                                        }
                                    })), F(_, I(de, {
                                        get when () {
                                            return d();
                                        },
                                        get children () {
                                            var M = gyt();
                                            return F(M, d), M;
                                        }
                                    }), G), ie.addEventListener("change", (M)=>h(M.currentTarget.checked)), F(Y, I($r, {
                                        variant: "outline",
                                        onClick: k,
                                        class: "flex-1",
                                        title: "Cancel",
                                        "aria-label": "Cancel",
                                        children: "Cancel"
                                    }), null), F(Y, I($r, {
                                        variant: "submit",
                                        size: "submit",
                                        onClick: v,
                                        get disabled () {
                                            return l() || !a().trim();
                                        },
                                        class: "flex-1",
                                        title: "Balance and submit",
                                        "aria-label": "Balance and submit",
                                        get children () {
                                            return I(de, {
                                                get when () {
                                                    return !l();
                                                },
                                                get fallback () {
                                                    return [
                                                        myt(),
                                                        "Processing..."
                                                    ];
                                                },
                                                children: "Balance & Submit"
                                            });
                                        }
                                    }), null), pt(()=>ie.checked = p()), _;
                                }
                            })
                        ];
                    }
                });
            }
        });
    };
    var wyt = Q('<button class="w-full h-9 flex items-center justify-center bg-background rounded-md text-xs font-semibold text-content-muted uppercase hover:bg-muted transition-colors"title="Sponsor a transaction"aria-label="Sponsor a transaction">SPONSOR TRANSACTION'), _yt = Q('<div class="flex flex-col p-3 bg-card border border-border rounded-md gap-2"><div class="flex items-center justify-between"><div class="flex items-center gap-2"><span class="text-sm font-medium text-foreground">DUST #</span><span class="text-[10px] text-icon-muted font-mono truncate max-w-[120px]">...</span></div><span></span></div><div class="flex items-baseline justify-between"><span class="text-lg font-bold text-foreground font-mono"></span><span class="text-xs text-icon-muted font-mono">/ <!> DUST</span></div><div class="h-1 bg-border-secondary rounded-full overflow-hidden"><div class="h-full bg-foreground rounded-full transition-all"></div></div><p class="text-[10px] text-icon-muted font-mono text-right">% GENERATED'), xyt = Q('<div class="grid grid-cols-2 gap-2"><div class="flex flex-col items-center p-2 bg-card rounded-md"><p class="text-lg font-bold font-mono text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">Ready</p></div><div class="flex flex-col items-center p-2 bg-card rounded-md"><p class="text-lg font-bold font-mono text-foreground"></p><p class="text-[10px] text-content-muted-light uppercase">Maturing'), vyt = Q('<div class="flex flex-col gap-2">'), Syt = Q('<div class="flex items-center justify-center gap-2 py-2"><div class="w-3 h-3 border-2 border-fg-quaternary border-t-transparent rounded-full animate-spin"></div><p class="text-xs text-icon-muted uppercase">Syncing... Coin data may be incomplete.'), kyt = Q('<div class="flex flex-col w-full gap-2 p-2"><section class="flex flex-col p-4 gap-3 bg-background rounded-lg shrink-0"><div class="flex items-center justify-between"><div class="flex flex-row items-center gap-1"><div class="w-1.5 h-2.5 bg-fg-disabled-subtle shrink-0"></div><span class="text-sm text-content-muted">YOUR DUST COINS</span></div><span class="text-xs font-mono text-content-muted-light"> DUST AVAILABLE</span></div></section><section class="flex flex-col p-4 gap-3 bg-card rounded-lg shrink-0 max-h-[400px] overflow-y-auto">'), Tyt = Q('<div class="flex flex-col items-center justify-center py-12 text-content-muted-light"><p class="text-sm uppercase">No dust coins yet</p><p class="text-xs mt-1 text-icon-muted">Generate DUST to see your coins here');
    const Cyt = (t)=>{
        const { formatBalance: e } = lr(), n = ()=>{
            const i = new Date, o = t.coin.maxCapReachedAt.getTime() - i.getTime();
            if (o <= 0) return null;
            const a = Math.floor(o / 6e4), c = Math.floor(o / 36e5), l = Math.floor(o / 864e5);
            return l > 0 ? `${l}d ${c % 24}h` : c > 0 ? `${c}h ${a % 60}m` : `${a}m`;
        }, r = ()=>t.coin.maxCapReachedAt <= new Date, s = ()=>{
            const i = Number(t.coin.generatedNow), o = Number(t.coin.maxCap);
            return o > 0 ? Math.min(i / o * 100, 100) : 0;
        };
        return (()=>{
            var i = _yt(), o = i.firstChild, a = o.firstChild, c = a.firstChild;
            c.firstChild;
            var l = c.nextSibling, u = l.firstChild, d = a.nextSibling, f = o.nextSibling, p = f.firstChild, h = p.nextSibling, m = h.firstChild, w = m.nextSibling;
            w.nextSibling;
            var v = f.nextSibling, k = v.firstChild, _ = v.nextSibling, A = _.firstChild;
            return F(c, ()=>t.index + 1, null), F(l, ()=>t.coin.token.backingNight.slice(0, 6), u), F(l, ()=>t.coin.token.backingNight.slice(-4), null), F(d, (()=>{
                var P = Ze(()=>!!r());
                return ()=>P() ? "READY" : n();
            })()), F(p, ()=>e(t.coin.generatedNow, 4, "DUST")), F(h, ()=>e(t.coin.maxCap, 4, "DUST"), w), F(_, ()=>s().toFixed(1), A), F(i, I(de, {
                get when () {
                    return r();
                },
                get children () {
                    var P = wyt();
                    return P.$$click = ()=>t.onSponsorClick(t.coin), P;
                }
            }), null), pt((P)=>{
                var U = t.coin.token.backingNight, K = `text-xs px-2 py-0.5 rounded-md font-medium ${r() ? "bg-background text-foreground" : "bg-background text-icon-muted"}`, X = `${s()}%`;
                return U !== P.e && Ot(l, "title", P.e = U), K !== P.t && Vt(d, P.t = K), X !== P.a && Vf(k, "width", P.a = X), P;
            }, {
                e: void 0,
                t: void 0,
                a: void 0
            }), i;
        })();
    }, Eyt = ()=>{
        const { dustCoins: t, isSynced: e, formatBalance: n } = lr(), [r, s] = pe(null), [i, o] = pe(!1), a = (d)=>{
            document.activeElement instanceof HTMLElement && document.activeElement.blur(), s(d), o(!0);
        }, c = ()=>{
            o(!1), s(null);
        }, l = ()=>t().reduce((d, f)=>d + f.generatedNow, 0n), u = ()=>t().filter((d)=>d.maxCapReachedAt <= new Date).length;
        return [
            (()=>{
                var d = kyt(), f = d.firstChild, p = f.firstChild, h = p.firstChild, m = h.nextSibling, w = m.firstChild, v = f.nextSibling;
                return F(m, ()=>n(l(), 4, "DUST"), w), F(f, I(de, {
                    get when () {
                        return t().length > 0;
                    },
                    get children () {
                        var k = xyt(), _ = k.firstChild, A = _.firstChild, P = _.nextSibling, U = P.firstChild;
                        return F(A, u), F(U, ()=>t().length - u()), k;
                    }
                }), null), F(v, I(de, {
                    get when () {
                        return t().length > 0;
                    },
                    get fallback () {
                        return Tyt();
                    },
                    get children () {
                        var k = vyt();
                        return F(k, I(_r, {
                            get each () {
                                return t();
                            },
                            children: (_, A)=>I(Cyt, {
                                    coin: _,
                                    get index () {
                                        return A();
                                    },
                                    onSponsorClick: a
                                })
                        })), k;
                    }
                }), null), F(v, I(de, {
                    get when () {
                        return !e();
                    },
                    get children () {
                        return Syt();
                    }
                }), null), d;
            })(),
            I(yyt, {
                get open () {
                    return i();
                },
                onClose: c,
                get selectedCoin () {
                    return r();
                }
            })
        ];
    };
    Pi([
        "click"
    ]);
    function RO() {
        return typeof window > "u" ? !1 : window.__ONE_AM_SHELL__ === "popup";
    }
    var Iyt = Q('<span aria-hidden=true class="pointer-events-none absolute inset-x-0 top-1/2 h-0 -translate-y-1/2 transition-[height] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover:h-full group-focus-visible:h-full motion-reduce:transition-none"style=background-color:var(--color-action-hover-surface)>'), Ayt = Q('<i class="icon-box relative z-10 w-[18px] h-[18px] text-fg-quaternary transition-colors duration-200 group-hover:text-fg-quaternary-hover group-focus-visible:text-fg-quaternary-hover">'), Pyt = Q('<span class="relative z-10 type-text-xs font-medium text-fg-secondary transition-colors duration-200 group-hover:text-fg-primary group-focus-visible:text-fg-primary">SEND');
    const Oyt = ()=>{
        const t = RO();
        return I(nw, {
            get children () {
                return [
                    I(R9, {
                        class: "group relative flex-1 flex flex-col items-center justify-center gap-1 min-h-[84px] py-2 px-3 sm:py-3 sm:px-6 border-r border-[var(--border-secondary)] overflow-hidden",
                        title: "Send",
                        "aria-label": "Send",
                        get children () {
                            return [
                                Iyt(),
                                (()=>{
                                    var e = Ayt();
                                    return F(e, I(vlt, {})), e;
                                })(),
                                Pyt()
                            ];
                        }
                    }),
                    I(rw, {
                        class: "border-0 p-0",
                        fullScreen: t,
                        get children () {
                            return I(Upt, {
                                edgeToEdge: t
                            });
                        }
                    })
                ];
            }
        });
    };
    var Myt = Q('<div aria-hidden=true class="pointer-events-none absolute inset-0"style="background-image:var(--color-diagonal-pattern);opacity:var(--shielded-pattern-opacity, 0.68)">'), Ryt = Q('<div class="relative flex flex-col items-center gap-2 py-4"><div class="bg-white p-3 rounded-xl shadow-md"><img class="w-[200px] h-[200px]"></div><p class="text-[10px] text-content-muted text-center break-all max-w-[240px]"style=font-family:var(--font-family-display)>'), Nyt = Q('<p class="relative break-all text-md leading-6 text-content-muted"style=font-family:var(--font-family-display)>'), Vyt = Q('<div><div class="relative flex items-center justify-between gap-4"><div><span class="flex h-5 w-4 items-center justify-center px-1"><i class="icon-box h-[14px] w-[14px] text-icon-muted"></i></span><span class="type-text-sm font-medium text-content-muted uppercase"></span></div><div class="flex items-center gap-1.5"><button><svg class="w-4 h-4"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><rect x=2 y=2 width=8 height=8 rx=1></rect><rect x=14 y=2 width=8 height=8 rx=1></rect><rect x=2 y=14 width=8 height=8 rx=1></rect><rect x=14 y=14 width=4 height=4></rect><rect x=20 y=14 width=2 height=2></rect><rect x=14 y=20 width=2 height=2></rect><rect x=20 y=20 width=2 height=2></rect></svg></button><button class="h-8 shrink-0 border border-input bg-card px-3 type-text-sm font-semibold text-content-muted-dark transition-colors hover:bg-grey-50 disabled:opacity-50 disabled:cursor-not-allowed">'), Dyt = Q('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class="w-full h-full"><circle cx=12 cy=12 r=2></circle><circle cx=12 cy=5 r=1></circle><circle cx=12 cy=19 r=1></circle><circle cx=5 cy=8.5 r=1></circle><circle cx=19 cy=8.5 r=1></circle><circle cx=5 cy=15.5 r=1></circle><circle cx=19 cy=15.5 r=1>'), Byt = Q('<i class="icon-box h-6 w-6">'), Fyt = Q('<div><h2 class="type-display-xs font-semibold text-header-foreground"></h2><div>'), Lyt = Q('<span aria-hidden=true class="pointer-events-none absolute inset-x-0 top-1/2 h-0 -translate-y-1/2 transition-[height] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover:h-full group-focus-visible:h-full motion-reduce:transition-none"style=background-color:var(--color-action-hover-surface)>'), zyt = Q('<i class="icon-box relative z-10 w-[18px] h-[18px] text-fg-quaternary transition-colors duration-200 group-hover:text-fg-quaternary-hover group-focus-visible:text-fg-quaternary-hover">'), Uyt = Q('<span class="relative z-10 type-text-xs font-medium text-fg-secondary transition-colors duration-200 group-hover:text-fg-primary group-focus-visible:text-fg-primary">RECEIVE'), Hyt = Q('<div class="flex flex-1 flex-col min-h-0 w-full overflow-y-auto bg-card">'), jyt = Q('<div class="px-1 pt-1">'), qyt = Q('<div class="px-1 pb-1"><div class="flex flex-col overflow-y-auto max-h-[70vh] bg-card border border-[var(--border-secondary)] rounded-tl-[8px] rounded-tr-[8px] rounded-bl-[4px] rounded-br-[4px]">');
    const Ku = (t)=>{
        const [e, n] = pe(!1), [r, s] = pe("");
        let i;
        It(()=>clearTimeout(i));
        const o = async ()=>{
            if (t.address) try {
                await navigator.clipboard.writeText(t.address), n(!0), clearTimeout(i), i = setTimeout(()=>n(!1), 2e3);
            } catch  {}
        }, a = async ()=>{
            if (t.address) {
                if (t.qrOpen) {
                    t.onToggleQr();
                    return;
                }
                try {
                    const l = await (await sr(async ()=>{
                        const { default: u } = await import("./browser-B0TqsPy-.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }).then((d)=>d.b);
                        return {
                            default: u
                        };
                    }, [])).default.toDataURL(t.address, {
                        width: 220,
                        margin: 2,
                        color: {
                            dark: "#000000",
                            light: "#ffffff"
                        }
                    });
                    s(l), t.onToggleQr();
                } catch  {}
            }
        };
        return (()=>{
            var c = Vyt(), l = c.firstChild, u = l.firstChild, d = u.firstChild, f = d.firstChild, p = d.nextSibling, h = u.nextSibling, m = h.firstChild, w = m.nextSibling;
            return F(c, I(de, {
                get when () {
                    return t.shielded;
                },
                get children () {
                    return Myt();
                }
            }), l), F(f, ()=>t.icon()), F(p, ()=>t.label), m.$$click = a, w.$$click = o, F(w, I(de, {
                get when () {
                    return e();
                },
                fallback: "COPY",
                children: "COPIED"
            })), F(c, I(de, {
                get when () {
                    return Ze(()=>!!t.qrOpen)() && r();
                },
                get children () {
                    var v = Ryt(), k = v.firstChild, _ = k.firstChild, A = k.nextSibling;
                    return F(A, ()=>t.address), pt((P)=>{
                        var U = r(), K = `QR code for ${t.label} address`;
                        return U !== P.e && Ot(_, "src", P.e = U), K !== P.t && Ot(_, "alt", P.t = K), P;
                    }, {
                        e: void 0,
                        t: void 0
                    }), v;
                }
            }), null), F(c, I(de, {
                get when () {
                    return Ze(()=>!t.qrOpen)() && !t.collapsed;
                },
                get children () {
                    var v = Nyt();
                    return F(v, ()=>t.address || "Syncing..."), v;
                }
            }), null), pt((v)=>{
                var k = xn("relative flex flex-col border-b border-[var(--border-secondary)] last:border-b-0", t.qrOpen ? "py-4 px-6" : t.collapsed ? "gap-0 px-8 py-3" : "gap-3 px-8 pt-6 pb-8", t.shielded && "overflow-hidden"), _ = xn("flex items-center gap-1 py-1.5", t.shielded && "border-y border-black/8 bg-card"), A = !t.address, P = `h-8 shrink-0 border px-2.5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${t.qrOpen ? "bg-white text-black border-white" : "border-input bg-card text-content-muted-dark hover:bg-grey-50"}`, U = `Show QR code for ${t.label} address`, K = `Show QR code for ${t.label} address`, X = !t.address, G = `Copy ${t.label} address`, ce = `Copy ${t.label} address`;
                return k !== v.e && Vt(c, v.e = k), _ !== v.t && Vt(u, v.t = _), A !== v.a && (m.disabled = v.a = A), P !== v.o && Vt(m, v.o = P), U !== v.i && Ot(m, "title", v.i = U), K !== v.n && Ot(m, "aria-label", v.n = K), X !== v.s && (w.disabled = v.s = X), G !== v.h && Ot(w, "title", v.h = G), ce !== v.r && Ot(w, "aria-label", v.r = ce), v;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0,
                n: void 0,
                s: void 0,
                h: void 0,
                r: void 0
            }), c;
        })();
    }, Zz = ()=>Dyt(), Jz = (t)=>(()=>{
            var e = Fyt(), n = e.firstChild, r = n.nextSibling;
            return F(n, ()=>t.title), F(r, I(tw, {
                class: "flex h-full w-full items-center justify-center text-icon-muted hover:bg-card/10 hover:text-header-foreground transition-colors outline-none cursor-pointer",
                title: "Close",
                "aria-label": "Close",
                get children () {
                    var s = Byt();
                    return F(s, I(cO, {})), s;
                }
            })), pt((s)=>{
                var i = xn("flex flex-row items-center justify-between h-16 pl-4 bg-bg-primary-solid shrink-0", t.popup ? "border-b border-header-divider" : "border-y border-header-divider rounded-tl-[4px] rounded-tr-[4px] rounded-bl-[8px] rounded-br-[8px]"), o = xn("ml-auto flex h-16 w-16 shrink-0 items-center justify-center", t.popup ? "border-l border-header-divider" : "border-x border-header-divider");
                return i !== s.e && Vt(e, s.e = i), o !== s.t && Vt(r, s.t = o), s;
            }, {
                e: void 0,
                t: void 0
            }), e;
        })(), Wyt = ()=>{
        const { shieldedAddress: t, unshieldedAddress: e, dustAddress: n, cardanoAddress: r, cardanoEnabled: s, environmentSettings: i } = lr(), o = RO(), [a, c] = pe(null), l = (d)=>c((f)=>f === d ? null : d), u = ()=>fg(i().environment) && s() && r();
        return I(nw, {
            get children () {
                return [
                    I(R9, {
                        class: "group relative flex-1 flex flex-col items-center justify-center gap-1 min-h-[84px] py-2 px-3 sm:py-3 sm:px-6 border-r border-[var(--border-secondary)] overflow-hidden",
                        title: "Receive",
                        "aria-label": "Receive",
                        get children () {
                            return [
                                Lyt(),
                                (()=>{
                                    var d = zyt();
                                    return F(d, I(ote, {})), d;
                                })(),
                                Uyt()
                            ];
                        }
                    }),
                    I(rw, {
                        class: o ? "flex flex-col p-0 border-0" : "max-w-[488px] flex flex-col p-0 border-0 bg-transparent",
                        fullScreen: o,
                        get children () {
                            return I(de, {
                                when: o,
                                get fallback () {
                                    return [
                                        (()=>{
                                            var d = jyt();
                                            return F(d, I(Jz, {
                                                title: "RECEIVE",
                                                popup: !1
                                            })), d;
                                        })(),
                                        (()=>{
                                            var d = qyt(), f = d.firstChild;
                                            return F(f, I(Ku, {
                                                label: "Shielded",
                                                icon: ()=>I(Ep, {}),
                                                get address () {
                                                    return t();
                                                },
                                                shielded: !0,
                                                get qrOpen () {
                                                    return a() === "Shielded";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Shielded";
                                                },
                                                onToggleQr: ()=>l("Shielded")
                                            }), null), F(f, I(Ku, {
                                                label: "Unshielded",
                                                icon: ()=>I(Ip, {}),
                                                get address () {
                                                    return e();
                                                },
                                                get qrOpen () {
                                                    return a() === "Unshielded";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Unshielded";
                                                },
                                                onToggleQr: ()=>l("Unshielded")
                                            }), null), F(f, I(Ku, {
                                                label: "Dust",
                                                icon: ()=>I(Dc, {
                                                        kind: "symbol",
                                                        class: "h-full w-full"
                                                    }),
                                                get address () {
                                                    return n();
                                                },
                                                get qrOpen () {
                                                    return a() === "Dust";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Dust";
                                                },
                                                onToggleQr: ()=>l("Dust")
                                            }), null), F(f, I(de, {
                                                get when () {
                                                    return u();
                                                },
                                                get children () {
                                                    return I(Ku, {
                                                        label: "Cardano",
                                                        icon: ()=>I(Zz, {}),
                                                        get address () {
                                                            return r();
                                                        },
                                                        get qrOpen () {
                                                            return a() === "Cardano";
                                                        },
                                                        get collapsed () {
                                                            return Ze(()=>a() !== null)() && a() !== "Cardano";
                                                        },
                                                        onToggleQr: ()=>l("Cardano")
                                                    });
                                                }
                                            }), null), d;
                                        })()
                                    ];
                                },
                                get children () {
                                    return [
                                        I(Jz, {
                                            title: "RECEIVE",
                                            popup: !0
                                        }),
                                        (()=>{
                                            var d = Hyt();
                                            return F(d, I(Ku, {
                                                label: "Shielded",
                                                icon: ()=>I(Ep, {}),
                                                get address () {
                                                    return t();
                                                },
                                                shielded: !0,
                                                get qrOpen () {
                                                    return a() === "Shielded";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Shielded";
                                                },
                                                onToggleQr: ()=>l("Shielded")
                                            }), null), F(d, I(Ku, {
                                                label: "Unshielded",
                                                icon: ()=>I(Ip, {}),
                                                get address () {
                                                    return e();
                                                },
                                                get qrOpen () {
                                                    return a() === "Unshielded";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Unshielded";
                                                },
                                                onToggleQr: ()=>l("Unshielded")
                                            }), null), F(d, I(Ku, {
                                                label: "Dust",
                                                icon: ()=>I(Dc, {
                                                        kind: "symbol",
                                                        class: "h-full w-full"
                                                    }),
                                                get address () {
                                                    return n();
                                                },
                                                get qrOpen () {
                                                    return a() === "Dust";
                                                },
                                                get collapsed () {
                                                    return Ze(()=>a() !== null)() && a() !== "Dust";
                                                },
                                                onToggleQr: ()=>l("Dust")
                                            }), null), F(d, I(de, {
                                                get when () {
                                                    return u();
                                                },
                                                get children () {
                                                    return I(Ku, {
                                                        label: "Cardano",
                                                        icon: ()=>I(Zz, {}),
                                                        get address () {
                                                            return r();
                                                        },
                                                        get qrOpen () {
                                                            return a() === "Cardano";
                                                        },
                                                        get collapsed () {
                                                            return Ze(()=>a() !== null)() && a() !== "Cardano";
                                                        },
                                                        onToggleQr: ()=>l("Cardano")
                                                    });
                                                }
                                            }), null), d;
                                        })()
                                    ];
                                }
                            });
                        }
                    })
                ];
            }
        });
    };
    Pi([
        "click"
    ]);
    var Kyt = Q('<span aria-hidden=true class="pointer-events-none absolute inset-x-0 top-1/2 h-0 -translate-y-1/2 transition-[height] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover:h-full group-focus-visible:h-full motion-reduce:transition-none"style=background-color:var(--color-action-hover-surface)>'), $yt = Q('<i class="icon-box relative z-10 w-[18px] h-[18px] text-fg-quaternary transition-colors duration-200 group-hover:text-fg-quaternary-hover group-focus-visible:text-fg-quaternary-hover">'), Xyt = Q('<span class="relative z-10 type-text-xs font-medium text-fg-secondary transition-colors duration-200 group-hover:text-fg-primary group-focus-visible:text-fg-primary">YOUR DUST'), Gyt = Q('<div class="flex-1 min-h-0 overflow-y-auto"><div class="grid grid-cols-1 lg:grid-cols-2">');
    const Zyt = ()=>{
        const t = RO();
        return I(nw, {
            get children () {
                return [
                    I(R9, {
                        class: "group relative flex-1 flex flex-col items-center justify-center gap-1 min-h-[84px] py-2 px-3 sm:py-3 sm:px-6 overflow-hidden",
                        title: "YOUR DUST",
                        "aria-label": "YOUR DUST",
                        get children () {
                            return [
                                Kyt(),
                                (()=>{
                                    var e = $yt();
                                    return F(e, I(Dc, {
                                        kind: "symbol",
                                        class: "h-full w-full"
                                    })), e;
                                })(),
                                Xyt()
                            ];
                        }
                    }),
                    I(rw, {
                        class: t ? "flex flex-col p-0 border-0" : "max-w-5xl flex flex-col p-0 border-0",
                        fullScreen: t,
                        get children () {
                            return [
                                I(fte, {
                                    title: "YOUR DUST",
                                    noBorder: t,
                                    class: "bg-bg-primary-solid"
                                }),
                                (()=>{
                                    var e = Gyt(), n = e.firstChild;
                                    return F(n, I(pyt, {}), null), F(n, I(Eyt, {}), null), e;
                                })()
                            ];
                        }
                    })
                ];
            }
        });
    }, Jyt = "https://raw.githubusercontent.com/webisoftSoftware/1AM-app-registery/main/registry.json", D7 = "local:appRegistry", Yz = "local:appRegistryTs", Yyt = 3600 * 1e3, Qyt = [
        {
            id: "zkmint",
            name: "ZKMint",
            description: "ZK-powered meme coin launchpad on Midnight",
            icon: "https://raw.githubusercontent.com/webisoftSoftware/1AM-app-registery/main/icons/zkmint.svg",
            url: "https://zkmint.1am.xyz",
            category: "defi",
            networks: [
                "preview"
            ],
            featured: !0
        },
        {
            id: "dominion",
            name: "Dominion",
            description: "On-chain poker with mental poker cryptography",
            icon: "https://raw.githubusercontent.com/webisoftSoftware/1AM-app-registery/main/icons/dominion.svg",
            url: "https://dominion.fun",
            category: "gaming",
            networks: [
                "preview",
                "preprod"
            ],
            featured: !0
        },
        {
            id: "explorer",
            name: "1AM Explorer",
            description: "Block explorer for Midnight Network",
            icon: "https://raw.githubusercontent.com/webisoftSoftware/1AM-app-registery/main/icons/1am-explorer.png",
            url: "https://explorer.1am.xyz",
            category: "tools",
            networks: [
                "preview",
                "preprod"
            ]
        }
    ];
    function Qz(t) {
        try {
            const e = new URL(t);
            return e.protocol === "https:" || e.protocol === "http:";
        } catch  {
            return !1;
        }
    }
    function B7(t) {
        return t.filter((e)=>Qz(e.url) && Qz(e.icon));
    }
    async function e1t() {
        try {
            const t = await zt.getItem(Yz);
            if (t && Date.now() - t < Yyt) {
                const e = await zt.getItem(D7);
                if (e?.apps?.length) return B7(e.apps);
            }
        } catch  {}
        try {
            const t = await fetch(Jyt, {
                cache: "no-cache"
            });
            if (t.ok) {
                const e = await t.json();
                if (e?.apps?.length) return await zt.setItem(D7, e), await zt.setItem(Yz, Date.now()), B7(e.apps);
            }
        } catch  {}
        try {
            const t = await zt.getItem(D7);
            if (t?.apps?.length) return B7(t.apps);
        } catch  {}
        return Qyt;
    }
    function t1t(t, e) {
        return t.filter((n)=>n.networks.includes(e) || n.networks.includes("*"));
    }
    var n1t = Q('<img class="w-7 h-7 object-contain">'), r1t = Q("<div>"), s1t = Q('<span class="text-white font-bold text-sm">'), i1t = Q('<div class=space-y-2><p class="text-[10px] font-semibold text-icon-muted uppercase tracking-wider">Featured'), o1t = Q('<p class="text-[10px] font-semibold text-icon-muted uppercase tracking-wider">All Apps'), a1t = Q('<div class="grid grid-cols-2 gap-2">'), c1t = Q('<div class="flex flex-col w-full min-h-0 p-4 gap-4"><div class="flex gap-1.5 overflow-x-auto pb-1 shrink-0 relative z-10"></div><div class=space-y-2></div><a href=https://github.com/webisoftSoftware/1AM-app-registery target=_blank rel="noopener noreferrer"class="flex items-center justify-center gap-2 py-3 rounded-sm border border-dashed border-border hover:border-foreground/30 transition-colors"><svg class="w-4 h-4 text-icon-muted"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 5v14M5 12h14"></path></svg><span class="text-xs font-medium text-content-muted-light">Submit Your App'), l1t = Q("<button>"), u1t = Q('<button class="w-full flex items-center gap-3 p-3 rounded-sm bg-card border border-border hover:border-foreground/30 transition-all text-left"><div class="flex-1 min-w-0"><div class="flex items-center gap-1.5"><span class="text-sm font-semibold text-foreground"></span></div><p class="text-xs text-content-muted-light truncate"></p></div><svg class="w-4 h-4 text-icon-muted shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3">'), d1t = Q('<div class="flex flex-col items-center justify-center py-12 text-center"><svg class="w-10 h-10 mb-3 text-border"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5><rect x=3 y=3 width=7 height=7 rx=1></rect><rect x=14 y=3 width=7 height=7 rx=1></rect><rect x=3 y=14 width=7 height=7 rx=1></rect><rect x=14 y=14 width=7 height=7 rx=1></rect></svg><p class="text-sm text-icon-muted uppercase">No apps in this category</p><p class="text-xs text-icon-muted mt-1">Check back soon'), f1t = Q('<button class="flex flex-col items-center gap-2 p-3 rounded-sm bg-card border border-border hover:border-foreground/30 transition-all text-center"><div class="w-10 h-10 rounded-lg bg-background flex items-center justify-center overflow-hidden"><img class="w-7 h-7 object-contain"></div><div class="min-w-0 w-full"><p class="text-xs font-semibold text-foreground truncate"></p><p class="text-[10px] text-content-muted-light truncate">');
    const p1t = {
        defi: "bg-emerald-500",
        gaming: "bg-amber-500",
        tools: "bg-blue-500",
        social: "bg-purple-500",
        nft: "bg-rose-500",
        other: "bg-gray-500"
    }, h1t = (t)=>{
        const [e, n] = pe(!1), r = ()=>p1t[t.app.category] || "bg-gray-500";
        return (()=>{
            var s = r1t();
            return F(s, I(de, {
                get when () {
                    return !e();
                },
                get fallback () {
                    return (()=>{
                        var i = s1t();
                        return F(i, ()=>t.app.name.slice(0, 2).toUpperCase()), i;
                    })();
                },
                get children () {
                    var i = n1t();
                    return i.addEventListener("error", ()=>n(!0)), pt((o)=>{
                        var a = t.app.icon, c = t.app.name;
                        return a !== o.e && Ot(i, "src", o.e = a), c !== o.t && Ot(i, "alt", o.t = c), o;
                    }, {
                        e: void 0,
                        t: void 0
                    }), i;
                }
            })), pt(()=>Vt(s, `${t.size || "w-10 h-10"} rounded-lg flex items-center justify-center overflow-hidden shrink-0 ${e() ? r() : "bg-background"}`)), s;
        })();
    }, g1t = [
        {
            id: "all",
            label: "All"
        },
        {
            id: "defi",
            label: "DeFi"
        },
        {
            id: "gaming",
            label: "Gaming"
        },
        {
            id: "tools",
            label: "Tools"
        },
        {
            id: "social",
            label: "Social"
        },
        {
            id: "nft",
            label: "NFT"
        }
    ], b1t = ()=>{
        const { environmentSettings: t } = lr(), [e] = cU(e1t), [n, r] = pe("all"), s = Ct(()=>{
            const c = e() || [], l = t().environment, u = t1t(c, l);
            return n() === "all" ? u : u.filter((d)=>d.category === n());
        }), i = Ct(()=>s().filter((c)=>c.featured)), o = Ct(()=>s().filter((c)=>!c.featured)), a = (c)=>{
            try {
                const l = new URL(c.url);
                if (l.protocol !== "https:" && l.protocol !== "http:") return;
            } catch  {
                return;
            }
            window.open(c.url, "_blank", "noopener,noreferrer");
        };
        return (()=>{
            var c = c1t(), l = c.firstChild, u = l.nextSibling;
            return F(l, I(_r, {
                each: g1t,
                children: (d)=>(()=>{
                        var f = l1t();
                        return f.$$click = ()=>r(d.id), F(f, ()=>d.label), pt(()=>Vt(f, `px-3 py-1.5 rounded-sm text-[10px] font-semibold uppercase tracking-wide whitespace-nowrap transition-colors ${n() === d.id ? "bg-foreground text-primary-foreground" : "bg-muted text-content-muted-light border border-border hover:bg-foreground/10"}`)), f;
                    })()
            })), F(c, I(de, {
                get when () {
                    return Ze(()=>n() === "all")() && i().length > 0;
                },
                get children () {
                    var d = i1t();
                    return d.firstChild, F(d, I(_r, {
                        get each () {
                            return i();
                        },
                        children: (f)=>(()=>{
                                var p = u1t(), h = p.firstChild, m = h.firstChild, w = m.firstChild, v = m.nextSibling;
                                return p.$$click = ()=>a(f), F(p, I(h1t, {
                                    app: f,
                                    size: "w-10 h-10"
                                }), h), F(w, ()=>f.name), F(m, I(de, {
                                    get when () {
                                        return f.new;
                                    },
                                    get children () {
                                        return I(lg, {
                                            tone: "success",
                                            variant: "color",
                                            size: "sm",
                                            class: "font-mono uppercase",
                                            children: "New"
                                        });
                                    }
                                }), null), F(v, ()=>f.description), p;
                            })()
                    }), null), d;
                }
            }), u), F(u, I(de, {
                get when () {
                    return Ze(()=>n() === "all")() && i().length > 0;
                },
                get children () {
                    return o1t();
                }
            }), null), F(u, I(de, {
                get when () {
                    return o().length > 0 || n() !== "all" && s().length > 0;
                },
                get fallback () {
                    return d1t();
                },
                get children () {
                    var d = a1t();
                    return F(d, I(_r, {
                        get each () {
                            return Ze(()=>n() !== "all")() ? s() : o();
                        },
                        children: (f)=>(()=>{
                                var p = f1t(), h = p.firstChild, m = h.firstChild, w = h.nextSibling, v = w.firstChild, k = v.nextSibling;
                                return p.$$click = ()=>a(f), m.addEventListener("error", (_)=>{
                                    _.target.style.display = "none";
                                }), F(v, ()=>f.name), F(k, ()=>f.description), pt((_)=>{
                                    var A = f.icon, P = f.name;
                                    return A !== _.e && Ot(m, "src", _.e = A), P !== _.t && Ot(m, "alt", _.t = P), _;
                                }, {
                                    e: void 0,
                                    t: void 0
                                }), p;
                            })()
                    })), d;
                }
            }), null), c;
        })();
    };
    Pi([
        "click"
    ]);
    var m1t = Q('<svg class="w-3.5 h-3.5 text-[var(--fg-error-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><circle cx=12 cy=12 r=10></circle><path d="M12 8v4M12 16h.01">'), y1t = Q('<div class="w-3 h-3 border-2 border-[var(--fg-warning-secondary)] border-t-transparent rounded-full animate-spin">'), w1t = Q('<svg class="w-3.5 h-3.5 text-[var(--fg-success-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><path d="M20 6 9 17l-5-5">'), _1t = Q('<svg class="w-3.5 h-3.5 text-[var(--fg-error-secondary)]"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5><path d="M18 6 6 18M6 6l12 12">'), x1t = Q('<svg class="w-3.5 h-3.5 text-blue-500"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4M12 8h.01">'), v1t = Q('<div class="flex items-center gap-3 mt-1"><p class="text-[10px] opacity-70 font-mono flex-1"></p><button class="shrink-0 px-3 py-1 text-[10px] font-semibold uppercase tracking-wider bg-[var(--bg-error-primary)] hover:opacity-90 text-[var(--text-error-primary)] rounded transition-colors">Retry'), S1t = Q('<div><p class="text-xs font-medium font-mono uppercase tracking-wide">'), k1t = Q('<button class="shrink-0 opacity-40 hover:opacity-100 transition-opacity"><svg class="w-3.5 h-3.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 6 6 18M6 6l12 12">'), T1t = Q('<div><div class=shrink-0></div><div class="flex-1 min-w-0">'), C1t = Q("<div>"), E1t = Q('<p class="text-[11px] opacity-70 mt-0.5 font-mono">'), I1t = Q('<p class="text-[10px] font-mono opacity-50 mt-0.5 truncate">'), A1t = Q('<div><p class="text-xs font-semibold font-mono uppercase tracking-wide">'), eU = Q('<div class="flex flex-col h-full"><div class="flex-1 min-h-0 overflow-hidden">'), P1t = Q('<div class="bg-[var(--bg-error-primary)] border-b border-[var(--border-error-subtle)] text-[var(--text-error-primary)] p-4"><p class=font-medium>Error</p><p class="text-sm opacity-90">'), O1t = Q('<div class="flex flex-col items-center justify-center py-32"><div class="relative w-12 h-12"><div class="absolute inset-0 border-4 border-primary/20 rounded-full"></div><div class="absolute inset-0 border-4 border-primary border-t-transparent rounded-full animate-spin"></div></div><p class="mt-4 text-sm text-content-muted">Initializing wallet...'), M1t = Q("<section>"), R1t = Q('<div class="flex flex-[0_0_auto] border-b border-[var(--border-secondary)] px-0 md:px-8 bg-[var(--bg-primary)]">'), N1t = Q('<main class="flex flex-col flex-[1_1_0] min-h-0 w-full overflow-hidden"><section class="flex min-h-0 flex-1 flex-col overflow-y-auto"><div class="flex flex-col min-h-full lg:container lg:border-x lg:border-[var(--border-secondary)]">');
    const V1t = Xte(()=>sr(()=>import("./DebugPanel-BYMERHCM.js").then(async (m)=>{
                await m.__tla;
                return m;
            }), __vite__mapDeps([12,6,7,4,8,3]))), [tU, e2] = pe(!1), [nU, t2] = pe(!1), D1t = ()=>{
        const t = lr(), { toasts: e, dismissToast: n, isSynced: r, transactions: s, networkHealth: i, refreshSync: o } = t, [a, c] = pe(!1), [l, u] = pe(null);
        let d = null;
        const f = ()=>s().length > 0, p = ()=>!r(), h = ()=>{
            const A = e();
            if (A.length === 0) return null;
            const P = A[A.length - 1];
            return P.id === l() ? null : P;
        }, m = ()=>p() || h() !== null;
        lt(()=>{
            m() ? (d !== null && cancelAnimationFrame(d), d = requestAnimationFrame(()=>{
                d = null, c(!0);
            })) : (d !== null && (cancelAnimationFrame(d), d = null), c(!1));
        }), It(()=>{
            d !== null && (cancelAnimationFrame(d), d = null);
        }), lt(()=>{
            const A = e().length > 0 ? e()[e().length - 1] : null;
            A && A.id !== l() && u(null);
        });
        const w = ()=>{
            const A = h();
            A && (u(A.id), n(A.id));
        }, v = ()=>p() ? "syncing" : h() ? "toast" : "none", k = ()=>i().overall === "down" || i().indexer === "down", _ = ()=>{
            const A = v();
            if (A === "syncing" && k()) return "bg-[var(--bg-error-primary)] border-[var(--border-error-subtle)] text-[var(--text-error-primary)]";
            if (A === "syncing") return "bg-[var(--bg-warning-primary)] border-[color:color-mix(in_srgb,var(--warning-foreground)_30%,transparent)] text-[var(--text-warning-primary)]";
            const P = h();
            if (!P) return "";
            switch(P.type){
                case "success":
                    return "bg-[var(--bg-success-primary)] border-[color:color-mix(in_srgb,var(--success-foreground)_30%,transparent)] text-[var(--text-success-primary)]";
                case "error":
                    return "bg-[var(--bg-error-primary)] border-[var(--border-error-subtle)] text-[var(--text-error-primary)]";
                case "info":
                    return "bg-blue-50 border-blue-200 text-blue-800";
                default:
                    return "bg-card border-border text-foreground";
            }
        };
        return (()=>{
            var A = C1t();
            return F(A, I(de, {
                get when () {
                    return m();
                },
                get children () {
                    var P = T1t(), U = P.firstChild, K = U.nextSibling;
                    return F(U, I(de, {
                        get when () {
                            return Ze(()=>v() === "syncing")() && k();
                        },
                        get children () {
                            return m1t();
                        }
                    }), null), F(U, I(de, {
                        get when () {
                            return Ze(()=>v() === "syncing")() && !k();
                        },
                        get children () {
                            return y1t();
                        }
                    }), null), F(U, I(de, {
                        get when () {
                            return v() === "toast";
                        },
                        get children () {
                            return [
                                I(de, {
                                    get when () {
                                        return h()?.type === "success";
                                    },
                                    get children () {
                                        return w1t();
                                    }
                                }),
                                I(de, {
                                    get when () {
                                        return h()?.type === "error";
                                    },
                                    get children () {
                                        return _1t();
                                    }
                                }),
                                I(de, {
                                    get when () {
                                        return h()?.type === "info";
                                    },
                                    get children () {
                                        return x1t();
                                    }
                                })
                            ];
                        }
                    }), null), F(K, I(de, {
                        get when () {
                            return v() === "syncing";
                        },
                        get children () {
                            var X = S1t(), G = X.firstChild;
                            return F(G, (()=>{
                                var ce = Ze(()=>!!k());
                                return ()=>ce() ? "Network unavailable" : f() ? "Syncing new transactions..." : "Syncing with the network...";
                            })()), F(X, I(de, {
                                get when () {
                                    return k();
                                },
                                get children () {
                                    var ce = v1t(), ie = ce.firstChild, Y = ie.nextSibling;
                                    return F(ie, (()=>{
                                        var M = Ze(()=>i().indexer === "down" && i().rpc === "down");
                                        return ()=>M() ? "Indexer and RPC are both unreachable. This is a network issue, not your wallet." : i().indexer === "down" ? "Midnight indexer is down. Wallet will sync when it recovers." : "Midnight RPC is unreachable. Check back shortly.";
                                    })()), Y.$$click = async ()=>{
                                        const { checkNetworkHealth: M } = await sr(async ()=>{
                                            const { checkNetworkHealth: y } = await Promise.resolve().then(()=>Y_);
                                            return {
                                                checkNetworkHealth: y
                                            };
                                        }, void 0);
                                        (await M(t.environmentSettings().environment)).overall === "healthy" && o();
                                    }, ce;
                                }
                            }), null), X;
                        }
                    }), null), F(K, I(de, {
                        get when () {
                            return Ze(()=>v() === "toast")() && h();
                        },
                        children: (X)=>{
                            const G = ()=>h();
                            return (()=>{
                                var ce = A1t(), ie = ce.firstChild;
                                return F(ie, ()=>G().title), F(ce, I(de, {
                                    get when () {
                                        return G().message;
                                    },
                                    get children () {
                                        var Y = E1t();
                                        return F(Y, ()=>G().message), Y;
                                    }
                                }), null), F(ce, I(de, {
                                    get when () {
                                        return G().txHash;
                                    },
                                    get children () {
                                        var Y = I1t();
                                        return F(Y, ()=>G().txHash), Y;
                                    }
                                }), null), ce;
                            })();
                        }
                    }), null), F(P, I(de, {
                        get when () {
                            return v() === "toast";
                        },
                        get children () {
                            var X = k1t();
                            return X.$$click = w, X;
                        }
                    }), null), pt(()=>Vt(P, `flex items-center gap-3 px-8 py-2.5 border-b rounded-none shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] ${_()}`)), P;
                }
            })), pt(()=>Vt(A, `overflow-hidden transition-all duration-300 ease-in-out ${a() && m() ? "max-h-24 opacity-100" : "max-h-0 opacity-0"}`)), A;
        })();
    }, B1t = ()=>{
        const t = lr(), { isLoading: e, error: n, isSynced: r } = t;
        return lt(()=>{
            document.documentElement.toggleAttribute("data-syncing", !r());
        }), [
            I(de, {
                get when () {
                    return tU();
                },
                get children () {
                    var s = eU(), i = s.firstChild;
                    return F(s, I(_7, {}), i), F(i, I(Kut, {
                        onBack: ()=>e2(!1)
                    })), s;
                }
            }),
            I(de, {
                get when () {
                    return nU();
                },
                get children () {
                    var s = eU(), i = s.firstChild;
                    return F(s, I(_7, {}), i), F(i, I(vdt, {
                        onBack: ()=>t2(!1)
                    })), s;
                }
            }),
            I(de, {
                get when () {
                    return Ze(()=>!tU())() && !nU();
                },
                get children () {
                    return [
                        I(_7, {}),
                        (()=>{
                            var s = N1t(), i = s.firstChild, o = i.firstChild;
                            return F(o, I(de, {
                                get when () {
                                    return n();
                                },
                                get children () {
                                    var a = P1t(), c = a.firstChild, l = c.nextSibling;
                                    return F(l, n), a;
                                }
                            }), null), F(o, I(de, {
                                get when () {
                                    return e();
                                },
                                get children () {
                                    return O1t();
                                }
                            }), null), F(o, I(de, {
                                get when () {
                                    return Ze(()=>!e())() && !n();
                                },
                                get children () {
                                    return [
                                        I(D1t, {}),
                                        I(Cft, {}),
                                        (()=>{
                                            var a = M1t();
                                            return F(a, I(Oyt, {}), null), F(a, I(Wyt, {}), null), F(a, I(Zyt, {}), null), pt(()=>Vt(a, `flex border-b border-[var(--border-secondary)] bg-background ${r() ? "" : "[&_*]:!transition-none [&_*]:!duration-0"}`)), a;
                                        })(),
                                        I(iat, {
                                            defaultValue: "transactions",
                                            class: "flex flex-col bg-[var(--bg-primary)]",
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var a = R1t();
                                                        return F(a, I(oat, {
                                                            class: "h-auto p-0 gap-3 bg-transparent border-0",
                                                            get children () {
                                                                return [
                                                                    I(cat, {
                                                                        variant: "line",
                                                                        class: "bg-foreground"
                                                                    }),
                                                                    I(h7, {
                                                                        value: "assets",
                                                                        label: "ASSETS",
                                                                        class: "px-4 py-3 text-content-muted-light font-semibold text-[12px] md:text-base rounded-md bg-transparent hover:text-grey-700 data-[selected]:text-[var(--color-foreground)] data-[selected]:hover:text-[var(--color-foreground)]",
                                                                        children: "ASSETS"
                                                                    }),
                                                                    I(h7, {
                                                                        value: "transactions",
                                                                        label: "TRANSACTIONS",
                                                                        class: "px-4 py-3 text-content-muted-light font-semibold text-[12px] md:text-base rounded-md bg-transparent hover:text-grey-700 data-[selected]:text-[var(--color-foreground)] data-[selected]:hover:text-[var(--color-foreground)]",
                                                                        children: "TRANSACTIONS"
                                                                    }),
                                                                    I(h7, {
                                                                        value: "apps",
                                                                        label: "APPS",
                                                                        class: "px-4 py-3 text-content-muted-light font-semibold text-[12px] md:text-base rounded-md bg-transparent hover:text-grey-700 data-[selected]:text-[var(--color-foreground)] data-[selected]:hover:text-[var(--color-foreground)]",
                                                                        children: "APPS"
                                                                    })
                                                                ];
                                                            }
                                                        })), a;
                                                    })(),
                                                    I(g7, {
                                                        value: "assets",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return I(Ndt, {});
                                                        }
                                                    }),
                                                    I(g7, {
                                                        value: "transactions",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return I(upt, {});
                                                        }
                                                    }),
                                                    I(g7, {
                                                        value: "apps",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return I(b1t, {});
                                                        }
                                                    })
                                                ];
                                            }
                                        }),
                                        I(de, {
                                            get when () {
                                                return t.environmentSettings().debugMode;
                                            },
                                            get children () {
                                                return I(V1t, {});
                                            }
                                        })
                                    ];
                                }
                            }), null), s;
                        })()
                    ];
                }
            })
        ];
    }, F1t = ()=>I(B1t, {});
    Pi([
        "click"
    ]);
    var L1t = Q('<div class="mt-3 p-3 bg-[var(--bg-error-primary)] border border-[var(--border-error-subtle)]"><div class="flex items-center gap-2"><svg class="w-4 h-4 text-[var(--fg-error-secondary)] shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 6 6 18M6 6l12 12"></path></svg><span class="type-text-sm text-[var(--text-error-primary)]">'), z1t = Q('<svg class="w-4 h-4 mr-2"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=3 y=11 width=18 height=11 rx=2 ry=2></rect><path d="M7 11V7a5 5 0 0 1 9.9-1">'), U1t = Q('<div class="flex flex-col h-full bg-background"><div class="flex-none bg-header px-5 py-5 border-b border-header-border"><div class="flex flex-col items-center gap-3"><div class=text-center><h1 class="type-text-lg font-bold text-header-foreground">Wallet Locked</h1><p class="mt-1 type-text-xs text-header-muted">Enter your password to continue</p></div></div></div><div class="flex-1 flex flex-col items-center justify-start pt-24 px-6"><div class="w-full max-w-sm bg-card border border-border p-6"><div class="flex justify-center mb-4"><div class="w-14 h-14 bg-background flex items-center justify-center"><svg class="w-7 h-7 text-foreground"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><rect x=3 y=11 width=18 height=11 rx=2 ry=2></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg></div></div><p class="mt-4 text-center type-text-xs text-content-muted-light">Forgot password? Recover with your seed phrase.'), H1t = Q('<div class="w-4 h-4 mr-2 border-2 border-white border-t-transparent rounded-full animate-spin">');
    const j1t = (t)=>{
        const [e, n] = pe(""), [r, s] = pe(null), [i, o] = pe(!1), [a, c] = pe(0);
        let l = null;
        const u = (h)=>{
            l && clearInterval(l), c(h), l = setInterval(()=>{
                c((m)=>m <= 1 ? (clearInterval(l), l = null, s(null), 0) : m - 1);
            }, 1e3);
        };
        It(()=>{
            l && clearInterval(l);
        });
        const d = ()=>a() > 0, f = async ()=>{
            if (!e().trim() || d()) return;
            s(null), o(!0);
            const h = new TextEncoder().encode(e());
            n("");
            try {
                await t.onUnlock(h);
            } catch (m) {
                const w = m instanceof Error ? m.message : "Wrong password", v = w.match(/Try again in (\d+)s/);
                v && u(parseInt(v[1], 10)), s(w), o(!1);
            } finally{
                h.fill(0);
            }
        }, p = (h)=>{
            h.key === "Enter" && f();
        };
        return (()=>{
            var h = U1t(), m = h.firstChild, w = m.firstChild, v = w.firstChild, k = m.nextSibling, _ = k.firstChild, A = _.firstChild, P = A.nextSibling;
            return F(w, I(Vm, {
                class: "h-7 w-auto",
                animated: !0
            }), v), F(_, I(og, {
                get value () {
                    return e();
                },
                onChange: n,
                get children () {
                    return I(Vy, {
                        type: "password",
                        get placeholder () {
                            return Ze(()=>!!d())() ? `Locked — ${a()}s` : "Enter password";
                        },
                        class: "h-11 type-text-sm border-border bg-white text-black placeholder:text-gray-400 rounded-none",
                        onKeyPress: p,
                        get disabled () {
                            return d();
                        },
                        autofocus: !0
                    });
                }
            }), P), F(_, I(de, {
                get when () {
                    return r();
                },
                get children () {
                    var U = L1t(), K = U.firstChild, X = K.firstChild, G = X.nextSibling;
                    return F(G, (()=>{
                        var ce = Ze(()=>!!d());
                        return ()=>ce() ? `Too many attempts. Try again in ${a()}s` : r();
                    })()), U;
                }
            }), P), F(_, I($r, {
                class: "w-full mt-4 bg-bg-primary-solid text-fg-white hover:opacity-90 rounded-none",
                onClick: f,
                get disabled () {
                    return !e().trim() || i() || d();
                },
                get children () {
                    return I(de, {
                        get when () {
                            return !i();
                        },
                        get fallback () {
                            return [
                                H1t(),
                                "UNLOCKING..."
                            ];
                        },
                        get children () {
                            return [
                                z1t(),
                                "UNLOCK"
                            ];
                        }
                    });
                }
            }), P), h;
        })();
    };
    function Ul(t) {
        if (typeof t == "string") {
            if (!/^\d+$/.test(t)) throw new Error("Invalid amount format");
            return BigInt(t);
        }
        if (typeof t == "number") {
            if (!Number.isSafeInteger(t)) throw new Error("Unsafe numeric amount");
            if (t < 0) throw new Error("Amount must be positive");
            return BigInt(t);
        }
        throw new Error("Invalid amount type");
    }
    async function q1t(t, e, n, r, s, i, o) {
        const { messageType: a, origin: c, payload: l } = t;
        if (!e) return Nt("InternalError", "Wallet not initialized");
        try {
            switch(a){
                case "DAPP_GET_SHIELDED_BALANCES":
                    return await W1t(e);
                case "DAPP_GET_UNSHIELDED_BALANCES":
                    return await K1t(e);
                case "DAPP_GET_DUST_BALANCE":
                    return await $1t(e, o);
                case "DAPP_GET_SHIELDED_ADDRESSES":
                    return await X1t(e, r, n);
                case "DAPP_GET_UNSHIELDED_ADDRESS":
                    return await G1t(e, n);
                case "DAPP_GET_DUST_ADDRESS":
                    return await Z1t(e, n);
                case "DAPP_GET_TX_HISTORY":
                    {
                        const u = l, d = Math.max(Number(u?.pageNumber) || 1, 1), f = Math.min(Math.max(Number(u?.pageSize) || 10, 1), 100);
                        return await J1t(e, {
                            pageNumber: d,
                            pageSize: f
                        });
                    }
                case "DAPP_SIGN_DATA":
                    {
                        const u = l, d = new Set([
                            "hex",
                            "base64",
                            "text"
                        ]);
                        return !u || typeof u.data != "string" || !u.options || typeof u.options.encoding != "string" || !d.has(u.options.encoding) ? Nt("InvalidRequest", "Invalid sign data payload: requires data (string) and options.encoding (hex|base64|text)") : u.data.length > 64 * 1024 ? Nt("InvalidRequest", "Sign data too large (max 64 KB)") : await Y1t(u, i, n);
                    }
                case "DAPP_MAKE_TRANSFER":
                    {
                        const u = l, d = u?.desiredOutputs ?? u?.outputs;
                        if (!u || !Array.isArray(d) || d.length === 0) return Nt("InvalidRequest", "Invalid transfer payload: requires desiredOutputs or outputs array");
                        if (u.options !== void 0 && (typeof u.options != "object" || u.options === null || u.options.payFees !== void 0 && typeof u.options.payFees != "boolean")) return Nt("InvalidRequest", "Invalid transfer options: payFees must be boolean");
                        if (d.length > 50) return Nt("InvalidRequest", "Too many outputs (max 50)");
                        for (const f of d){
                            if (!f || typeof f.recipient != "string" || typeof f.type != "string" || typeof f.value != "string" && typeof f.value != "number" || f.kind !== "shielded" && f.kind !== "unshielded") return Nt("InvalidRequest", "Invalid transfer output: requires recipient (string), type (string), value, and kind (shielded|unshielded)");
                            if (f.recipient.length > 256) return Nt("InvalidRequest", "Recipient address too long");
                            try {
                                const p = Ul(f.value);
                                if (p <= 0n) return Nt("InvalidRequest", "Transfer amount must be positive");
                                if (p > 10n ** 36n) return Nt("InvalidRequest", "Transfer amount exceeds maximum");
                            } catch  {
                                return Nt("InvalidRequest", "Invalid transfer amount");
                            }
                        }
                        return await rwt(e, {
                            outputs: d,
                            options: u.options
                        }, r, s, i, n);
                    }
                case "DAPP_MAKE_INTENT":
                    {
                        const u = l;
                        if (!u || !Array.isArray(u.desiredInputs) || !Array.isArray(u.desiredOutputs)) return Nt("InvalidRequest", "Invalid intent payload: requires desiredInputs and desiredOutputs arrays");
                        if (u.desiredInputs.length > 50) return Nt("InvalidRequest", "Too many desired inputs (max 50)");
                        if (u.desiredOutputs.length > 50) return Nt("InvalidRequest", "Too many desired outputs (max 50)");
                        for (const d of u.desiredInputs){
                            if (!d || typeof d.type != "string" || typeof d.value != "string" && typeof d.value != "number") return Nt("InvalidRequest", "Invalid desired input: requires type (string) and value");
                            try {
                                const f = Ul(d.value);
                                if (f <= 0n) return Nt("InvalidRequest", "Input amount must be positive");
                                if (f > 10n ** 36n) return Nt("InvalidRequest", "Input amount exceeds maximum");
                            } catch  {
                                return Nt("InvalidRequest", "Invalid input amount");
                            }
                        }
                        for (const d of u.desiredOutputs){
                            if (!d || typeof d.recipient != "string" || typeof d.type != "string" || typeof d.value != "string" && typeof d.value != "number" || d.kind !== "shielded" && d.kind !== "unshielded") return Nt("InvalidRequest", "Invalid desired output: requires recipient, type, value, and kind (shielded|unshielded)");
                            if (d.recipient.length > 256) return Nt("InvalidRequest", "Recipient address too long");
                            try {
                                const f = Ul(d.value);
                                if (f <= 0n) return Nt("InvalidRequest", "Output amount must be positive");
                                if (f > 10n ** 36n) return Nt("InvalidRequest", "Output amount exceeds maximum");
                            } catch  {
                                return Nt("InvalidRequest", "Invalid output amount");
                            }
                        }
                        return await Q1t(e, u, r, s, n);
                    }
                case "DAPP_BALANCE_UNSEALED_TX":
                    {
                        const u = l;
                        if (!u || typeof u.tx != "string" || !u.tx) return Nt("InvalidRequest", "Invalid payload: requires tx (hex string)");
                        if (u.tx.length > 2 * 1024 * 1024) return Nt("InvalidRequest", "Transaction too large");
                        if (o?.dustSponsorship && o?.balanceServiceUrl && !u._useLocalDust) try {
                            const { balanceOnly: d } = await sr(async ()=>{
                                const { balanceOnly: h } = await import("./balance-client-oZC5QpAj.js");
                                return {
                                    balanceOnly: h
                                };
                            }, []), f = dg(u.tx), p = await d(o.balanceServiceUrl, f, o.apiKey, o.clientId);
                            return Xs({
                                tx: p.txBytes
                            });
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] balanceOnly failed:", f), {
                                success: !1,
                                error: {
                                    code: "SponsorshipFailed",
                                    reason: f
                                },
                                data: {
                                    originalPayload: u
                                }
                            };
                        }
                        return await nwt(e, u, r, s, i, n);
                    }
                case "DAPP_BALANCE_SEALED_TX":
                    {
                        const u = l;
                        if (!u || typeof u.tx != "string" || !u.tx) return Nt("InvalidRequest", "Invalid payload: requires tx (hex string)");
                        if (u.tx.length > 2 * 1024 * 1024) return Nt("InvalidRequest", "Transaction too large");
                        if (o?.dustSponsorship && o?.balanceServiceUrl && !u._useLocalDust) try {
                            const { balanceOnly: d } = await sr(async ()=>{
                                const { balanceOnly: h } = await import("./balance-client-oZC5QpAj.js");
                                return {
                                    balanceOnly: h
                                };
                            }, []), f = dg(u.tx), p = await d(o.balanceServiceUrl, f, o.apiKey, o.clientId);
                            return Xs({
                                tx: p.txBytes
                            });
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] balanceOnly (sealed) failed:", f), {
                                success: !1,
                                error: {
                                    code: "SponsorshipFailed",
                                    reason: f
                                },
                                data: {
                                    originalPayload: u
                                }
                            };
                        }
                        return await twt(e, u, r, s);
                    }
                case "DAPP_SUBMIT_TRANSACTION":
                    {
                        const u = l;
                        return !u || typeof u.tx != "string" || !u.tx ? Nt("InvalidRequest", "Invalid payload: requires tx (hex string)") : u.tx.length > 2 * 1024 * 1024 ? Nt("InvalidRequest", "Transaction too large") : await ewt(e, u);
                    }
                case "DAPP_PROVING_CHECK":
                    {
                        const u = l;
                        if (!u?.serializedPreimage || !u?.keyLocation) return Nt("InvalidRequest", "Invalid proving check payload");
                        try {
                            const d = new Uint8Array(u.serializedPreimage), f = u.zkir ? new Uint8Array(u.zkir) : void 0, p = KT(d, f), h = o?.proofServerUrl || o?.balanceServiceUrl;
                            if (!h) return Nt("InternalError", "No proof server configured");
                            const m = {
                                "Content-Type": "application/octet-stream"
                            };
                            o?.apiKey && (m["X-API-Key"] = o.apiKey), o?.clientId && (m["X-Client-ID"] = o.clientId);
                            let w = await fetch(new URL("/check", h).toString(), {
                                method: "POST",
                                headers: m,
                                body: p,
                                signal: AbortSignal.timeout(6e4)
                            });
                            if (w.status === 404 && (w = await fetch(new URL("/verify", h).toString(), {
                                method: "POST",
                                headers: m,
                                body: p,
                                signal: AbortSignal.timeout(6e4)
                            })), w.status === 404) return Nt("InternalError", "Proof server does not support /check — ask your admin to add it");
                            if (!w.ok) {
                                const A = await w.text().catch(()=>"");
                                return console.error("[DApp] PROVING_CHECK server error:", w.status, A), Nt("InternalError", `Proof server check failed (${w.status}): ${A.slice(0, 200)}`);
                            }
                            const v = new Uint8Array(await w.arrayBuffer()), _ = $T(v).map((A)=>A === void 0 ? null : A.toString());
                            return Xs(_);
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] PROVING_CHECK error:", f, d), Nt("InternalError", `Proving check failed: ${f}`);
                        }
                    }
                case "DAPP_PROVING_PROVE":
                    {
                        const u = l;
                        if (!u?.serializedPreimage || !u?.keyLocation) return Nt("InvalidRequest", "Invalid proving payload");
                        try {
                            const d = new Uint8Array(u.serializedPreimage), f = u.overwriteBindingInput ? Ul(u.overwriteBindingInput) : void 0, p = 100 * 1024 * 1024, h = async (U)=>{
                                const K = atob(U), X = Uint8Array.from(K, (C, R)=>K.charCodeAt(R)), G = new DecompressionStream("gzip"), ce = G.writable.getWriter();
                                ce.write(X), ce.close();
                                const ie = [], Y = G.readable.getReader();
                                let M = 0;
                                for(;;){
                                    const { done: C, value: R } = await Y.read();
                                    if (C) break;
                                    if (M += R.length, M > p) throw new Error("Decompressed payload exceeds size limit");
                                    ie.push(R);
                                }
                                const g = new Uint8Array(M);
                                let y = 0;
                                for (const C of ie)g.set(C, y), y += C.length;
                                return g;
                            };
                            let m;
                            if (u.zkirGz && u.proverKeyGz && u.verifierKeyGz) {
                                const [U, K, X] = await Promise.all([
                                    h(u.zkirGz),
                                    h(u.proverKeyGz),
                                    h(u.verifierKeyGz)
                                ]);
                                m = {
                                    ir: U,
                                    proverKey: K,
                                    verifierKey: X
                                };
                            }
                            const w = XT(d, f, m), v = o?.proofServerUrl || o?.balanceServiceUrl;
                            if (!v) return Nt("InternalError", "No proof server configured");
                            const k = new URL("/prove", v), _ = {
                                "Content-Type": "application/octet-stream"
                            };
                            o?.apiKey && (_["X-API-Key"] = o.apiKey), o?.clientId && (_["X-Client-ID"] = o.clientId);
                            const A = await fetch(k.toString(), {
                                method: "POST",
                                headers: _,
                                body: w,
                                signal: AbortSignal.timeout(12e4)
                            });
                            if (!A.ok) {
                                const U = await A.text().catch(()=>"");
                                return console.error("[DApp] PROVING_PROVE server error:", A.status, U), Nt("InternalError", `Proof server prove failed (${A.status}): ${U.slice(0, 200)}`);
                            }
                            const P = new Uint8Array(await A.arrayBuffer());
                            return Xs(Array.from(P));
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] PROVING_PROVE error:", f, d), Nt("InternalError", `Proving failed: ${f}`);
                        }
                    }
                default:
                    return Nt("InvalidRequest", "Unknown message type");
            }
        } catch (u) {
            return console.error(`[DApp Handler] Error handling ${a}:`, u), Nt("InternalError", "An internal wallet error occurred");
        }
    }
    function zs(t, e, n) {
        chrome.runtime.sendMessage({
            type: "WALLET_RESPONSE",
            requestId: t,
            responseToken: n,
            data: e
        });
    }
    function Xs(t) {
        return {
            success: !0,
            data: t
        };
    }
    function Nt(t, e) {
        return {
            success: !1,
            error: {
                code: t,
                reason: e
            }
        };
    }
    async function W1t(t) {
        const e = await Dn(t.state().pipe(vu((r)=>r.isSynced))), n = {};
        for (const [r, s] of Object.entries(e.shielded.balances))n[r] = s.toString();
        return Xs(n);
    }
    async function K1t(t) {
        const e = await Dn(t.state().pipe(vu((r)=>r.isSynced))), n = {};
        for (const [r, s] of Object.entries(e.unshielded.balances))n[r] = s.toString();
        return Xs(n);
    }
    async function $1t(t, e) {
        const n = await Dn(t.state().pipe(vu((a)=>a.isSynced))), r = new Date;
        let s = n.dust.balance(r), o = n.unshielded.balances[Yx().raw] || 0n;
        return e?.dustSponsorship && s === 0n && (s = 1000000000000000n, o = s), Xs({
            cap: o.toString(),
            balance: s.toString()
        });
    }
    async function X1t(t, e, n) {
        if (!e) return Nt("InternalError", "Shielded keys not available");
        const r = e.coinPublicKey, s = e.encryptionPublicKey, i = ia.fromHexString(r), o = Jl.fromHexString(s), a = new Zl(i, o), c = Jr.encode(n.networkId, a).toString(), l = ia.codec.encode(n.networkId, i).toString(), u = Jl.codec.encode(n.networkId, o).toString();
        return Xs({
            shieldedAddress: c,
            shieldedCoinPublicKey: l,
            shieldedEncryptionPublicKey: u
        });
    }
    async function G1t(t, e) {
        const n = await Dn(t.state().pipe(vu((o)=>o.isSynced))), r = n.unshielded.address?.data, s = r ? new Wi(r) : n.unshielded.address, i = Jr.encode(e.networkId, s).toString();
        return Xs({
            unshieldedAddress: i
        });
    }
    async function Z1t(t, e) {
        const n = await Dn(t.state().pipe(vu((r)=>r.isSynced)));
        return Xs({
            dustAddress: Jr.encode(e.networkId, n.dust.address).toString()
        });
    }
    async function J1t(t, e) {
        return Xs([]);
    }
    async function Y1t(t, e, n) {
        if (!e) return Nt("InternalError", "Signing keys not available");
        const { data: r, options: s } = t, i = Yl(e, n.networkId);
        let o;
        switch(s.encoding){
            case "hex":
                o = new Uint8Array(Buffer.from(r, "hex"));
                break;
            case "base64":
                o = new Uint8Array(Buffer.from(r, "base64"));
                break;
            case "text":
                o = new Uint8Array(Buffer.from(r, "utf-8"));
                break;
            default:
                return Nt("InvalidRequest", "Unknown encoding");
        }
        const a = i.signData(o), c = i.getPublicKey(), l = typeof c == "object" && "toBytes" in c ? c.toBytes() : c;
        return Xs({
            data: r,
            signature: Buffer.from(a).toString("hex"),
            verifyingKey: Buffer.from(l).toString("hex")
        });
    }
    async function Q1t(t, e, n, r, s) {
        if (!n || !r) return Nt("InternalError", "Zswap secret key or dust secret key not available");
        const i = s.networkId, o = {}, a = [];
        for (const c of e.desiredInputs)o[c.type] = Ul(c.value);
        for (const c of e.desiredOutputs)try {
            if (c.kind === "shielded") {
                const l = Jr.parse(c.recipient);
                a.push({
                    type: "shielded",
                    outputs: [
                        {
                            type: c.type,
                            receiverAddress: l.decode(Zl, i),
                            amount: Ul(c.value)
                        }
                    ]
                });
            } else {
                const l = Jr.parse(c.recipient);
                a.push({
                    type: "unshielded",
                    outputs: [
                        {
                            type: c.type,
                            receiverAddress: l.decode(Wi, i),
                            amount: Ul(c.value)
                        }
                    ]
                });
            }
        } catch  {
            return Nt("InvalidRequest", "Invalid recipient address");
        }
        try {
            const c = await t.initSwap({
                unshielded: o
            }, a, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 18e5),
                payFees: e.options?.payFees ?? !0
            }), u = (await t.provingService.prove(c.transaction)).serialize();
            return Xs({
                tx: lw(u)
            });
        } catch (c) {
            return console.error("Error in initSwap", c), Nt("InternalError", `Operation failed: ${(c instanceof Error ? c.message : String(c)).slice(0, 300)}`);
        }
    }
    async function ewt(t, e) {
        if (!t) return Nt("InternalError", "Wallet not initialized");
        try {
            const { tx: n } = e, r = _n.deserialize("signature", "proof", "binding", dg(n)), s = await t.submitTransaction(r);
            let i = typeof s == "string" ? s : s instanceof Uint8Array ? lw(s) : String(s);
            (i.startsWith("0x") || i.startsWith("0X")) && (i = i.slice(2));
            let o = i;
            try {
                const { ENVIRONMENTS: a, getEnvironmentSettings: c } = await sr(async ()=>{
                    const { ENVIRONMENTS: d, getEnvironmentSettings: f } = await import("./request-fingerprint-BANtRL63.js").then((p)=>p.y);
                    return {
                        ENVIRONMENTS: d,
                        getEnvironmentSettings: f
                    };
                }, []), l = await c(), u = a[l.environment]?.indexerHttpUrl;
                if (u) {
                    const d = [
                        0,
                        3e3,
                        6e3
                    ];
                    for (const f of d){
                        f > 0 && await new Promise((p)=>setTimeout(p, f));
                        try {
                            const p = await fetch(u, {
                                method: "POST",
                                headers: {
                                    "Content-Type": "application/json"
                                },
                                signal: AbortSignal.timeout(1e4),
                                body: JSON.stringify({
                                    query: "query TxHash($id: HexEncoded!) { transactions(offset: { identifier: $id }) { hash } }",
                                    variables: {
                                        id: i
                                    }
                                })
                            });
                            if (p.ok) {
                                const m = (await p.json())?.data?.transactions?.[0]?.hash;
                                if (m && typeof m == "string" && m.length === 64) {
                                    o = m;
                                    break;
                                }
                            }
                        } catch  {}
                    }
                }
            } catch  {}
            return Xs({
                tx_id: i,
                txHash: o
            });
        } catch (n) {
            return console.error("Error in submitTransaction", n), Nt("InternalError", `Operation failed: ${(n instanceof Error ? n.message : String(n)).slice(0, 300)}`);
        }
    }
    async function twt(t, e, n, r) {
        if (!t || !n || !r) return Nt("InternalError", "Wallet, zswap secret key or dust secret key not initialized");
        try {
            const { tx: s } = e, i = _n.deserialize("signature", "proof", "binding", dg(s)), o = await t.balanceFinalizedTransaction(i, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3)
            }), a = await t.finalizeRecipe(o);
            return Xs({
                tx: lw(a.serialize())
            });
        } catch (s) {
            const i = s instanceof Error ? s.message : String(s);
            return console.error("Error in balanceUnsealedTransaction:", i, s), Nt("InternalError", `Balance failed: ${i.slice(0, 300)}`);
        }
    }
    async function nwt(t, e, n, r, s, i) {
        if (!t || !n || !r || !s) return Nt("InternalError", "Wallet, zswap secret key, dust secret key or night external key not initialized");
        try {
            const { tx: o } = e, a = Yl(s, i.networkId), c = (h)=>a.signData(h), l = _n.deserialize("signature", "proof", "pre-binding", dg(o)), u = await t.signUnboundTransaction(l, c), d = await t.balanceUnboundTransaction(u, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3)
            }), f = await t.signRecipe(d, c), p = await t.finalizeRecipe(f);
            return Xs({
                tx: lw(p.serialize())
            });
        } catch (o) {
            const a = o instanceof Error ? o.message : String(o);
            return console.error("Error in balanceUnsealedTransaction:", a, o), Nt("InternalError", `Balance failed: ${a.slice(0, 300)}`);
        }
    }
    async function rwt(t, e, n, r, s, i) {
        if (!t || !n || !r || !s) return Nt("InternalError", "Wallet, zswap secret key or dust secret key or night external key not initialized");
        const o = i.networkId, a = [];
        for (const c of e.outputs)try {
            const l = Jr.parse(c.recipient);
            c.kind === "shielded" ? a.push({
                type: "shielded",
                outputs: [
                    {
                        type: c.type,
                        receiverAddress: l.decode(Zl, o),
                        amount: Ul(c.value)
                    }
                ]
            }) : a.push({
                type: "unshielded",
                outputs: [
                    {
                        type: c.type,
                        receiverAddress: l.decode(Wi, o),
                        amount: Ul(c.value)
                    }
                ]
            });
        } catch  {
            return Nt("InvalidRequest", "Invalid recipient address");
        }
        try {
            const c = Yl(s, i.networkId), l = (p)=>c.signData(p), u = await t.transferTransaction(a, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3),
                payFees: e.options?.payFees ?? !0
            }), d = await t.signUnprovenTransaction(u.transaction, l), f = await t.finalizeTransaction(d);
            return Xs({
                tx: lw(f.serialize())
            });
        } catch (c) {
            return console.error("Error in transferTransaction", c), Nt("InternalError", `Operation failed: ${(c instanceof Error ? c.message : String(c)).slice(0, 300)}`);
        }
    }
    const yT = "_inflight_txs", swt = 20, NO = 1800 * 1e3;
    async function cb() {
        try {
            return (await chrome.storage.local.get(yT))[yT] ?? [];
        } catch  {
            return [];
        }
    }
    async function F9(t) {
        try {
            await chrome.storage.local.set({
                [yT]: t
            });
        } catch (e) {
            console.error("[Inflight] Storage write failed:", e);
        }
    }
    async function Pte(t) {
        const e = await cb(), n = Date.now(), s = e.filter((i)=>n - i.createdAt < NO && i.status !== "confirmed" && i.status !== "failed").filter((i)=>i.id !== t.id);
        for(; s.length >= swt;)s.shift();
        s.push(t), await F9(s);
    }
    async function wT(t, e) {
        const n = await cb(), r = n.findIndex((s)=>s.id === t);
        r < 0 || (n[r] = {
            ...n[r],
            ...e
        }, await F9(n));
    }
    async function _T(t) {
        const e = await cb();
        await F9(e.filter((n)=>n.id !== t));
    }
    async function iwt(t, e) {
        const n = await cb(), r = Date.now();
        return n.filter((s)=>s.walletScope === t && s.network === e && (s.status === "saved" || s.status === "submitting") && s.attempts < 3 && r - s.createdAt < NO);
    }
    function owt(t) {
        const e = t.toLowerCase();
        return e.includes("already known") || e.includes("alreadyimported") || e.includes("already in pool") || e.includes("transaction is outdated") || e.includes("duplicate");
    }
    async function awt() {
        const t = await cb(), e = Date.now(), n = t.filter((r)=>e - r.createdAt < NO);
        n.length !== t.length && await F9(n);
    }
    const cwt = Object.freeze(Object.defineProperty({
        __proto__: null,
        cleanExpired: awt,
        getInflightTxs: cb,
        getRecoverableTxs: iwt,
        isDuplicateTxError: owt,
        removeInflightTx: _T,
        saveInflightTx: Pte,
        updateInflightTx: wT
    }, Symbol.toStringTag, {
        value: "Module"
    })), lwt = new Set([
        "DAPP_GET_SHIELDED_BALANCES",
        "DAPP_GET_UNSHIELDED_BALANCES",
        "DAPP_GET_DUST_BALANCE",
        "DAPP_GET_TX_HISTORY",
        "DAPP_MAKE_TRANSFER",
        "DAPP_MAKE_INTENT",
        "DAPP_BALANCE_UNSEALED_TX",
        "DAPP_BALANCE_SEALED_TX"
    ]);
    function uwt(t) {
        return t !== "DAPP_CONNECT";
    }
    function b_(t) {
        return lwt.has(t);
    }
    const dwt = (t)=>{
        switch(t){
            case "DAPP_SUBMIT_TRANSACTION":
                return "confirmed";
            default:
                return "pending";
        }
    };
    var fwt = Q('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="w-full max-w-sm mx-4 bg-white rounded-xl shadow-2xl border border-[#E9EAEB] overflow-hidden">'), pwt = Q('<div class="fixed bottom-0 left-0 right-0 z-30 bg-foreground px-4 py-2 flex items-center justify-center gap-2"><div class="w-2.5 h-2.5 border-2 border-background border-t-transparent rounded-full animate-spin shrink-0"></div><span class="text-[11px] text-background font-mono uppercase tracking-wider truncate">'), hwt = Q('<div class="fixed inset-0 z-[60] flex flex-col bg-[#1A0000]"><div class="flex items-center gap-2 px-5 py-3 bg-[#2D0000] border-b border-red-900/50"><div class="w-2 h-2 rounded-full bg-red-500 animate-pulse"></div><span class="text-xs font-semibold uppercase tracking-widest text-red-400">Phishing Detection</span></div><div class="flex-1 overflow-y-auto px-6 py-8 flex flex-col items-center"><div class="w-20 h-20 rounded-full flex items-center justify-center mb-6 bg-red-600"><svg class="w-10 h-10 text-white"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path><path d="M12 8v4M12 16h.01"stroke-linecap=round></path></svg></div><h2 class="text-xl font-bold text-white text-center mb-2">Suspected phishing site</h2><p class="text-sm text-red-300/80 text-center mb-8 max-w-xs">This site has been flagged as a potential phishing attempt. Interacting with it may result in loss of funds.</p><div class="w-full max-w-sm space-y-4 mb-6"><div class="bg-red-950/60 border border-red-800/40 rounded-lg px-4 py-3"><div class="text-xs text-red-400 uppercase tracking-wide mb-1">Suspicious site</div><div class="text-sm font-mono text-red-200 break-all"></div></div><div class="bg-red-950/60 border border-red-800/40 rounded-lg px-4 py-3"><div class="text-xs text-red-400 uppercase tracking-wide mb-1">May be impersonating</div><div class="text-sm font-mono text-white break-all"></div></div><div class="flex items-start gap-3 bg-red-900/30 border border-red-700/40 rounded-lg px-4 py-3"><svg class="w-5 h-5 text-red-400 shrink-0 mt-0.5"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 8v4M12 16h.01"stroke-linecap=round></path></svg><p class="text-sm text-red-200"></p></div></div></div><div class="px-6 py-5 bg-[#2D0000] border-t border-red-900/50 space-y-3"><button class="w-full text-center text-xs text-red-500/60 hover:text-red-400 py-2 transition-colors">I understand the risks, proceed anyway'), gwt = Q('<div class="bg-[#181D27] px-5 py-4"><div class="flex items-center gap-2"><svg class="w-5 h-5 text-amber-400 shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><h3 class="text-base font-semibold text-white">'), bwt = Q('<div><div class="text-xs text-[#717680] uppercase tracking-wide mb-1">Details</div><div class="bg-[#F5F5F5] rounded px-3 py-2 space-y-1">'), mwt = Q('<div class="flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-lg px-3 py-2"><svg class="w-4 h-4 text-amber-500 shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><p class="text-xs text-amber-700">Wallet is still syncing. Please wait for sync to complete before approving this request from <!>.'), ywt = Q('<div class="text-xs text-[#94979C]">+<!> more request<!> waiting'), wwt = Q('<div class="px-5 py-4 space-y-3"><div><div class="text-xs text-[#717680] uppercase tracking-wide mb-1">Requesting site</div><div class="text-sm font-mono text-[#181D27] bg-[#F5F5F5] rounded px-3 py-2 break-all"></div></div><div><div class="text-xs text-[#717680] uppercase tracking-wide mb-1">Action</div><div class="text-sm text-[#181D27]">'), _wt = Q('<div class="px-5 py-4 border-t border-[#E9EAEB] flex gap-3">'), xwt = Q('<div class="text-xs font-mono text-[#181D27] break-all">'), vwt = Q('<hr class="border-[#E9EAEB] my-1">'), Swt = Q('<div class="text-xs text-rose-600 bg-rose-50 rounded px-3 py-2 border border-rose-200">You have no dust in your wallet. Generate dust first or wait for the proof server to come back online.'), kwt = Q('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="w-full max-w-sm mx-4 bg-white rounded-xl shadow-2xl border border-[#E9EAEB] overflow-hidden"><div class="bg-[#181D27] px-5 py-4"><div class="flex items-center gap-2"><svg class="w-5 h-5 text-amber-400 shrink-0"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg><h3 class="text-base font-semibold text-white">Dust Sponsorship Failed</h3></div></div><div class="px-5 py-4 space-y-3"><div><div class="text-xs text-[#717680] uppercase tracking-wide mb-1">Requesting site</div><div class="text-sm font-mono text-[#181D27] bg-[#F5F5F5] rounded px-3 py-2 break-all"></div></div><div><div class="text-xs text-[#717680] uppercase tracking-wide mb-1">Reason</div><div class="text-sm text-[#181D27] bg-[#FEF3C7] rounded px-3 py-2"></div></div><div class="text-sm text-[#535862]">The proof server could not sponsor this transaction. Would you like to pay the dust fee from your own wallet instead?</div></div><div class="px-5 py-4 border-t border-[#E9EAEB] flex gap-3">');
    const [rU, pc] = pe([]), [Twt, F7] = pe(new Set), VO = new Set, n2 = new Map, Ote = 6e4, xT = new Map, Cwt = 5e3;
    function Ewt(t) {
        const e = xT.get(t);
        return e ? Date.now() - e > Cwt ? (xT.delete(t), !1) : !0 : !1;
    }
    function Iwt(t) {
        xT.set(t, Date.now());
    }
    function Ih(t, e, n) {
        return jte(t, e, n, 500);
    }
    function Awt(t) {
        if (VO.has(t)) return !0;
        const e = n2.get(t);
        return !!(e && Date.now() - e < Ote);
    }
    function Pwt(t) {
        VO.add(t);
    }
    function hc(t) {
        VO.delete(t), n2.set(t, Date.now());
        for (const [e, n] of n2)Date.now() - n > Ote && n2.delete(e);
    }
    const [sU, L7] = pe(null), z7 = new Set([
        "DAPP_CONNECT",
        "DAPP_SIGN_DATA",
        "DAPP_MAKE_TRANSFER",
        "DAPP_MAKE_INTENT",
        "DAPP_BALANCE_UNSEALED_TX",
        "DAPP_BALANCE_SEALED_TX",
        "DAPP_SUBMIT_TRANSACTION",
        "DAPP_PROVING_CHECK",
        "DAPP_PROVING_PROVE",
        "CARDANO_CIP_ENABLE",
        "CARDANO_CIP_SIGN_TX",
        "CARDANO_CIP_SIGN_DATA"
    ]);
    function U7(t, e = !1) {
        switch(t.messageType){
            case "DAPP_CONNECT":
                return {
                    title: "Connection Request",
                    detail: "This site wants to connect to your wallet and view your balances and addresses."
                };
            case "DAPP_SIGN_DATA":
                {
                    const n = t.payload, r = n?.options?.encoding ?? "unknown", s = n?.data ? n.data.length > 120 ? n.data.slice(0, 120) + "..." : n.data : "(empty)";
                    return {
                        title: "Sign Data",
                        detail: `Sign ${r}-encoded data`,
                        breakdown: [
                            `Encoding: ${r}`,
                            `Data: ${s}`
                        ]
                    };
                }
            case "DAPP_MAKE_TRANSFER":
                {
                    const n = t.payload, r = n?.desiredOutputs ?? n?.outputs ?? [], s = r.map((o, a)=>{
                        const c = o.value ?? "?", l = o.type ?? "tokens", u = o.kind ?? "unknown", d = o.recipient ?? "(unknown)";
                        return `#${a + 1}: ${c} ${l} (${u}) → ${d}`;
                    }), i = r.map((o)=>`${o.value ?? "?"} ${o.type ?? "tokens"}`).join(", ");
                    return {
                        title: "Transfer Request",
                        detail: i ? `Send ${i}` : "Create a token transfer",
                        breakdown: s
                    };
                }
            case "DAPP_MAKE_INTENT":
                {
                    const n = t.payload, r = (n?.desiredInputs ?? []).map((i)=>`${i.value ?? "?"} ${i.type ?? "tokens"} (in)`), s = (n?.desiredOutputs ?? []).map((i)=>{
                        const o = i.recipient ?? "(unknown)";
                        return `${i.value ?? "?"} ${i.type ?? "tokens"} → ${o}`;
                    });
                    return {
                        title: "Swap Intent",
                        detail: "Create a swap intent transaction",
                        breakdown: [
                            ...r,
                            "---",
                            ...s
                        ]
                    };
                }
            case "DAPP_BALANCE_UNSEALED_TX":
                {
                    const n = t.payload, r = n?.tx?.length ?? 0, s = n?.tx ? `${n.tx.slice(0, 16)}...${n.tx.slice(-16)}` : "(unknown)", i = r > 0 ? (r / 2 / 1024).toFixed(1) : "?";
                    return {
                        title: "Balance & Sign Transaction",
                        detail: e ? "A DApp is asking your wallet to sign and finalize a transaction. Dust fees are sponsored by ProofStation by 1AM." : "A DApp is asking your wallet to sign, balance (pay dust fees), and finalize a transaction.",
                        breakdown: [
                            "Type: Unsealed (pre-binding)",
                            `Size: ~${i} KB`,
                            `TX: ${s}`,
                            e ? "Dust free — sponsored by ProofStation by 1AM" : "Dust fees will be deducted from your wallet",
                            "⚠ Cannot preview transaction contents — only approve if you trust this DApp"
                        ]
                    };
                }
            case "DAPP_BALANCE_SEALED_TX":
                {
                    const n = t.payload, r = n?.tx?.length ?? 0, s = n?.tx ? `${n.tx.slice(0, 16)}...${n.tx.slice(-16)}` : "(unknown)", i = r > 0 ? (r / 2 / 1024).toFixed(1) : "?";
                    return {
                        title: "Balance Transaction",
                        detail: e ? "A DApp is asking your wallet to finalize a sealed transaction. Dust fees are sponsored by ProofStation by 1AM." : "A DApp is asking your wallet to balance (pay dust fees) for a sealed transaction.",
                        breakdown: [
                            "Type: Sealed (fully signed)",
                            `Size: ~${i} KB`,
                            `TX: ${s}`,
                            e ? "Dust free — sponsored by ProofStation by 1AM" : "Dust fees will be deducted from your wallet",
                            "⚠ Cannot preview transaction contents — only approve if you trust this DApp"
                        ]
                    };
                }
            case "DAPP_SUBMIT_TRANSACTION":
                {
                    const n = t.payload;
                    return {
                        title: "Submit Transaction",
                        detail: "Submit a finalized transaction to the network",
                        breakdown: [
                            `TX: ${n?.tx ? `${n.tx.slice(0, 16)}...${n.tx.slice(-16)}` : "(unknown)"}`
                        ]
                    };
                }
            case "DAPP_PROVING_CHECK":
                return {
                    title: "Proving Check",
                    detail: "A DApp wants to check if your wallet can generate a ZK proof for a transaction."
                };
            case "DAPP_PROVING_PROVE":
                return {
                    title: "Generate ZK Proof",
                    detail: "A DApp wants your wallet to generate a zero-knowledge proof. This is a computationally expensive operation."
                };
            case "CARDANO_CIP_ENABLE":
                return {
                    title: "Connect Cardano Wallet",
                    detail: "This site wants to connect to your 1AM Cardano account and read your Cardano wallet data."
                };
            case "CARDANO_CIP_SIGN_TX":
                return {
                    title: "Sign Cardano Transaction",
                    detail: "This site wants you to sign a Cardano transaction with your active 1AM account."
                };
            case "CARDANO_CIP_SIGN_DATA":
                return {
                    title: "Sign Cardano Message",
                    detail: "This site wants you to sign Cardano message data with your active 1AM account."
                };
            default:
                return {
                    title: t.messageType,
                    detail: ""
                };
        }
    }
    const Owt = ()=>{
        const t = lr(), [e, n] = pe(new Map), [r, s] = pe([]), [i, o] = pe(null);
        ga(()=>{
            const m = window.__ONE_AM_SHELL__, w = m === "popup" ? "wallet-ui-popup" : m === "sidepanel" ? "wallet-ui-sidepanel" : "wallet-ui-fullpage", v = chrome.runtime.connect({
                name: w
            }), k = new Set, _ = (A)=>{
                if (A.type !== "DAPP_REQUEST" || k.has(A.requestId)) return;
                k.add(A.requestId);
                const P = {
                    requestId: A.requestId,
                    responseToken: A.responseToken,
                    messageType: A.messageType,
                    origin: A.origin,
                    payload: A.payload,
                    _phishing: A._phishing
                };
                if (P._phishing) {
                    o(P);
                    return;
                }
                if (Ewt(P.origin)) {
                    zs(P.requestId, {
                        success: !1,
                        error: {
                            code: "Rejected",
                            reason: "Connection was denied — all requests from this origin are blocked"
                        }
                    }, P.responseToken);
                    return;
                }
                if (P.messageType === "DAPP_CONNECT") {
                    const K = P.payload;
                    Nm().then(async (X)=>{
                        const G = ir[X.environment], { resolveNetworkMismatch: ce } = await sr(async ()=>{
                            const { resolveNetworkMismatch: M } = await import("./network-switch-DRJCZ7R9.js");
                            return {
                                resolveNetworkMismatch: M
                            };
                        }, []), ie = ce(K?.networkId, G.networkId);
                        if (ie.action === "reject") {
                            zs(P.requestId, {
                                success: !1,
                                error: {
                                    code: "InvalidRequest",
                                    reason: ie.reason
                                }
                            }, P.responseToken);
                            return;
                        }
                        if (ie.action === "switch") {
                            zs(P.requestId, {
                                success: !1,
                                error: {
                                    code: "InvalidRequest",
                                    reason: `Network mismatch. Wallet is on ${ie.currentNetwork}, requested ${ie.requestedNetwork}. Switch networks in 1AM and try again.`
                                }
                            }, P.responseToken);
                            return;
                        }
                        r().find((M)=>M.messageType === "DAPP_CONNECT" && M.origin === P.origin) ? zs(P.requestId, {
                            success: !1,
                            error: {
                                code: "InternalError",
                                reason: "Connection request already pending — please wait"
                            }
                        }, P.responseToken) : s((M)=>[
                                ...M,
                                P
                            ]);
                    });
                    return;
                }
                const U = Ih(P.origin, P.messageType, P.payload);
                if (z7.has(P.messageType) && Awt(U)) {
                    zs(P.requestId, {
                        success: !1,
                        error: {
                            code: "InvalidRequest",
                            reason: "Duplicate request — a similar request is already pending"
                        }
                    }, P.responseToken);
                    return;
                }
                z7.has(P.messageType) ? (Pwt(U), s((K)=>[
                        ...K,
                        P
                    ])) : pc((K)=>[
                        ...K,
                        P
                    ]);
            };
            v.onMessage.addListener(_), chrome.runtime.sendMessage({
                type: "WALLET_TAB_READY"
            }), It(()=>{
                v.onMessage.removeListener(_), v.disconnect();
            });
        });
        const a = ()=>{
            const m = i();
            m && (zs(m.requestId, {
                success: !1,
                error: {
                    code: "Rejected",
                    reason: "User rejected — suspected phishing site"
                }
            }, m.responseToken), hc(Ih(m.origin, m.messageType, m.payload))), o(null);
        }, c = ()=>{
            const m = i();
            if (!m) return;
            o(null);
            const w = {
                ...m,
                _phishing: void 0
            };
            z7.has(w.messageType) ? s((v)=>[
                    ...v,
                    w
                ]) : pc((v)=>[
                    ...v,
                    w
                ]);
        }, l = (m)=>{
            const w = r().find((k)=>k.requestId === m);
            if (!w) return;
            const v = structuredClone(w);
            if (v.messageType === "DAPP_CONNECT") {
                Nm().then((k)=>{
                    const _ = ir[k.environment], A = v.payload;
                    A?.networkId && A.networkId !== _.networkId ? zs(v.requestId, {
                        success: !1,
                        error: {
                            code: "InvalidRequest",
                            reason: `Network mismatch. Wallet is on ${_.networkId}, requested ${A.networkId}`
                        }
                    }, v.responseToken) : zs(v.requestId, {
                        success: !0,
                        data: {
                            authorized: !0,
                            networkId: _.networkId
                        }
                    }, v.responseToken), s((P)=>P.filter((U)=>U.requestId !== m));
                });
                return;
            }
            if (v.messageType === "CARDANO_CIP_ENABLE" || v.messageType === "CARDANO_CIP_SIGN_TX" || v.messageType === "CARDANO_CIP_SIGN_DATA") {
                hc(Ih(v.origin, v.messageType, v.payload)), zs(v.requestId, {
                    success: !0,
                    data: {
                        authorized: !0
                    }
                }, v.responseToken), s((k)=>k.filter((_)=>_.requestId !== m));
                return;
            }
            s((k)=>k.filter((_)=>_.requestId !== m)), pc((k)=>[
                    ...k,
                    v
                ]);
        }, u = (m, w)=>{
            Iwt(m);
            const v = r().filter((k)=>k.origin === m);
            for (const k of v)zs(k.requestId, {
                success: !1,
                error: {
                    code: "Rejected",
                    reason: w
                }
            }, k.responseToken), hc(Ih(k.origin, k.messageType, k.payload));
            s((k)=>k.filter((_)=>_.origin !== m));
        }, d = (m)=>{
            const w = r().find((v)=>v.requestId === m);
            if (w) {
                if (w.messageType === "DAPP_CONNECT") {
                    u(w.origin, "User rejected the connection");
                    return;
                }
                zs(w.requestId, {
                    success: !1,
                    error: {
                        code: "Rejected",
                        reason: "User rejected the request"
                    }
                }, w.responseToken), hc(Ih(w.origin, w.messageType, w.payload)), s((v)=>v.filter((k)=>k.requestId !== m));
            }
        };
        lt(()=>{
            const m = rU(), w = Twt();
            for (const v of m)w.has(v.requestId) || (F7((k)=>new Set([
                    ...k,
                    v.requestId
                ])), n((k)=>new Map(k).set(v.requestId, {
                    status: "processing"
                })), v._approvedNetwork = t.environmentSettings().environment, p(v));
        });
        const f = new Set;
        It(()=>{
            for (const m of f)clearInterval(m);
            f.clear();
        });
        const p = async (m)=>{
            const w = Ih(m.origin, m.messageType, m.payload), v = new Set([
                "DAPP_SUBMIT_TRANSACTION"
            ]), _ = new Set([
                "DAPP_SUBMIT_TRANSACTION",
                "DAPP_MAKE_TRANSFER",
                "DAPP_MAKE_INTENT",
                "DAPP_BALANCE_UNSEALED_TX",
                "DAPP_BALANCE_SEALED_TX"
            ]).has(m.messageType);
            try {
                const A = Date.now(), P = 3e4, U = ()=>Math.max(0, P - (Date.now() - A)), K = (y, C)=>C <= 0 || y() ? Promise.resolve() : new Promise((R)=>{
                        const N = setInterval(()=>{
                            y() && (clearInterval(N), f.delete(N), R());
                        }, 100);
                        f.add(N), setTimeout(()=>{
                            clearInterval(N), f.delete(N), R();
                        }, C);
                    });
                if (uwt(m.messageType) && await K(()=>!t.isLoading() && !!t.getWallet(), U()), b_(m.messageType) && await K(()=>t.isSynced(), U()), _ && t.isSecondaryContext()) {
                    zs(m.requestId, {
                        success: !1,
                        error: {
                            code: "InternalError",
                            reason: "Wallet is active in another window — please use that window"
                        }
                    }, m.responseToken), hc(w), pc((y)=>y.filter((C)=>C.requestId !== m.requestId));
                    return;
                }
                if (_ && !await t.acquireTxLock(3e4)) {
                    zs(m.requestId, {
                        success: !1,
                        error: {
                            code: "InternalError",
                            reason: "Wallet busy — another transaction is in progress"
                        }
                    }, m.responseToken), hc(w), pc((C)=>C.filter((R)=>R.requestId !== m.requestId));
                    return;
                }
                const X = t.environmentSettings();
                if (_) {
                    const y = m._approvedNetwork;
                    if (y && y !== X.environment) {
                        zs(m.requestId, {
                            success: !1,
                            error: {
                                code: "InternalError",
                                reason: "Network changed during request — please retry"
                            }
                        }, m.responseToken), hc(w), t.releaseTxLock(), pc((C)=>C.filter((R)=>R.requestId !== m.requestId));
                        return;
                    }
                }
                const G = await t.getZswapSecretKeys().catch(()=>null), ce = await t.getNightExternalKey().catch(()=>null), ie = await t.getDustSecretKey().catch(()=>null);
                let Y = null;
                if (v.has(m.messageType)) {
                    const C = m.payload?.tx || JSON.stringify(m.payload)?.slice(0, 2e3) || "";
                    Y = crypto.randomUUID(), await Pte({
                        id: Y,
                        txHex: C,
                        network: X.environment,
                        walletScope: `${t.activeWalletId()}:${t.activeAccountIndex?.() ?? 0}`,
                        txType: "dapp",
                        dappOrigin: m.origin,
                        status: "submitting",
                        createdAt: Date.now(),
                        attempts: 1
                    });
                }
                const M = ce ? await aT(ce) : void 0, g = await q1t(m, t.getWallet(), t.configuration, G, ie, ce, {
                    dustSponsorship: X.dustSponsorship,
                    balanceServiceUrl: X.dustSponsorshipUrl || X.proofServerUrl,
                    proofServerUrl: X.proofServerUrl,
                    apiKey: X.proofStationApiKey,
                    clientId: M
                });
                if (Y) if (g.success) {
                    const y = g.data, C = y?.txHash || y?.tx_id;
                    await wT(Y, {
                        status: "confirmed",
                        txHash: typeof C == "string" ? C : void 0
                    }), setTimeout(()=>_T(Y), 5e3);
                } else await wT(Y, {
                    status: "failed",
                    error: g.error?.reason
                }), setTimeout(()=>_T(Y), 1e4);
                if (!g.success && g.error?.code === "SponsorshipFailed") {
                    const y = g.data;
                    L7({
                        request: m,
                        reason: g.error?.reason || "Proof server unavailable",
                        originalPayload: y?.originalPayload,
                        pendingId: null
                    }), n((C)=>new Map(C).set(m.requestId, {
                            status: "awaiting-fallback"
                        })), F7((C)=>{
                        const R = new Set(C);
                        return R.delete(m.requestId), R;
                    }), pc((C)=>C.filter((R)=>R.requestId !== m.requestId)), hc(w), _ && t.releaseTxLock();
                    return;
                }
                if (zs(m.requestId, g, m.responseToken), n((y)=>new Map(y).set(m.requestId, {
                        status: "done"
                    })), g.success && v.has(m.messageType)) {
                    const y = g.data, C = y?.txHash || y?.tx_id;
                    if (C) {
                        const R = t.trackDAppTx(m.messageType, m.origin);
                        t.resolveDAppTx(R, C, void 0, dwt(m.messageType));
                    }
                    t.addToast({
                        type: "success",
                        title: "Transaction submitted",
                        txHash: C
                    });
                } else g.success || g.success || t.addToast({
                    type: "error",
                    title: `${U7(m).title} failed`,
                    message: g.error?.reason || "Failed"
                });
                hc(w), _ && t.releaseTxLock(), pc((y)=>y.filter((C)=>C.requestId !== m.requestId));
            } catch (A) {
                console.error("[Wallet UI] Request error:", A);
                const P = A instanceof Error ? A.message : "Unknown error";
                console.error("[Wallet UI] DApp request error:", P), n((K)=>new Map(K).set(m.requestId, {
                        status: "error",
                        message: P
                    })), zs(m.requestId, {
                    success: !1,
                    error: {
                        code: "InternalError",
                        reason: "Operation failed"
                    }
                }, m.responseToken);
                const U = P.includes("No dust") ? "No dust available in your wallet to pay transaction fees" : "Request could not be processed";
                t.addToast({
                    type: "error",
                    title: `${U7(m).title} failed`,
                    message: U
                }), hc(w), _ && t.releaseTxLock(), pc((K)=>K.filter((X)=>X.requestId !== m.requestId));
            } finally{
                F7((A)=>{
                    if (!A.has(m.requestId)) return A;
                    const P = new Set(A);
                    return P.delete(m.requestId), P;
                });
            }
        }, h = ()=>{
            const m = e();
            return Array.from(m.entries()).filter(([w, v])=>v.status === "processing").map(([w])=>rU().find((v)=>v.requestId === w)).filter(Boolean);
        };
        return [
            I(de, {
                get when () {
                    return i();
                },
                children: (m)=>{
                    const w = m()._phishing;
                    return (()=>{
                        var v = hwt(), k = v.firstChild, _ = k.nextSibling, A = _.firstChild, P = A.nextSibling, U = P.nextSibling, K = U.nextSibling, X = K.firstChild, G = X.firstChild, ce = G.nextSibling, ie = X.nextSibling, Y = ie.firstChild, M = Y.nextSibling, g = ie.nextSibling, y = g.firstChild, C = y.nextSibling, R = _.nextSibling, N = R.firstChild;
                        return F(ce, ()=>m().origin), F(M, ()=>w.lookalike), F(C, ()=>w.reason), F(R, I($r, {
                            class: "w-full h-12 text-base font-semibold bg-white text-[#181D27] hover:bg-gray-100",
                            onClick: a,
                            children: "Go back to safety"
                        }), N), N.$$click = c, v;
                    })();
                }
            }),
            I(de, {
                get when () {
                    return Ze(()=>r().length > 0)() && !i();
                },
                get children () {
                    var m = fwt(), w = m.firstChild;
                    return F(w, ()=>{
                        const v = r()[0], k = t.environmentSettings(), { title: _, detail: A, breakdown: P } = U7(v, !!k.dustSponsorship);
                        return [
                            (()=>{
                                var U = gwt(), K = U.firstChild, X = K.firstChild, G = X.nextSibling;
                                return F(G, _), U;
                            })(),
                            (()=>{
                                var U = wwt(), K = U.firstChild, X = K.firstChild, G = X.nextSibling, ce = K.nextSibling, ie = ce.firstChild, Y = ie.nextSibling;
                                return F(G, ()=>v.origin), F(Y, A), F(U, I(de, {
                                    get when () {
                                        return P && P.length > 0;
                                    },
                                    get children () {
                                        var M = bwt(), g = M.firstChild, y = g.nextSibling;
                                        return F(y, I(_r, {
                                            each: P,
                                            children: (C)=>I(de, {
                                                    when: C !== "---",
                                                    get fallback () {
                                                        return vwt();
                                                    },
                                                    get children () {
                                                        var R = xwt();
                                                        return F(R, C), R;
                                                    }
                                                })
                                        })), M;
                                    }
                                }), null), F(U, I(de, {
                                    get when () {
                                        return Ze(()=>!t.isSynced())() && b_(v.messageType);
                                    },
                                    get children () {
                                        var M = mwt(), g = M.firstChild, y = g.nextSibling, C = y.firstChild, R = C.nextSibling;
                                        return R.nextSibling, F(y, ()=>v.origin, R), M;
                                    }
                                }), null), F(U, I(de, {
                                    get when () {
                                        return r().length > 1;
                                    },
                                    get children () {
                                        var M = ywt(), g = M.firstChild, y = g.nextSibling, C = y.nextSibling, R = C.nextSibling;
                                        return R.nextSibling, F(M, ()=>r().length - 1, y), F(M, ()=>r().length > 2 ? "s" : "", R), M;
                                    }
                                }), null), U;
                            })(),
                            (()=>{
                                var U = _wt();
                                return F(U, I($r, {
                                    variant: "outline",
                                    class: "flex-1 border-[#E9EAEB] text-[#181D27] hover:bg-[#F5F5F5]",
                                    onClick: ()=>d(v.requestId),
                                    children: "Reject"
                                }), null), F(U, I($r, {
                                    get class () {
                                        return `flex-1 ${!t.isSynced() && b_(v.messageType) ? "bg-[#181D27]/40 cursor-not-allowed" : "bg-[#181D27] hover:bg-[#181D27]/90"} text-white`;
                                    },
                                    get disabled () {
                                        return Ze(()=>!t.isSynced())() && b_(v.messageType);
                                    },
                                    onClick: ()=>l(v.requestId),
                                    children: "Approve"
                                }), null), U;
                            })()
                        ];
                    }), m;
                }
            }),
            I(de, {
                get when () {
                    return sU();
                },
                get children () {
                    return (()=>{
                        const m = sU();
                        return (()=>{
                            var w = kwt(), v = w.firstChild, k = v.firstChild, _ = k.nextSibling, A = _.firstChild, P = A.firstChild, U = P.nextSibling, K = A.nextSibling, X = K.firstChild, G = X.nextSibling;
                            K.nextSibling;
                            var ce = _.nextSibling;
                            return F(U, ()=>m.request.origin), F(G, ()=>m.reason), F(_, I(de, {
                                get when () {
                                    return t.dustBalance() === 0n;
                                },
                                get children () {
                                    return Swt();
                                }
                            }), null), F(ce, I($r, {
                                variant: "outline",
                                class: "flex-1 border-[#E9EAEB] text-[#181D27] hover:bg-[#F5F5F5]",
                                onClick: ()=>{
                                    zs(m.request.requestId, {
                                        success: !1,
                                        error: {
                                            code: "Rejected",
                                            reason: "User declined to pay dust fee"
                                        }
                                    }, m.request.responseToken), m.pendingId && t.resolveDAppTx(m.pendingId, void 0, "Sponsorship failed — user declined"), L7(null);
                                },
                                children: "Reject"
                            }), null), F(ce, I($r, {
                                get class () {
                                    return `flex-1 ${t.dustBalance() === 0n ? "bg-[#181D27]/40 cursor-not-allowed" : "bg-[#181D27] hover:bg-[#181D27]/90"} text-white`;
                                },
                                get disabled () {
                                    return t.dustBalance() === 0n;
                                },
                                onClick: ()=>{
                                    const ie = {
                                        ...m.request,
                                        payload: {
                                            ...m.originalPayload,
                                            _useLocalDust: !0
                                        }
                                    };
                                    L7(null), pc((Y)=>[
                                            ...Y,
                                            ie
                                        ]);
                                },
                                children: "Pay with My Dust"
                            }), null), w;
                        })();
                    })();
                }
            }),
            I(de, {
                get when () {
                    return h().length > 0;
                },
                get children () {
                    var m = pwt(), w = m.firstChild, v = w.nextSibling;
                    return F(v, ()=>h()[0]?.messageType.replace("DAPP_", "").replace(/_/g, " ")), m;
                }
            })
        ];
    };
    Pi([
        "click"
    ]);
    var Mte = Q('<div class="flex items-center justify-center h-full"><div class="w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin">');
    const Mwt = ()=>(ga(()=>{
            xi.tabs.create({
                url: xi.runtime.getURL("/fullpage.html?mode=welcome")
            }), window.close();
        }), I(Sot, {}));
    async function Rwt() {
        const [t, e, n] = await Promise.all([
            Dit(),
            Nh().catch(()=>null),
            zi().catch(()=>null)
        ]);
        return t === "none" ? (xi.tabs.create({
            url: xi.runtime.getURL("/fullpage.html?mode=welcome")
        }), window.close(), {
            status: t,
            contents: null,
            metadata: null
        }) : {
            status: t,
            contents: e,
            metadata: n
        };
    }
    let Nwt;
    Nwt = ()=>(ga(()=>{
            const t = xi.runtime.getURL("/fullpage.html?mode=social-unlock");
            if (window.location.pathname.endsWith("/fullpage.html")) {
                window.location.href = t;
                return;
            }
            xi.tabs.create({
                url: t
            }), window.close();
        }), Mte());
    gxt = ()=>{
        const [t] = cU(Rwt), [e, n] = pe(!1);
        ga(async ()=>{
            const a = await Nm();
            document.documentElement.setAttribute("data-theme", a.theme || "light");
        });
        const r = ()=>t()?.status ?? "none", s = ()=>t()?.contents != null, i = ()=>t()?.metadata?.walletKind ?? "password", o = async (a)=>{
            const { key: c, salt: l } = await sT(a);
            await Fit(c, l), a.fill(0), n(!0);
        };
        return I(de, {
            get when () {
                return !t.loading;
            },
            get fallback () {
                return Mte();
            },
            get children () {
                return I(TT, {
                    get children () {
                        return [
                            I(td, {
                                get when () {
                                    return Ze(()=>r() === "locked")() && (s() || e());
                                },
                                get children () {
                                    return I(Not, {
                                        get initialVaultContents () {
                                            return t()?.contents;
                                        },
                                        get children () {
                                            return [
                                                I(F1t, {}),
                                                I(Owt, {})
                                            ];
                                        }
                                    });
                                }
                            }),
                            I(td, {
                                get when () {
                                    return Ze(()=>r() === "locked" && !s() && !e())() && i() === "social-web3auth";
                                },
                                get children () {
                                    return I(Nwt, {});
                                }
                            }),
                            I(td, {
                                get when () {
                                    return Ze(()=>r() === "locked" && !s() && !e())() && i() !== "social-web3auth";
                                },
                                get children () {
                                    return I(j1t, {
                                        onUnlock: o
                                    });
                                }
                            }),
                            I(td, {
                                get when () {
                                    return r() === "none";
                                },
                                get children () {
                                    return I(Mwt, {});
                                }
                            })
                        ];
                    }
                });
            }
        });
    };
});
export { PUe as $, gxt as A, $r as B, Fit as C, ose as D, JU as E, qQ as F, gM as G, QQ as H, yot as I, _ot as J, m2t as K, zi as L, b2t as M, wot as N, sst as O, yn as P, mU as Q, du as R, oT as S, og as T, yU as U, ht as V, Sot as W, EQ as X, g9 as Y, sb as Z, bu as _, WQ as a, X2t as a$, dLe as a0, lr as a1, _n as a2, dg as a3, dxt as a4, z2t as a5, K2t as a6, J2t as a7, W2t as a8, N2t as a9, fxt as aA, ryt as aB, Ly as aC, zl as aD, hd as aE, zy as aF, Op as aG, q2t as aH, V2t as aI, M2t as aJ, cxt as aK, rxt as aL, $pt as aM, v2t as aN, oxt as aO, nxt as aP, k2t as aQ, pxt as aR, S2t as aS, H2t as aT, Xpt as aU, A2t as aV, B2t as aW, uxt as aX, T2t as aY, U2t as aZ, P2t as a_, E2t as aa, Z2t as ab, I2t as ac, j2t as ad, D2t as ae, $2t as af, F2t as ag, axt as ah, ixt as ai, sxt as aj, txt as ak, Q2t as al, ext as am, Y2t as an, lxt as ao, lw as ap, G2t as aq, hu as ar, Qf as as, ug as at, Hd as au, rs as av, hxt as aw, Ate as ax, Ap as ay, Pp as az, KQ as b, uRe as b$, R2t as b0, L2t as b1, O2t as b2, C2t as b3, Lwt as b4, To as b5, sp as b6, Hy as b7, l6 as b8, PH as b9, u_t as bA, Xwt as bB, Mp as bC, Xg as bD, Fa as bE, cC as bF, wn as bG, Bn as bH, gr as bI, kwe as bJ, Ma as bK, mt as bL, wr as bM, ln as bN, yf as bO, Zb as bP, st as bQ, pr as bR, Fr as bS, _c as bT, ym as bU, Ad as bV, vwe as bW, qc as bX, xwe as bY, _we as bZ, lRe as b_, ev as ba, F_e as bb, Ft as bc, mg as bd, Pr as be, vg as bf, ad as bg, xg as bh, tj as bi, lv as bj, P0 as bk, ip as bl, O0 as bm, Xt as bn, B_e as bo, k2 as bp, j as bq, ze as br, Fe as bs, dn as bt, Xi as bu, wt as bv, Zt as bw, B$ as bx, nt as by, Gg as bz, eh as c, St as c0, yo as c1, Swe as c2, Gy as c3, jt as c4, V as c5, XM as c6, Zwt as c7, Gwt as c8, tn as c9, Io as cA, ud as cB, Ywt as cC, T_e as cD, Y2 as cE, l_t as cF, L_e as cG, N_e as cH, s_t as cI, Jwt as cJ, Kwt as cK, R_e as cL, Ydt as cM, bte as cN, Gdt as cO, w2t as cP, Zdt as cQ, qdt as cR, x2t as cS, _2t as cT, y2t as cU, Jdt as cV, mte as cW, A1 as ca, N_t as cb, Os as cc, Or as cd, $f as ce, OG as cf, ARe as cg, en as ch, D_t as ci, ri as cj, k_t as ck, C_t as cl, A3 as cm, V_t as cn, Wl as co, F_t as cp, or as cq, Cn as cr, wl as cs, f_t as ct, d_t as cu, p_t as cv, yv as cw, Pd as cx, py as cy, c_t as cz, Ae as d, yr as e, OP as f, $s as g, gu as h, $n as i, v9 as j, _9 as k, hg as l, qt as m, x9 as n, xn as o, Vy as p, xi as q, Dit as r, Ny as s, zQ as t, Zd as u, sH as v, jQ as w, g2t as x, fc as y, sT as z, __tla };
